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.

twisted.web.error.UnsupportedMethod: Expected one of [b'HEAD', b'object', b'POST']

See original GitHub issue
2018-05-31T20:26:16+0800 [_GenericHTTPChannelProtocol,3,10.43.234.66] Unhandled Error
        Traceback (most recent call last):
          File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/twisted/web/http.py", line 2145, in allContentReceived
            req.requestReceived(command, path, version)
          File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/twisted/web/http.py", line 890, in requestReceived
            self.process()
          File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/twisted/web/server.py", line 197, in process
            self.render(resrc)
          File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/twisted/web/server.py", line 257, in render
            body = resrc.render(self)
        --- <exception caught here> ---
          File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/scrapyd/webservice.py", line 21, in render
            return JsonResource.render(self, txrequest).encode('utf-8')
          File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/scrapyd/utils.py", line 20, in render
            r = resource.Resource.render(self, txrequest)
          File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/twisted/web/resource.py", line 249, in render
            raise UnsupportedMethod(allowedMethods)
        twisted.web.error.UnsupportedMethod: Expected one of [b'HEAD', b'object', b'POST']

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
azmirfakkricommented, Oct 17, 2019

My scrapyd log:

reclusa_1       | 2019-10-17T13:19:41+0000 [-] Scrapyd web console available at http://0.0.0.0:6800/
reclusa_1       | 2019-10-17T13:19:41+0000 [-] Loaded.
reclusa_1       | 2019-10-17T13:19:41+0000 [twisted.scripts._twistd_unix.UnixAppLogger#info] twistd 19.7.0 (/usr/local/bin/python 3.6.9) starting up.
reclusa_1       | 2019-10-17T13:19:41+0000 [twisted.scripts._twistd_unix.UnixAppLogger#info] reactor class: twisted.internet.epollreactor.EPollReactor.
reclusa_1       | 2019-10-17T13:19:41+0000 [-] Site starting on 6800
reclusa_1       | 2019-10-17T13:19:41+0000 [twisted.web.server.Site#info] Starting factory <twisted.web.server.Site object at 0x7f2d71557048>
reclusa_1       | 2019-10-17T13:19:41+0000 [Launcher] Scrapyd 1.2.1 started: max_proc=16, runner='scrapyd.runner'
reclusa_1       | 2019-10-17T13:20:53+0000 [twisted.python.log#info] "192.168.48.1" - - [17/Oct/2019:13:20:52 +0000] "POST /schedule.json HTTP/1.1" 200 2049 "-" "python-requests/2.22.0"
reclusa_1       | 2019-10-17T13:30:29+0000 [twisted.python.log#info] "192.168.48.1" - - [17/Oct/2019:13:30:29 +0000] "GET / HTTP/1.1" 200 743 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36"
reclusa_1       | 2019-10-17T13:30:30+0000 [twisted.python.log#info] "192.168.48.1" - - [17/Oct/2019:13:30:30 +0000] "GET /favicon.ico HTTP/1.1" 404 153 "http://localhost:6800/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36"
reclusa_1       | 2019-10-17T13:30:33+0000 [twisted.python.log#info] "192.168.48.1" - - [17/Oct/2019:13:30:33 +0000] "GET /jobs HTTP/1.1" 200 471 "http://localhost:6800/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36"
reclusa_1       | 2019-10-17T13:30:38+0000 [twisted.python.log#info] "192.168.48.1" - - [17/Oct/2019:13:30:38 +0000] "GET /schedule.json HTTP/1.1" 200 544 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36"
reclusa_1       | 2019-10-17T13:31:29+0000 [twisted.web.http.HTTPChannel#info] Timing out client: IPv4Address(type='TCP', host='192.168.48.1', port=36206)
reclusa_1       | 2019-10-17T13:31:38+0000 [twisted.web.http.HTTPChannel#info] Timing out client: IPv4Address(type='TCP', host='192.168.48.1', port=36208)
reclusa_1       | 2019-10-17T13:35:57+0000 [twisted.python.log#info] "192.168.48.1" - - [17/Oct/2019:13:35:57 +0000] "GET / HTTP/1.1" 200 743 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36"

It looks like it did make a POST request for the first time and after that a GET request which is not supported and throwing an error.

0reactions
jpmckinneycommented, Sep 23, 2021

The error seems to only occur when GETing a POST-only endpoint via a browser, which is the expected behavior.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Twisted Documentation - Read the Docs
This document describes the optional dependencies that Twisted supports. The dependencies are python packages that.
Read more >
Class Hierarchy - Twisted
twisted.web.error.UnexposedMethodError - Raised on any attempt to get a method which has not been exposed. twisted.web.error.UnfilledSlot - During flattening, a ...
Read more >
Untitled
#civil Porta post it da scrivania, Why you crying dubstep! ... Legrand adorne 4 way, Lolshock reactions, 1 pipe tap, 2003 dodge ram...
Read more >
Release notes — Scrapy 2.7.1 documentation
The scrapy parse -h command no longer throws an error (issue 5481, issue 5482) ... method that returns the next queue object (like...
Read more >
python 3.x - http://url call in start request in scrapy
directly adding the urls in the start_urls["XXXXXXX.com",] it is working but calling from start_requests it is throwing error · can't reproduce ...
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