greenbone / ospd-openvas

ospd-openvas is an OSP server implementation to allow GVM to remotely control an OpenVAS Scanner
GNU Affero General Public License v3.0
67 stars 58 forks source link

[22.4.6] AttributeError: 'NoneType' object has no attribute 'startswith' #874

Closed Blck4 closed 1 year ago

Blck4 commented 1 year ago

This error message appears after I use virtualenv to install. I try to solve it through conf, but it doesn't work,Is this a bug? root@localhost bin]# ./ospd-openvas Traceback (most recent call last): File "./ospd-openvas", line 8, in <module> sys.exit(main()) File "/opt/ospd-scanner/lib/python3.7/site-packages/ospd_openvas/daemon.py", line 1243, in main daemon_main('OSPD - openvas', OSPDopenvas, NotusParser()) File "/opt/ospd-scanner/lib/python3.7/site-packages/ospd/main.py", line 126, in main daemon = daemon_class(**vars(args)) File "/opt/ospd-scanner/lib/python3.7/site-packages/ospd_openvas/daemon.py", line 452, in __init__ self.main_db = MainDB() File "/opt/ospd-scanner/lib/python3.7/site-packages/ospd_openvas/db.py", line 589, in __init__ super().__init__(self.DEFAULT_INDEX, ctx) File "/opt/ospd-scanner/lib/python3.7/site-packages/ospd_openvas/db.py", line 411, in __init__ self.ctx = OpenvasDB.create_context(kbindex) File "/opt/ospd-scanner/lib/python3.7/site-packages/ospd_openvas/db.py", line 113, in create_context decode_responses=True, File "/opt/ospd-scanner/lib/python3.7/site-packages/redis/client.py", line 902, in from_url connection_pool = ConnectionPool.from_url(url, **kwargs) File "/opt/ospd-scanner/lib/python3.7/site-packages/redis/connection.py", line 1370, in from_url url_options = parse_url(url) File "/opt/ospd-scanner/lib/python3.7/site-packages/redis/connection.py", line 1259, in parse_url url.startswith("redis://") AttributeError: 'NoneType' object has no attribute 'startswith'

`[OSPD - openvas]

General

pid_file = /var/run/ospd/openvas.pid lock_file_dir = /var/run/ stream_timeout = 1 max_scans = 3 min_free_mem_scan_queue = 1000 max_queued_scans = 0

Log config

log_level = DEBUG log_file = /var/log/gvm/openvas.log log_config = /.config/ospd-logging.conf

Unix socket settings

socket_mode = 0o770 unix_socket = /var/run/ospd/openvas.sock

TLS socket settings and certificates.

port = 9390

bind_address = 0.0.0.0

key_file = install-prefix/var/lib/gvm/private/CA/serverkey.pem

cert_file = install-prefix/var/lib/gvm/CA/servercert.pem

ca_file = install-prefix/var/lib/gvm/CA/cacert.pem

[OSPD - some wrapper] log_level = DEBUG socket_mode = 0o770 unix_socket = /var/run/ospd/ospd-wrapper.sock pid_file = /var/run/ospd/ospd-wrapper.pid log_file = /var/log/gvm/ospd-wrapper.log`

jjnicola commented 1 year ago

Hi @Blck4, Thanks for reporting this. The issue is that ospd-openvas does not find the openvas binary, or it has no permissions. Check the openvas binary. Also, I don't know why you don't get the error message, and only get the traceback.

I got something like this OSPD[$PID] 2023-03-14 14:38:50,794: WARNING: (ospd_openvas.openvas) Could not gather openvas settings. Reason [Errno 13] Permission denied: 'openvas' I create a patch to avoid the traceback