scrapinghub / portia

Visual scraping for Scrapy
BSD 3-Clause "New" or "Revised" License
9.28k stars 1.41k forks source link

Portia 2.0 Internal Server Error: /api/projects #674

Closed ahmedezzeldin93 closed 7 years ago

ahmedezzeldin93 commented 7 years ago

After successful docker built and whether working from whether nui-develop or develop, running the following sudo docker run -i -t --rm -v ~/portia/:/app/:rw -p 9001:9001 --name portia portia and hitting http://localhost:9001/static/index.html generate that error, any help ?

[05/Jan/2017 23:15:52] "GET /api/projects HTTP/1.0" 500 13760 Internal Server Error: /api/projects Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 39, in inner response = get_response(request) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 187, in _get_response response = self.process_exception_by_middleware(e, request) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 185, in _get_response response = wrapped_callback(request, *callback_args, callback_kwargs) File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py", line 58, in wrapped_view return view_func(*args, *kwargs) File "/usr/local/lib/python2.7/dist-packages/rest_framework/viewsets.py", line 87, in view return self.dispatch(request, args, kwargs) File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 185, in inner return func(*args, kwargs) File "/app/portia_server/portia_api/resources/route.py", line 73, in dispatch return super(JsonApiRoute, self).dispatch(request, *args, *kwargs) File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py", line 466, in dispatch response = self.handle_exception(exc) File "/app/portia_server/portia_api/resources/route.py", line 76, in handle_exception response = super(JsonApiRoute, self).handle_exception(exc) File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py", line 463, in dispatch response = handler(request, args, kwargs) File "/app/portia_server/portia_api/resources/route.py", line 227, in list collection = self.filter_collection(self.get_collection()) File "/app/portia_server/portia_api/resources/projects.py", line 179, in get_collection for project_id, name in iteritems(self.projects)) File "/usr/local/lib/python2.7/dist-packages/six.py", line 599, in iteritems return d.iteritems(**kw) AttributeError: 'NoneType' object has no attribute 'iteritems'

ruairif commented 7 years ago

To build the assets:

cd portia/portiaui
npm install -g ember-cli
npm install
bower install
ember build -e production

To build build portia run: docker build -t portia .. Then you can run it using: docker run -i -t --rm -v ~/data:/app/slyd/slyd/data/projects:rw -v ~/scrapinghub/portia/portiaui/dist:/app/portiaui/dist -p 9001:9001 portia