question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KeyError: 'status' when trying to schedule spider

See original GitHub issue

I am getting this error when trying to schedule a spider. This is happening with version 2.3.1

Traceback (most recent call last):
  File "/home/molveyra/.local/share/virtualenvs/mollie-AtuAN_AE/lib/python3.8/site-packages/scrapinghub/legacy.py", line 157, in _decode_response
    if data['status'] == 'ok':
KeyError: 'status'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/molveyra/.local/share/virtualenvs/mollie-AtuAN_AE/lib/python3.8/site-packages/scrapinghub/client/exceptions.py", line 69, in wrapped
    return method(*args, **kwargs)
  File "/home/molveyra/.local/share/virtualenvs/mollie-AtuAN_AE/lib/python3.8/site-packages/scrapinghub/client/__init__.py", line 19, in _request
    return super(Connection, self)._request(*args, **kwargs)
  File "/home/molveyra/.local/share/virtualenvs/mollie-AtuAN_AE/lib/python3.8/site-packages/scrapinghub/legacy.py", line 143, in _request
    return self._decode_response(response, format, raw)
  File "/home/molveyra/.local/share/virtualenvs/mollie-AtuAN_AE/lib/python3.8/site-packages/scrapinghub/legacy.py", line 169, in _decode_response
    raise APIError("JSON response does not contain status")
scrapinghub.legacy.APIError: JSON response does not contain status

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
vshlapakovcommented, Mar 1, 2021

Regardless the response is ‘Authentication credentials were not provided.’, this really happens when the apikey is wrong, so there is a server side issue too.

I believe that’s intentional - our server would react the same if credentials aren’t provided or it’s wrong, was done for security purpose. But I think we could handle it on the client side anyway to improve experience.

1reaction
vshlapakovcommented, Feb 26, 2021

it must handle this condition and print the correct failure.

Agree, it should be addressed by the library

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scrapy spider not found error - Stack Overflow
Try running scrapy list on the command line. If there is any error on the spider it will detect it. In my case,...
Read more >
KeyError: Spider not found · Issue #89 · rmax/scrapy-redis
Looks like your spider code fails to load due to a missing dependency, hence the KeyError failure.
Read more >
What is KeyError in Python? Dictionary and Handling Them
KeyError in Python is raised when you attempt to access a key that is not in a dictionary.
Read more >
KeyError: 'Spider not found' : r/scrapy - Reddit
I have installed Scrapy in my python 3.6 virtual environment. Running command scrapy crawl myprojectname gives me this error.
Read more >
Python KeyError Exceptions and How to Handle Them
A Python KeyError exception is what is raised when you try to access a key ... This information is more helpful when you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found