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

running server in docker does not work anymore (import yaml failed) #3625

Closed
matthijs opened this issue Mar 12, 2022 · 3 comments · Fixed by #3626
Closed

running server in docker does not work anymore (import yaml failed) #3625

matthijs opened this issue Mar 12, 2022 · 3 comments · Fixed by #3626
Labels

Comments

@matthijs
Copy link

Describe the bug
When running the docker image: codechecker/codechecker-web (latest version) causes an error in CodeChecker. It seems the python yaml module is missing.

CodeChecker version

codechecker@219038205b90:/$ CodeChecker version
[INFO 2022-03-12 12:51] - CodeChecker web version:
------------------------------------------------------------------------------
Kind                                | Version
------------------------------------------------------------------------------
Base package version                | 6.19.0
Package build date                  | 2022-03-11T09:53
Git commit ID (hash)                | 5f5b6b7e7ecd70d23079580c063f4e4f2bb2a7ad
Git tag information                 | 6.19
Server supported Thrift API version | 6.47
Client Thrift API version           | 6.47
------------------------------------------------------------------------------

To Reproduce
Steps to reproduce the behaviour:

version: '3.5'

services:
  codechecker:
    image: codechecker/codechecker-web:latest
    ports:
      - 8001:8001
    volumes:
      - './workspace:/workspace'
    command: >
      CodeChecker server
        --workspace /workspace
        --postgresql --dbaddress 192.168.178.71 --dbport 5432 --dbusername codechecker --db-name codechecker_config
        --db-force-upgrade
        --not-host-only
    secrets:
      - pgpass

secrets:
  pgpass:
    file: ./pgpass

Then run docker-compose up

~/codechecker$ docker-compose up
Starting codechecker_codechecker_1 ... done
Attaching to codechecker_codechecker_1
codechecker_1  | Container started with 'root' user.
codechecker_1  | Workspace directory '/workspace' already exists.
codechecker_1  | Executing script with workspace directory owner (UID): '950'...
codechecker_1  | Set PostgreSQL password file from secrets.
codechecker_1  | Executing command: 'CodeChecker server --workspace /workspace --postgresql --dbaddress 192.168.178.71 --dbport 5432 --dbusername codechecker --db-name codechecker_config --db-force-upgrade --not-host-only'.
codechecker_1  | Couldn't import module for subcommand 'server'... ignoring.
codechecker_1  | Traceback (most recent call last):
codechecker_1  |   File "/codechecker/lib/python3/codechecker_common/cli.py", line 166, in main
codechecker_1  |     add_subcommand(subparsers, subcommand,
codechecker_1  |   File "/codechecker/lib/python3/codechecker_common/cli.py", line 50, in add_subcommand
codechecker_1  |     command_module = cmd_spec.loader.load_module(module_name)
codechecker_1  |   File "<frozen importlib._bootstrap_external>", line 529, in _check_name_wrapper
codechecker_1  |   File "<frozen importlib._bootstrap_external>", line 1029, in load_module
codechecker_1  |   File "<frozen importlib._bootstrap_external>", line 854, in load_module
codechecker_1  |   File "<frozen importlib._bootstrap>", line 274, in _load_module_shim
codechecker_1  |   File "<frozen importlib._bootstrap>", line 711, in _load
codechecker_1  |   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
codechecker_1  |   File "<frozen importlib._bootstrap_external>", line 850, in exec_module
codechecker_1  |   File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
codechecker_1  |   File "/codechecker/lib/python3/codechecker_server/cmd/server.py", line 31, in <module>
codechecker_1  |     from codechecker_common import arg, logger, util, cmd_config
codechecker_1  |   File "/codechecker/lib/python3/codechecker_common/cmd_config.py", line 10, in <module>
codechecker_1  |     import yaml
codechecker_1  | ModuleNotFoundError: No module named 'yaml'
codechecker_1  | usage: CodeChecker [-h] {} ...
codechecker_1  | CodeChecker: error: invalid choice: 'server' (choose from )
codechecker_codechecker_1 exited with code 1

Expected behaviour
I am expecting an up and running codechecker instance which can be reached.

Desktop (please complete the following information)

  • OS: Linux

Regards, Matthijs

@csordasmarton
Copy link
Contributor

@matthijs I created a patch to solve this problem. I also updated the docker images on the docker hub. Now it should work.

Could you please try to pull the image again and verify whether it solves the problem for you too?

@matthijs
Copy link
Author

@csordasmarton after pulling the new docker image this error disappeared.

But after starting it seems not listening on port 8001, I am still figuring out if I caused this error.

Output from docker-compose:

~/codechecker$ docker-compose up
Starting codechecker_codechecker_1 ... done
Attaching to codechecker_codechecker_1
codechecker_1  | Container started with 'root' user.
codechecker_1  | Workspace directory '/workspace' already exists.
codechecker_1  | Executing script with workspace directory owner (UID): '950'...
codechecker_1  | Set PostgreSQL password file from secrets.
codechecker_1  | Executing command: 'CodeChecker server --workspace /workspace --postgresql --dbaddress 192.168.178.71 --dbport 5432 --dbusername codechecker --db-name codechecker_config --db-force-upgrade --not-host-only'.
codechecker_1  | [INFO 2022-03-12 19:42] - Checking configuration database ...
codechecker_1  | [INFO 2022-03-12 19:42] - Database is up to date.

@matthijs
Copy link
Author

Ok, I've fixed it. IP address of the database server changed. After updating the connection of the product in codechecker_config everything started correctly.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants