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

No such file or directory: 'data/rules/Semgrep-Rules/contrib/dlint/dlint-equivalent.yaml' #13

Closed
rm1984 opened this issue Mar 28, 2024 · 3 comments

Comments

@rm1984
Copy link

rm1984 commented Mar 28, 2024

I'm running the latest version of GrepMarx with Docker.
After creating a new project and pressing the "New analysis" button, I get the following message in the browser:

Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

while, in the console logs, I get the following messages:

grepmarx-1  | [2024-03-28 13:55:54 +0000] [19] [DEBUG] POST /analysis/scans/launch
grepmarx-1  | [2024-03-28 13:55:54,526] ERROR in app: Exception on /analysis/scans/launch [POST]
grepmarx-1  | Traceback (most recent call last):
grepmarx-1  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 2073, in wsgi_app
grepmarx-1  |     response = self.full_dispatch_request()
grepmarx-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
grepmarx-1  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1518, in full_dispatch_request
grepmarx-1  |     rv = self.handle_user_exception(e)
grepmarx-1  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
grepmarx-1  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1516, in full_dispatch_request
grepmarx-1  |     rv = self.dispatch_request()
grepmarx-1  |          ^^^^^^^^^^^^^^^^^^^^^^^
grepmarx-1  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1502, in dispatch_request
grepmarx-1  |     return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
grepmarx-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
grepmarx-1  |   File "/usr/local/lib/python3.11/site-packages/flask_login/utils.py", line 277, in decorated_view
grepmarx-1  |     return current_app.ensure_sync(func)(*args, **kwargs)
grepmarx-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
grepmarx-1  |   File "/opt/grepmarx/app/analysis/routes.py", line 99, in scans_launch
grepmarx-1  |     import_rules(project.analysis, project_rules_path)
grepmarx-1  |   File "/opt/grepmarx/app/analysis/util.py", line 356, in import_rules
grepmarx-1  |     copyfile(src, dst)
grepmarx-1  |   File "/usr/local/lib/python3.11/shutil.py", line 256, in copyfile
grepmarx-1  |     with open(src, 'rb') as fsrc:
grepmarx-1  |          ^^^^^^^^^^^^^^^
grepmarx-1  | FileNotFoundError: [Errno 2] No such file or directory: 'data/rules/Semgrep-Rules/contrib/dlint/dlint-equivalent.yaml'

Thanks! :)

@fxbru
Copy link
Collaborator

fxbru commented Mar 29, 2024

Hi @rm1984,

It looks like your rules packs are referencing non-existent rules. Will add a check for that case, as a workaround you can click on the "Sync rules" button in the "Analysis rules" page.

image

@rm1984
Copy link
Author

rm1984 commented Mar 29, 2024

Hi @fxbru,
thank you, adding a check would be great.
I missed that "Sync rules" button, sorry, I going to try your workaround asap.

@fxbru
Copy link
Collaborator

fxbru commented Apr 9, 2024

Release 0.5.6 fixes the issue. Unfortunately, you might have to start from a fresh database, as the current one is corrupted.

@fxbru fxbru closed this as completed Apr 9, 2024
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