Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e test fast api version error when running locally #403

Closed
ChawinTan opened this issue Jun 21, 2021 · 3 comments
Closed

e2e test fast api version error when running locally #403

ChawinTan opened this issue Jun 21, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@ChawinTan
Copy link

Bug report

Description of the bug

When running e2e test in the terminal from dashboard-e2e package, the following error occured.

pkg_resources.ContextualVersionConflict: (fastapi 0.65.2 (/home/chawin/rmf-web/.venv/lib/python3.8/site-packages), Requirement.parse('fastapi~=0.63.0'), {'api-server'})
[2] 
[2] During handling of the above exception, another exception occurred:
[2] 
[2] Traceback (most recent call last):
[2]   File "/home/chawin/rmf-web/.venv/bin/rmf_api_server", line 6, in <module>
[2]     from pkg_resources import load_entry_point
[2]   File "/home/chawin/rmf-web/.venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3243, in <module>
[2]     def _initialize_master_working_set():
[2]   File "/home/chawin/rmf-web/.venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3226, in _call_aside
[2]     f(*args, **kwargs)
[2]   File "/home/chawin/rmf-web/.venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3255, in _initialize_master_working_set
[2]     working_set = WorkingSet._build_master()
[2]   File "/home/chawin/rmf-web/.venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 570, in _build_master
[2]     return cls._build_from_requirements(__requires__)
[2]   File "/home/chawin/rmf-web/.venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 583, in _build_from_requirements
[2]     dists = ws.resolve(reqs, Environment())
[2]   File "/home/chawin/rmf-web/.venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 772, in resolve
[2]     raise DistributionNotFound(req, requirers)
[2] pkg_resources.DistributionNotFound: The 'fastapi~=0.63.0' distribution was not found and is required by api-server

Steps to reproduce the bug

  1. Go into packages/dashboard-e2e folder
  2. Run npm run test

fast_api_error

Additional information

@ChawinTan ChawinTan added the bug Something isn't working label Jun 21, 2021
@vallq
Copy link
Contributor

vallq commented Jun 22, 2021

Updating the Pipfile to add fastapi = "~=0.63.0" to [packages] or pipenv install 'fastapi~=0.63.0' and making sure that port 8000 is not in use (lsof -i TCP:8000 | grep LISTEN) allows the e2e to run correctly. but I'm still not sure why it is this way because the dependency of api-server does not need to change.

Pipfile

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
fastapi = "~=0.63.0"

[dev-packages]
black = "==20.8b1"
isort = "~=5.8"
pylint = "~=2.7"
coverage = "~=5.5"
# api-server
api-server = {editable = true, path = "./packages/api-server"}
requests = "~=2.25"
# reporting-server
reporting-server = {editable = true, path = "./packages/reporting-server"}
# ros-translator
ros-translator = {editable = true, path = "./packages/ros-translator"}

[requires]
python_version = "3.8"

Adding the fastapi package to [dev-packages] will cause the confict error to appear

pkg_resources.ContextualVersionConflict: (fastapi 0.65.2 (/home/chawin/rmf-web/.venv/lib/python3.8/site-packages), Requirement.parse('fastapi~=0.63.0'), {'api-server'}

@koonpeng
Copy link
Collaborator

Older versions of fastapi had a security vulnerability so it needs to be updated, try clearing the .venv dir and running bootstrap again.

@ChawinTan
Copy link
Author

Solved by clearing .venv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants