infobyte / faraday

Open Source Vulnerability Management Platform
https://www.faradaysec.com
GNU General Public License v3.0
4.87k stars 893 forks source link

CantCommunicateWithServerError: Couldn't get a valid response from the server when requesting to URL #354

Closed suanve closed 1 year ago

suanve commented 5 years ago
图片

An error occurred on click here

图片

hi,I wonder why.

server:192.168.4.180

client:nat 192.168.248.247,The host machine:192.168.4.164

suanve commented 5 years ago

this is a server error message。

image image

how to solve?

Marce314 commented 5 years ago

Hi @SuanWell , Can you send us the output of pip freeze, if possible use pip freeze > installed_libs.txt. Also, can you send us the output of python2 manage.py status-check

Thanks, Marcelo

suanve commented 5 years ago

Hi @SuanWell , Can you send us the output of pip freeze, if possible use pip freeze > installed_libs.txt. Also, can you send us the output of python2 manage.py status-check

Thanks, Marcelo

fine,I'm glad you could help me.thanks This is the output of the freeze: python-editor==1.0.4 python-mimeparse==1.6.0 python-nmap==0.6.1 python-slugify==3.0.2 pytz==2018.9 requests==2.21.0 requests-oauthlib==1.2.0 requests-toolbelt==0.9.1 ruamel.ordereddict==0.4.13 ruamel.yaml==0.15.89 scapy==2.2.0 selenium==3.141.0 service-identity==18.1.0 setproctitle==1.1.10 simplegeneric==0.8.1 simplejson==3.16.0 singledispatch==3.4.0.3 six==1.12.0 SOAPpy==0.12.22 soupsieve==1.8 speaklater==1.3 SQLAlchemy==1.3.3 sqlalchemy-schemadisplay==1.3 sqlparse==0.2.4 supervisor==4.0.2 tabulate==0.8.3 terminaltables==3.1.0 text-unidecode==1.2 tornado==4.2.1 tqdm==4.31.1 Twisted==18.9.0 txaio==18.8.1 Unidecode==1.0.23 uritemplate==3.0.0 urllib3==1.24.1 uWSGI==2.0.18 vext==0.7.3 vine==1.3.0 vobject==0.9.6.1 w3af-api-client==1.1.7 wapiti==2.3.0 wcwidth==0.1.7 webargs==5.3.0 webencodings==0.5.1 websocket-client==0.56.0 Werkzeug==0.15.1 whitenoise==4.0 Whoosh==2.7.4 win-inet-pton==1.1.0 wstools==0.4.3 WTForms==2.2.1 zope.interface==4.6.0

### This is the output of python2 manage.py check-check : root@controller:/data/faraday# python2 manage.py status-check /usr/local/lib/python2.7/dist-packages/psycopg2/init.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: http://initd.org/psycopg/docs/install.html#binary-install-from-pypi. """)

Checking if postgreSQL is running... (u'PostgreSQL 9.5.16 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609, 64-bit',) [+] PostgreSQL is running and up to date [+] PostgreSQL lock not detected. [+] PostgreSQL encoding: UTF8

Checking if Faraday is running... [+] Faraday Server is running. PID:5963
[-] Faraday GTK is not running

Checking Faraday dependencies... [+] Server dependencies met [-] Some client dependencies are old: [tornado]. Update them with "pip install -r requirements.txt -U"

Checking Faraday config... [+] Credentials matched [+] /.faraday/storage -> Permission accepted [+] Port 80 in 0.0.0.0 is open

Marce314 commented 5 years ago

It seems some of the dependencies are outdated. Run pip install -r requirements.txt -U in your faraday folder (we recomend using a python virtual enviroment). Let us know if this solves the issue.

suanve commented 5 years ago

It seems some of the dependencies are outdated. Run pip install -r requirements.txt -U in your faraday folder (we recomend using a python virtual enviroment). Let us know if this solves the issue.

yep,I'm already running it. But it still doesn't work. 图片

图片
Marce314 commented 5 years ago

If i'm not mistaken, the error message changed, since the dependencies issue is solved. Could you send us the new error message? Marcelo

