Skip to content

API error: 405 - {"detail":"Method Not Allowed"} #6

@brilliant199912

Description

@brilliant199912

I have completed the first two steps and configured the DeepSeek API. Why am I getting a 405 error: {"detail":"Method Not Allowed"}?

python main.py --phase code_generation

`(cellforge) xxxxxxx scAgents % python main.py --phase code_generation
✅ Loaded environment variables from /Users/xxxxxx/Documents/cellforge/scAgents/.env
✅ Sentence transformer encoder initialized
✅ CellForge Qdrant client initialized
✅ cellforge_tmp Qdrant client initialized
✅ Collection task_analysis_papers exists in CellForge
✅ Collection task_analysis_experimental_designs exists in CellForge
✅ Collection task_analysis_implementation_guides exists in CellForge
✅ Collection task_analysis_evaluation_frameworks exists in CellForge
✅ Collection task_analysis_decision_support exists in CellForge
✅ Collection task_analysis_papers exists in cellforge_tmp
✅ Collection task_analysis_experimental_designs exists in cellforge_tmp
✅ Collection task_analysis_implementation_guides exists in cellforge_tmp
✅ Collection task_analysis_evaluation_frameworks exists in cellforge_tmp
✅ Collection task_analysis_decision_support exists in cellforge_tmp
✅ Dataset loaded successfully: /Users/xxxxxx/Documents/cellforge/scAgents/cellforge/data/datasets/NormanWeissman2019_filtered.h5ad

DATASET INFORMATION

Shape: (111445, 33694)
Number of cells: 111445
Number of genes: 33694

Observation (cells) columns:
['guide_id', 'read_count', 'UMI_count', 'coverage', 'gemgroup', 'good_coverage', 'number_of_cells', 'tissue_type', 'cell_line', 'cancer', 'disease', 'perturbation_type', 'celltype', 'organism', 'perturbation', 'nperts', 'ngenes', 'ncounts', 'percent_mito', 'percent_ribo']

Variable (genes) columns:
['ensemble_id', 'ncounts', 'ncells']

Loaded .env from: /Users/xxxxxxDocuments/cellforge/scAgents/.env
Loaded .env from: /Users/xxxxxx/Documents/cellforge/scAgents/.env
Loaded .env from: /Users/xxxxxx/Documents/cellforge/scAgents/.env

============================================================
PHASE 3: CODE GENERATION

📋 Found research plan: cellforge/data/results/research_plan_20251109_035634.json
🔧 Generating code from research plan...
INFO:cellforge.Code_Generation:Loaded environment from: /Users/xxxxxx/Documents/cellforge/scAgents/.env
INFO:cellforge.Code_Generation:Using API configuration: deepseek
INFO:cellforge.Code_Generation:=== Starting Code Generation with OpenHands ===
INFO:cellforge.Code_Generation:Starting OpenHands Docker container...
INFO:cellforge.Code_Generation:Docker available: Docker version 28.5.1, build e180ab8
INFO:cellforge.Code_Generation:Docker Compose available: Docker Compose version v2.40.2-desktop.1
INFO:cellforge.Code_Generation:Stopping any existing OpenHands containers...
INFO:cellforge.Code_Generation:Prepared environment variables for deepseek
INFO:cellforge.Code_Generation:Building and starting OpenHands container...
INFO:cellforge.Code_Generation:OpenHands Docker container started successfully
INFO:cellforge.Code_Generation:Container output: #1 [internal] load local bake definitions
#1 reading from stdin 639B done
#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 3.33kB done
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/library/node:24.8-trixie-slim
#3 DONE 0.0s

#4 [internal] load metadata for docker.io/library/python:3.13.7-slim-trixie
#4 DONE 0.0s

#5 [internal] load .dockerignore
#5 transferring context: 335B done
#5 DONE 0.0s

#6 [base 1/1] FROM docker.io/library/python:3.13.7-slim-trixie@sha256:5f55cdf0c5d9dc1a415637a5ccc4a9e18663ad203673173b8cda8f8dcacef689
#6 resolve docker.io/library/python:3.13.7-slim-trixie@sha256:5f55cdf0c5d9dc1a415637a5ccc4a9e18663ad203673173b8cda8f8dcacef689 done
#6 DONE 0.0s

#7 [frontend-builder 1/6] FROM docker.io/library/node:24.8-trixie-slim@sha256:a7f91166324d17fa1029718c876f3b02fb542e64d3cf40208ae6d31ff33c90c9
#7 resolve docker.io/library/node:24.8-trixie-slim@sha256:a7f91166324d17fa1029718c876f3b02fb542e64d3cf40208ae6d31ff33c90c9 done
#7 DONE 0.0s

#8 [internal] load build context
#8 transferring context: 118.91kB 0.0s done
#8 DONE 0.0s

#9 [backend-builder 2/5] RUN apt-get update -y && apt-get install -y curl make git build-essential jq gettext && python3 -m pip install poetry --break-system-packages
#9 CACHED

#10 [openhands-app 2/20] RUN mkdir -p /.openhands
#10 CACHED

#11 [backend-builder 3/5] COPY pyproject.toml poetry.lock ./
#11 CACHED

#12 [backend-builder 4/5] RUN touch README.md
#12 CACHED

#13 [frontend-builder 5/6] COPY frontend ./
#13 CACHED

#14 [openhands-app 10/20] RUN sudo chown -R openhands:openhands /opt/workspace_base && sudo chmod -R 770 /opt/workspace_base
#14 CACHED

#15 [openhands-app 5/20] RUN sed -i 's/^UID_MIN.*/UID_MIN 499/' /etc/login.defs
#15 CACHED

#16 [openhands-app 18/20] COPY --chown=openhands:openhands --chmod=770 --from=frontend-builder /app/build ./frontend/build
#16 CACHED

#17 [openhands-app 16/20] RUN python openhands/core/download.py # No-op to download assets
#17 CACHED

#18 [openhands-app 8/20] RUN useradd -l -m -u 42420 --gid 42420 -s /bin/bash openhands && usermod -aG openhands openhands && usermod -aG sudo openhands && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
#18 CACHED

#19 [openhands-app 3/20] RUN mkdir -p /opt/workspace_base
#19 CACHED

#20 [openhands-app 7/20] RUN groupadd --gid 42420 openhands
#20 CACHED

#21 [openhands-app 17/20] RUN find /app ! -group openhands -exec chgrp openhands {} +
#21 CACHED

#22 [openhands-app 15/20] COPY --chown=openhands:openhands pyproject.toml poetry.lock README.md MANIFEST.in LICENSE ./
#22 CACHED

#23 [frontend-builder 4/6] RUN npm ci
#23 CACHED

#24 [backend-builder 5/5] RUN export POETRY_CACHE_DIR && poetry install --no-root && rm -rf /tmp/poetry_cache
#24 CACHED

#25 [openhands-app 12/20] COPY --chown=openhands:openhands --chmod=770 ./microagents ./microagents
#25 CACHED

#26 [openhands-app 11/20] COPY --chown=openhands:openhands --chmod=770 --from=backend-builder /app/.venv /app/.venv
#26 CACHED

#27 [backend-builder 1/5] WORKDIR /app
#27 CACHED

#28 [frontend-builder 3/6] COPY frontend/package.json frontend/package-lock.json ./
#28 CACHED

#29 [openhands-app 13/20] COPY --chown=openhands:openhands --chmod=770 ./openhands ./openhands
#29 CACHED

#30 [openhands-app 9/20] RUN chown -R openhands:openhands /app && chmod -R 770 /app
#30 CACHED

#31 [frontend-builder 2/6] WORKDIR /app
#31 CACHED

#32 [openhands-app 6/20] RUN sed -i 's/^UID_MAX.*/UID_MAX 1000000/' /etc/login.defs
#32 CACHED

#33 [openhands-app 4/20] RUN apt-get update -y && apt-get install -y curl ssh sudo && rm -rf /var/lib/apt/lists/*
#33 CACHED

#34 [frontend-builder 6/6] RUN npm run build
#34 CACHED

#35 [openhands-app 19/20] COPY --chown=openhands:openhands --chmod=770 ./containers/app/entrypoint.sh /app/entrypoint.sh
#35 CACHED

#36 [openhands-app 14/20] COPY --chown=openhands:openhands --chmod=777 ./openhands/runtime/plugins ./openhands/runtime/plugins
#36 CACHED

#37 [openhands-app 20/20] WORKDIR /app
#37 CACHED

#38 exporting to image
#38 exporting layers done
#38 exporting manifest sha256:020dc0d708a881ae8dd0ea94a8ed5f8afc5c15b4ab9f5dafe8c07726b27397df done
#38 exporting config sha256:a169f00afffd104ff29bab86e8af5124a31df7882798ebce946ef612418fe02a done
#38 exporting attestation manifest sha256:c423e269e84f9d6e98ce6b84a1d755e4acd1fd9886e949513e5800b4bc776880 done
#38 exporting manifest list sha256:7a022c17df380ebe8be4f6bbaaf666f5e0e818305bacdc1d94ae616520d284ef done
#38 naming to docker.io/library/openhands:latest done
#38 unpacking to docker.io/library/openhands:latest done
#38 DONE 0.0s

#39 resolving provenance for metadata file
#39 DONE 0.0s

INFO:cellforge.Code_Generation:Waiting for OpenHands to be ready...
INFO:cellforge.Code_Generation:OpenHands is ready!
INFO:cellforge.Code_Generation:Large research plan detected (27241 characters), ensuring complete input...
INFO:cellforge.Code_Generation:Waiting for complete JSON input...
INFO:cellforge.Code_Generation:JSON content is complete and valid
INFO:cellforge.Code_Generation:Sending request to OpenHands API...
INFO:cellforge.Code_Generation:Detected large JSON content, ensuring complete input...
INFO:cellforge.Code_Generation:Waiting for complete JSON input...
INFO:cellforge.Code_Generation:JSON content is complete and valid
INFO:cellforge.Code_Generation:Sending request to: http://localhost:3000/api/chat
INFO:cellforge.Code_Generation:Using model: deepseek-chat
INFO:cellforge.Code_Generation:Response status: 405
ERROR:cellforge.Code_Generation:OpenHands API error: 405 - {"detail":"Method Not Allowed"}
ERROR:cellforge.Code_Generation:Failed to generate code
INFO:cellforge.Code_Generation:Stopping OpenHands Docker container...
INFO:cellforge.Code_Generation:OpenHands Docker container stopped successfully
❌ Code generation failed
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions