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

Snap package is broken #3294

Closed
i-ky opened this issue Apr 29, 2021 · 3 comments
Closed

Snap package is broken #3294

i-ky opened this issue Apr 29, 2021 · 3 comments

Comments

@i-ky
Copy link

i-ky commented Apr 29, 2021

Describe the bug
Installation from snap is broken on Ubuntu 18.04.

CodeChecker version
6.15.2

To Reproduce
Steps to reproduce the behaviour:

  1. Install as suggested here:
$ sudo snap install codechecker --classic
  1. Verify installation:
$ snap list
Name         Version    Rev    Tracking       Publisher      Notes
code         08a217c4   61     latest/stable  vscode✓        classic
codechecker  6.15.2     3      latest/stable  csordasmarton  classic
core         16-2.49.2  10958  latest/stable  canonical✓     core
core18       20210309   1997   latest/stable  canonical✓     base
  1. Try to run CodeChecker:
$ CodeChecker --help
CodeChecker: command not found

Apparently, CodeChecker is not in PATH.
4. Try to find CodeChecker and launch it using absolute path:

$ /snap/codechecker/3/CodeChecker/bin/CodeChecker --help
Couldn't import module for subcommand 'analyze'... ignoring.
Traceback (most recent call last):
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 110, in main
    subcommands[subcommand])
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 39, in add_subcommand
    command_module = cmd_spec.loader.load_module(module_name)
  File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 823, in load_module
  File "<frozen importlib._bootstrap_external>", line 682, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/snap/codechecker/3/CodeChecker/cc_bin/../lib/python3/codechecker_analyzer/cmd/analyze.py", line 21, in <module>
    from codechecker_analyzer import analyzer, analyzer_context, arg, env
  File "/snap/codechecker/3/CodeChecker/lib/python3/codechecker_analyzer/analyzer.py", line 29, in <module>
    from . import analysis_manager, pre_analysis_manager, env, checkers
  File "/snap/codechecker/3/CodeChecker/lib/python3/codechecker_analyzer/analysis_manager.py", line 25, in <module>
    import psutil
ModuleNotFoundError: No module named 'psutil'
Couldn't import module for subcommand 'analyzer-version'... ignoring.
Traceback (most recent call last):
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 110, in main
    subcommands[subcommand])
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 39, in add_subcommand
    command_module = cmd_spec.loader.load_module(module_name)
  File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 823, in load_module
  File "<frozen importlib._bootstrap_external>", line 682, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/snap/codechecker/3/CodeChecker/cc_bin/../lib/python3/codechecker_analyzer/cmd/analyzer_version.py", line 16, in <module>
    from codechecker_analyzer import analyzer_context
  File "/snap/codechecker/3/CodeChecker/lib/python3/codechecker_analyzer/analyzer_context.py", line 21, in <module>
    from codechecker_common.util import load_json_or_empty
  File "/snap/codechecker/3/CodeChecker/lib/python3/codechecker_common/util.py", line 16, in <module>
    import portalocker
ModuleNotFoundError: No module named 'portalocker'
Couldn't import module for subcommand 'analyzers'... ignoring.
Traceback (most recent call last):
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 110, in main
    subcommands[subcommand])
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 39, in add_subcommand
    command_module = cmd_spec.loader.load_module(module_name)
  File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 823, in load_module
  File "<frozen importlib._bootstrap_external>", line 682, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/snap/codechecker/3/CodeChecker/cc_bin/../lib/python3/codechecker_analyzer/cmd/analyzers.py", line 17, in <module>
    from codechecker_analyzer import analyzer_context
  File "/snap/codechecker/3/CodeChecker/lib/python3/codechecker_analyzer/analyzer_context.py", line 21, in <module>
    from codechecker_common.util import load_json_or_empty
  File "/snap/codechecker/3/CodeChecker/lib/python3/codechecker_common/util.py", line 16, in <module>
    import portalocker
ModuleNotFoundError: No module named 'portalocker'
Couldn't import module for subcommand 'check'... ignoring.
Traceback (most recent call last):
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 110, in main
    subcommands[subcommand])
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 39, in add_subcommand
    command_module = cmd_spec.loader.load_module(module_name)
  File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 823, in load_module
  File "<frozen importlib._bootstrap_external>", line 682, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/snap/codechecker/3/CodeChecker/cc_bin/../lib/python3/codechecker_analyzer/cmd/check.py", line 20, in <module>
    from codechecker_analyzer import analyzer_context
  File "/snap/codechecker/3/CodeChecker/lib/python3/codechecker_analyzer/analyzer_context.py", line 21, in <module>
    from codechecker_common.util import load_json_or_empty
  File "/snap/codechecker/3/CodeChecker/lib/python3/codechecker_common/util.py", line 16, in <module>
    import portalocker
