langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Devcontainer hangs on Poetry dependency resolution

Open cvansteenburg opened this issue 1 year ago • 4 comments

Checked other resources

  • [X] I added a very descriptive title to this issue.
  • [X] I searched the LangChain documentation with the integrated search.
  • [X] I used the GitHub search to find a similar question and didn't find it.
  • [X] I am sure that this is a bug in LangChain rather than my code.

Example Code

To reproduce, simply open a dev container here.

Two problems:

  1. Dependency azure-ai-vision has been yanked from Pypi and replaced by [another MS package](replaced by https://pypi.org/project/azure-ai-vision-imageanalysis/1.0.0b1/). This change is not reflected in pyproject.toml.
  2. Upon updating the package reference, Poetry dependency resolution takes hours before it ultimately crashes.

Error Message and Stack Trace (if applicable)

The first problem is here:

#13 [langchain langchain-dev-dependencies 5/5] RUN poetry install --no-interaction --no-ansi --with dev,test,docs
2024-01-25 02:25:15.795Z: #13 1.180 Updating dependencies
2024-01-25 02:25:15.945Z: #13 1.180 Resolving dependencies...
2024-01-25 02:25:21.202Z: #13 6.587 
#13 6.587 Because langchain depends on azure-ai-vision (^0.11.1b1) which doesn't match any versions, version solving failed.
2024-01-25 02:25:21.653Z: #13 ERROR: process "/bin/sh -c poetry install --no-interaction --no-ansi --with dev,test,docs" did not complete successfully: exit code: 1
2024-01-25 02:25:21.750Z: ------
 > [langchain langchain-dev-dependencies 5/5] RUN poetry install --no-interaction --no-ansi --with dev,test,docs:
1.180 Updating dependencies
1.180 Resolving dependencies...
6.587 
6.587 Because langchain depends on azure-ai-vision (^0.11.1b1) which doesn't match any versions, version solving failed.

The full stack trace is 1.5M lines (poetry solving dependencies in verbose mode), but the final message error is:

(You may notice the poetry command is missing --with dev,test,docs. This is because I was experimenting with different installs to see if one would solve. The outcome is the same with or without.)

failed to solve: process "/bin/sh -c poetry install -vvv --no-interaction --no-ansi --no-cache" did not complete successfully: exit code: 1
[2024-01-25T01:29:33.420Z] Stop (11249526 ms): Run: docker compose --project-name langchain_devcontainer -f /workspaces/langchain/.devcontainer/docker-compose.yaml -f /tmp/devcontainercli-root/docker-compose/docker-compose.devcontainer.build-1706134923893.yml build
[2024-01-25T01:29:34.801Z] Error: Command failed: docker compose --project-name langchain_devcontainer -f /workspaces/langchain/.devcontainer/docker-compose.yaml -f /tmp/devcontainercli-root/docker-compose/docker-compose.devcontainer.build-1706134923893.yml build
[2024-01-25T01:29:34.801Z]     at pw (/root/.vscode-remote-containers/dist/dev-containers-cli-0.327.0/dist/spec-node/devContainersSpecCLI.js:427:522)
[2024-01-25T01:29:34.801Z]     at runMicrotasks (<anonymous>)
[2024-01-25T01:29:34.801Z]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2024-01-25T01:29:34.801Z]     at async L$ (/root/.vscode-remote-containers/dist/dev-containers-cli-0.327.0/dist/spec-node/devContainersSpecCLI.js:427:2493)
[2024-01-25T01:29:34.802Z]     at async N$ (/root/.vscode-remote-containers/dist/dev-containers-cli-0.327.0/dist/spec-node/devContainersSpecCLI.js:409:3165)
[2024-01-25T01:29:34.802Z]     at async tAA (/root/.vscode-remote-containers/dist/dev-containers-cli-0.327.0/dist/spec-node/devContainersSpecCLI.js:479:3833)
[2024-01-25T01:29:34.802Z]     at async CC (/root/.vscode-remote-containers/dist/dev-containers-cli-0.327.0/dist/spec-node/devContainersSpecCLI.js:479:4775)
[2024-01-25T01:29:34.802Z]     at async NeA (/root/.vscode-remote-containers/dist/dev-containers-cli-0.327.0/dist/spec-node/devContainersSpecCLI.js:612:11107)
[2024-01-25T01:29:34.802Z]     at async MeA (/root/.vscode-remote-containers/dist/dev-containers-cli-0.327.0/dist/spec-node/devContainersSpecCLI.js:612:10848)
[2024-01-25T01:29:34.942Z] Stop (11253362 ms): Run in container: node /root/.vscode-remote-containers/dist/dev-containers-cli-0.327.0/dist/spec-node/devContainersSpecCLI.js up --container-session-data-folder /tmp/devcontainers-7edf6f65-e5f1-47df-8de6-ecd2483665631706134915493 --workspace-folder /workspaces/langchain --workspace-mount-consistency cached --id-label vsch.local.repository=https://github.com/cvansteenburg/langchain --id-label vsch.local.repository.volume=langchain-d0a07d0e50de76837e566b51dfd52879223a47f0cf6c9249f8998de5ea549f4c --id-label vsch.local.repository.folder=langchain --id-label devcontainer.config_file=/workspaces/langchain/.devcontainer/devcontainer.json --log-level debug --log-format json --config /workspaces/langchain/.devcontainer/devcontainer.json --override-config /tmp/devcontainer-b183d847-3f84-4dfc-bf18-cb61dde92812.json --default-user-env-probe loginInteractiveShell --remove-existing-container --mount type=volume,source=langchain-d0a07d0e50de76837e566b51dfd52879223a47f0cf6c9249f8998de5ea549f4c,target=/workspaces,external=true --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default off --mount-workspace-git-root --terminal-columns 178 --terminal-rows 15
[2024-01-25T01:29:34.945Z] Exit code 1
[2024-01-25T01:29:34.948Z] Start: Run: docker rm -f d465e5855c617b703922f6eafccdf2bde11f6140c0baaa5e1e9f860bc70973ac
[2024-01-25T01:29:34.964Z] Command failed: node /root/.vscode-remote-containers/dist/dev-containers-cli-0.327.0/dist/spec-node/devContainersSpecCLI.js up --container-session-data-folder /tmp/devcontainers-7edf6f65-e5f1-47df-8de6-ecd2483665631706134915493 --workspace-folder /workspaces/langchain --workspace-mount-consistency cached --id-label vsch.local.repository=https://github.com/cvansteenburg/langchain --id-label vsch.local.repository.volume=langchain-d0a07d0e50de76837e566b51dfd52879223a47f0cf6c9249f8998de5ea549f4c --id-label vsch.local.repository.folder=langchain --id-label devcontainer.config_file=/workspaces/langchain/.devcontainer/devcontainer.json --log-level debug --log-format json --config /workspaces/langchain/.devcontainer/devcontainer.json --override-config /tmp/devcontainer-b183d847-3f84-4dfc-bf18-cb61dde92812.json --default-user-env-probe loginInteractiveShell --remove-existing-container --mount type=volume,source=langchain-d0a07d0e50de76837e566b51dfd52879223a47f0cf6c9249f8998de5ea549f4c,target=/workspaces,external=true --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default off --mount-workspace-git-root --terminal-columns 178 --terminal-rows 15
[2024-01-25T01:29:34.965Z] Exit code 1
[2024-01-25T01:29:35.311Z] Stop (11256492 ms): Run in container: /bin/sh
[2024-01-25T01:29:35.311Z] Container server terminated (code: 137, signal: null).
[2024-01-25T01:29:35.312Z] Stop (11256684 ms): Run in container: /bin/sh
[2024-01-25T01:29:35.647Z] Stop (699 ms): Run: docker rm -f d465e5855c617b703922f6eafccdf2bde11f6140c0baaa5e1e9f860bc70973ac
[2024-01-25T01:30:34.625Z] Start: Run: docker volume ls -q
[2024-01-25T01:30:34.707Z] Stop (82 ms): Run: docker volume ls -q
[2024-01-25T01:30:34.785Z] Start: Run: docker version --format {{.Server.APIVersion}}
[2024-01-25T01:30:34.953Z] Stop (168 ms): Run: docker version --format {{.Server.APIVersion}}
[2024-01-25T01:30:34.953Z] 1.43

