tcosolutions/betterscan

Errors with server (backend) and worker images

Closed this issue · 3 comments

I have encountered multiple errors when using server and worker images both hosted on DockerHub and building from source.
Most errors arise from Python libraries missing from the images. I identified the following missing libraries:
Worker image: passlib, celery, jinja2, werkzeug, markupsafe
Server/Backend image: passlib, flask, jinja2, wtforms

Furthermore, the worker image seems to missing the following file: /srv/betterscan/settings.yml.
I solved it with the command:
ln -s /srv/betterscan/quantifiedcode/settings/default.yml /srv/betterscan/settings.yml

Finally, the following message was added to all html files:

 * This file is part of Betterscan CE (Community Edition).
 *
 * Betterscan is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Betterscan is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Betterscan. If not, see <https://www.gnu.org/licenses/>.
 *
 * Originally licensed under the BSD-3-Clause license with parts changed under
 * LGPL v2.1 with Commons Clause.
 * See the original LICENSE file for details.
*/

But this comment syntax /** */ is not hidden when displaying the pages.
It probably should be replaced with the syntax <!-- -->

Thanks. Did some changes today. Can you try now?

Hi, @marcinguy I tried to build it with the latest changes you pushed. Some of the errors got fixed but it still has this issue with passlib, I tried modifying the docker file but it still fails. Also, it aborts modifying the settings file.

Here's the log

server-1    | Loading settings from /srv/betterscan/quantifiedcode/settings/default.yml
server-1    | Loading settings from /srv/betterscan/quantifiedcode/settings/default.yml
server-1    | Loading plugin: git
server-1    | Loading plugin: git
server-1    | Loading plugin: trufflehog3
server-1    | Loading plugin: trojansource
server-1    | Loading plugin: yara
server-1    | Loading plugin: metrics
server-1    | Loading plugin: bandit
server-1    | Loading plugin: brakeman
server-1    | Loading plugin: phpanalyzer
server-1    | Loading plugin: semgrep
server-1    | Loading plugin: tfsec
server-1    | Loading plugin: kubescape
server-1    | Loading plugin: semgrepccpp
server-1    | Loading plugin: semgrepjava
server-1    | Loading plugin: semgrepeslint
server-1    | Loading plugin: graudit
server-1    | Loading plugin: text4shell
server-1    | Loading plugin: gostaticcheck
server-1    | Replacing class <class 'checkmate.lib.models.IssueClass'> with <class 'quantifiedcode.backend.models.issue_class.IssueClass'> for collection issueclass
server-1    | Replacing class <class 'checkmate.lib.models.Project'> with <class 'quantifiedcode.backend.models.project.Project'> for collection project
server-1    | Hi! Let's get started with setting up your instance of QuantifiedCode.
server-1    | I will modify your setting file /srv/betterscan/quantifiedcode/settings/default.yml and will put a backup in /srv/betterscan/quantifiedcode/settings/default.yml.backup
server-1    | 
server-1    | 
server-1    | Aborted!
server-1    | Which address shall we use for your QuantifiedCode instance? [http://localhost:5000]: 
worker_1-1  | Loading settings from /srv/betterscan/quantifiedcode/settings/default.yml
worker_1-1  | Loading settings from /srv/betterscan/quantifiedcode/settings/default.yml
worker_1-1  | Traceback (most recent call last):
worker_1-1  |   File "/srv/betterscan/manage.py", line 23, in <module>
worker_1-1  |     from quantifiedcode.backend.commands import commands
worker_1-1  |   File "/srv/betterscan/quantifiedcode/backend/commands/__init__.py", line 22, in <module>
worker_1-1  |     from .project import project
worker_1-1  |   File "/srv/betterscan/quantifiedcode/backend/commands/project.py", line 24, in <module>
worker_1-1  |     from quantifiedcode.backend.models import Project
worker_1-1  |   File "/srv/betterscan/quantifiedcode/backend/models/__init__.py", line 31, in <module>
worker_1-1  |     from .user import AccessToken, User, UserRole
worker_1-1  |   File "/srv/betterscan/quantifiedcode/backend/models/user.py", line 32, in <module>
worker_1-1  |     from passlib.hash import pbkdf2_sha256
worker_1-1  | ModuleNotFoundError: No module named 'passlib'