suanve commented 5 years ago

If i'm not mistaken, the error message changed, since the dependencies issue is solved. Could you send us the new error message? Marcelo

image

Exception: 
Traceback: Traceback (most recent call last):

File "/root/python-faraday/gui/gtk/dialogs.py", line 964, in on_main_tree_selection vuln_model = self.create_vuln_model(actual_object) File "/root/python-faraday/gui/gtk/dialogs.py", line 1017, in create_vuln_model vulns = obj.getVulns() File "/root/python-faraday/persistence/server/models.py", line 1006, in getVulns return get_all_vulns(self._workspace_name, service_id=self._server_id) File "/root/python-faraday/persistence/server/models.py", line 213, in get_all_vulns vulns_dictionaries = server.get_all_vulns(workspace_name, params) File "/root/python-faraday/persistence/server/server.py", line 428, in get_all_vulns 'vulnerabilities', params) File "/root/python-faraday/persistence/server/server.py", line 391, in _get_faraday_ready_dictionaries appropiate_dictionary = appropiate_function(workspace_name, params) File "/root/python-faraday/persistence/server/server.py", line 298, in _get_raw_vulns return _get(request_url, params) File "/root/python-faraday/persistence/server/server.py", line 245, in _get params=params)) File "/root/python-faraday/persistence/server/server.py", line 188, in wrapper response = func(*args, **kwargs) File "/root/python-faraday/persistence/server/server.py", line 222, in _unsafe_io_with_server raise CantCommunicateWithServerError(server_io_function, server_url, payload, answer) CantCommunicateWithServerError: Couldn't get a valid response from the server when requesting to URL http://10.211.55.200:80/_api/v2/ws/work2/vulns and function <function get at 0x7fdac13f5410>. Response was <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

500 Internal Server Error

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.

Identifier: 983c48960c6d00e78b36bfdaddcd293336703bc313ae046f3299e7813ca149a3
Versions: OS: Kali kali-rolling kali-rolling,
          Faraday Version: 3.7.0
          Python Versions: Python 2.7.16 

Modules: [ ]

llazzaro commented 5 years ago

Hi,

You got a 500 error on server. Can you search for error on the .faraday/logs/faraday-server.log? , make sure you search the logs on 10.211.55.200.

Thanks!

suanve commented 5 years ago

Hi,

You got a 500 error on server. Can you search for error on the .faraday/logs/faraday-server.log? , make sure you search the logs on 10.211.55.200.

Thanks!

2019-05-09 19:22:47,913 - flask.app - ERROR {PoolThread-twisted.internet.reactor-8} [app.py:1761 - log_exception() ] Exception on /v2/ws/work2/vulns/ [GET] Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 2292, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1815, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1799, in dispatch_request return self.view_functionsrule.endpoint File "/usr/local/lib/python2.7/dist-packages/flask_classful.py", line 268, in proxy response = view(*request.view_args) File "/usr/local/lib/python2.7/dist-packages/flask_classful.py", line 239, in inner return fn(args, kwargs) File "/data/faraday/server/api/base.py", line 426, in index query = self._filter_query(self._get_eagerloaded_query(kwargs)) File "/data/faraday/server/api/modules/vulns.py", line 520, in _filter_query query = super(VulnerabilityView, self)._filter_query(query) File "/data/faraday/server/api/base.py", line 555, in _filter_query return self.filterset_class(query).filter() File "/data/faraday/server/api/modules/vulns.py", line 405, in filter query = super(VulnerabilityFilterSet, self).filter() File "/usr/local/lib/python2.7/dist-packages/filteralchemy/filterset.py", line 161, in filter query = filter.filter(query, self.opts.model, label, value) File "/usr/local/lib/python2.7/dist-packages/filteralchemy/filters.py", line 21, in filter return operator(query, model, self.attr or attr, value) File "/data/faraday/server/api/modules/vulns.py", line 345, in call condition = column.ilike('%' + value + '%') TypeError: cannot concatenate 'str' and 'int' objects

fedek commented 1 year ago

The GTK interface has been deprecated please refer to faraday-cli, closing this issue during clean-up.

Thanks for the bug report.