Description

See above.

System Info

VSCode and docker on MacOS 14.2.1 and on Github Codespaces.

cvansteenburg avatar Jan 25 '24 02:01 cvansteenburg

🤖

Hey @cvansteenburg! Good to see you again. I hope you've been well since our last interaction. I see you've run into another issue. Let's dive into it!

Thank you for bringing this to our attention. It seems like the azure-ai-vision package that LangChain is currently using has been yanked from PyPi and replaced with a new package. This is likely causing the issue with the devcontainer hanging on Poetry dependency resolution.

To resolve this issue, you can update the pyproject.toml file to reference the new version of the azure-ai-vision package. If the package has been renamed, you should update the package name as well. Here is the relevant section in the pyproject.toml file:

azure-ai-vision = {version = "^0.11.1b1", optional = true}

You should replace azure-ai-vision with the new package name and ^0.11.1b1 with the new version.

Additionally, you can clear the Poetry cache to ensure that the old version of the azure-ai-vision package is not being used. You can do this by adding the following command to the Dockerfile before the RUN poetry install command:

RUN poetry cache clear --all pypi

After making these changes, you should rebuild the Docker image. This will cause Poetry to fetch the new version of the azure-ai-vision package and resolve the dependencies again.

Please let me know if this resolves your issue or if you need further assistance.

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

dosubot[bot] avatar Jan 25 '24 02:01 dosubot[bot]

That does solve the first of the two problems, but it doesn't resolve the dependency resolution issue.

cvansteenburg avatar Jan 25 '24 02:01 cvansteenburg

Experiencing this issue as well, hope this get fixed soon.

mad-cat-lon avatar Jan 25 '24 18:01 mad-cat-lon

@cvansteenburg I was able to get it working by cherrypicking this commit from this fork. Here's the link to the open PR.

Hope this works for you as well, spent quite a lot of time trying to get the environment set up

mad-cat-lon avatar Jan 25 '24 22:01 mad-cat-lon

This is no longer an issue. We can go ahead and close this.

cgalo5758 avatar Mar 28 '24 16:03 cgalo5758

This is indeed fixed. Closing.

cvansteenburg avatar Mar 29 '24 16:03 cvansteenburg