ModuleNotFoundError: No module named 'portalocker'
Couldn't import module for subcommand 'checkers'... ignoring.
Traceback (most recent call last):
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 110, in main
    subcommands[subcommand])
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 39, in add_subcommand
    command_module = cmd_spec.loader.load_module(module_name)
  File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 823, in load_module
  File "<frozen importlib._bootstrap_external>", line 682, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/snap/codechecker/3/CodeChecker/cc_bin/../lib/python3/codechecker_analyzer/cmd/checkers.py", line 19, in <module>
    from codechecker_analyzer import analyzer_context
  File "/snap/codechecker/3/CodeChecker/lib/python3/codechecker_analyzer/analyzer_context.py", line 21, in <module>
    from codechecker_common.util import load_json_or_empty
  File "/snap/codechecker/3/CodeChecker/lib/python3/codechecker_common/util.py", line 16, in <module>
    import portalocker
ModuleNotFoundError: No module named 'portalocker'
Couldn't import module for subcommand 'cmd'... ignoring.
Traceback (most recent call last):
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 110, in main
    subcommands[subcommand])
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 39, in add_subcommand
    command_module = cmd_spec.loader.load_module(module_name)
  File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 823, in load_module
  File "<frozen importlib._bootstrap_external>", line 682, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/snap/codechecker/3/CodeChecker/cc_bin/../lib/python3/codechecker_client/cmd/cmd.py", line 19, in <module>
    from codechecker_api.codeCheckerDBAccess_v6 import ttypes
ModuleNotFoundError: No module named 'codechecker_api'
Couldn't import module for subcommand 'fixit'... ignoring.
Traceback (most recent call last):
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 110, in main
    subcommands[subcommand])
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 39, in add_subcommand
    command_module = cmd_spec.loader.load_module(module_name)
  File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 823, in load_module
  File "<frozen importlib._bootstrap_external>", line 682, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/snap/codechecker/3/CodeChecker/cc_bin/../lib/python3/codechecker_analyzer/cmd/fixit.py", line 21, in <module>
    from codechecker_analyzer import analyzer_context
  File "/snap/codechecker/3/CodeChecker/lib/python3/codechecker_analyzer/analyzer_context.py", line 21, in <module>
    from codechecker_common.util import load_json_or_empty
  File "/snap/codechecker/3/CodeChecker/lib/python3/codechecker_common/util.py", line 16, in <module>
    import portalocker
ModuleNotFoundError: No module named 'portalocker'
Couldn't import module for subcommand 'log'... ignoring.
Traceback (most recent call last):
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 110, in main
    subcommands[subcommand])
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 39, in add_subcommand
    command_module = cmd_spec.loader.load_module(module_name)
  File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 823, in load_module
  File "<frozen importlib._bootstrap_external>", line 682, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/snap/codechecker/3/CodeChecker/cc_bin/../lib/python3/codechecker_analyzer/cmd/log.py", line 20, in <module>
    from codechecker_analyzer import analyzer_context
  File "/snap/codechecker/3/CodeChecker/lib/python3/codechecker_analyzer/analyzer_context.py", line 21, in <module>
    from codechecker_common.util import load_json_or_empty
  File "/snap/codechecker/3/CodeChecker/lib/python3/codechecker_common/util.py", line 16, in <module>
    import portalocker
ModuleNotFoundError: No module named 'portalocker'
Couldn't import module for subcommand 'parse'... ignoring.
Traceback (most recent call last):
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 110, in main
    subcommands[subcommand])
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 39, in add_subcommand
    command_module = cmd_spec.loader.load_module(module_name)
  File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 823, in load_module
  File "<frozen importlib._bootstrap_external>", line 682, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/snap/codechecker/3/CodeChecker/cc_bin/../lib/python3/codechecker_analyzer/cmd/parse.py", line 26, in <module>
    from codechecker_analyzer import analyzer_context, suppress_handler
  File "/snap/codechecker/3/CodeChecker/lib/python3/codechecker_analyzer/analyzer_context.py", line 21, in <module>
    from codechecker_common.util import load_json_or_empty
  File "/snap/codechecker/3/CodeChecker/lib/python3/codechecker_common/util.py", line 16, in <module>
    import portalocker
ModuleNotFoundError: No module named 'portalocker'
Couldn't import module for subcommand 'server'... ignoring.
Traceback (most recent call last):
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 110, in main
    subcommands[subcommand])
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 39, in add_subcommand
    command_module = cmd_spec.loader.load_module(module_name)
  File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 823, in load_module
  File "<frozen importlib._bootstrap_external>", line 682, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/snap/codechecker/3/CodeChecker/cc_bin/../lib/python3/codechecker_server/cmd/server.py", line 22, in <module>
    import psutil
ModuleNotFoundError: No module named 'psutil'
Couldn't import module for subcommand 'store'... ignoring.
Traceback (most recent call last):
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 110, in main
    subcommands[subcommand])
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 39, in add_subcommand
    command_module = cmd_spec.loader.load_module(module_name)
  File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 823, in load_module
  File "<frozen importlib._bootstrap_external>", line 682, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/snap/codechecker/3/CodeChecker/cc_bin/../lib/python3/codechecker_client/cmd/store.py", line 30, in <module>
    from codechecker_api.codeCheckerDBAccess_v6.ttypes import StoreLimitKind
ModuleNotFoundError: No module named 'codechecker_api'
Couldn't import module for subcommand 'web-version'... ignoring.
Traceback (most recent call last):
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 110, in main
    subcommands[subcommand])
  File "/snap/codechecker/3/CodeChecker/cc_bin/CodeChecker.py", line 39, in add_subcommand
    command_module = cmd_spec.loader.load_module(module_name)
  File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 823, in load_module
  File "<frozen importlib._bootstrap_external>", line 682, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/snap/codechecker/3/CodeChecker/cc_bin/../lib/python3/codechecker_web/cmd/web_version.py", line 19, in <module>
    from codechecker_web.shared import webserver_context, version
  File "/snap/codechecker/3/CodeChecker/lib/python3/codechecker_web/shared/webserver_context.py", line 18, in <module>
    from codechecker_common.util import load_json_or_empty
  File "/snap/codechecker/3/CodeChecker/lib/python3/codechecker_common/util.py", line 16, in <module>
    import portalocker
ModuleNotFoundError: No module named 'portalocker'
usage: CodeChecker [-h] {version} ...

Run the CodeChecker sourcecode analyzer framework.
Please specify a subcommand to access individual features.

positional arguments:
  {version}   commands
    version   Print the version of CodeChecker package that is being used.

optional arguments:
  -h, --help  show this help message and exit

Example scenario: Analyzing, and storing results
------------------------------------------------
Start the server where the results will be stored and can be viewed
after the analysis is done:
    CodeChecker server

Analyze a project with default settings:
    CodeChecker check -b "cd ~/myproject && make" -o "~/results"

Store the analyzer results to the server:
    CodeChecker store "~/results" -n myproject

The results can be viewed:
 * In a web browser: http://localhost:8001
 * In the command line:
    CodeChecker cmd results myproject

Example scenario: Analyzing, and printing results to Terminal (no storage)
--------------------------------------------------------------------------
In this case, no database is used, and the results are printed on the standard
output.

    CodeChecker check -b "cd ~/myproject && make" 

Expected behaviour
CodeChecker executable should be in PATH and should produce no errors when launched.

Desktop (please complete the following information)

  • OS: Ubuntu 18.04

Additional context
System reboot did not help.

@csordasmarton
Copy link
Contributor

@i-ky Unfortunately snap package supports only lower case command names. So this is the reason why calling the CodeChecker --help command gives you this error message. Please try to run the following command: codechecker --help.

You can check all the available commands for your snap with the following command: snap info codechecker:

commands:
  - codechecker
  - codechecker.gerrit-changed-files-to-skipfile
  - codechecker.merge-clang-extdef-mappings
  - codechecker.post-process-stats
  - codechecker.report-converter
  - codechecker.tu-collector

@i-ky
Copy link
Author

i-ky commented Apr 29, 2021

@csordasmarton, thank you for a prompt response! Indeed, lowercase command works. Would be nice to add a note about that somewhere.

@csordasmarton
Copy link
Contributor

@i-ky Good point, I created a PR to update the documentation with this information: #3294.

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

No branches or pull requests

2 participants