Chat-Web-App icon indicating copy to clipboard operation
Chat-Web-App copied to clipboard

The method is not allowed for the requested URL.

Open PoyntingPro opened this issue 4 years ago • 33 comments

When I type a message and click on send, it gives an error saying Method Not Allowed.

PoyntingPro avatar Feb 03 '21 06:02 PoyntingPro

You need to be logged in

samarmohan avatar Feb 04 '21 17:02 samarmohan

It's after logged in only

AyushSehrawat avatar Feb 06 '21 05:02 AyushSehrawat

I faced same issue, after I logged in

Ziyaulmustafa avatar Feb 07 '21 12:02 Ziyaulmustafa

Same, I logged in and tried to post a message. Received 405 (Method not allowed). Also noticed the socket.io polling update returns a 400 (Bad Request)

justin-mathews avatar Feb 07 '21 14:02 justin-mathews

Do you guys have the sockets properly configured?

samarmohan avatar Feb 07 '21 14:02 samarmohan

Do you guys have the sockets properly configured?

All I've done is git clone the repo, create virtualenv, run pip install -r requirements.txt and python main.py

From there the site loaded with login page, I logged in and got the Home page then tried posting a message and received 405.

justin-mathews avatar Feb 07 '21 14:02 justin-mathews

Also when the server launches I get this message The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO) Tried changing in base.html to but I get the same message.

For reference running this on Pop!_OS 20.10

justin-mathews avatar Feb 07 '21 14:02 justin-mathews

Also when the server launches I get this message The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO) Tried changing in base.html to but I get the same message.

For reference running this on Pop!_OS 20.10

This actually fixed the issue

In base.html I changed

to this

and restarted the server

justin-mathews avatar Feb 07 '21 20:02 justin-mathews

Also when the server launches I get this message The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO) Tried changing in base.html to but I get the same message. For reference running this on Pop!_OS 20.10

This actually fixed the issue

In base.html I changed

to this

and restarted the server

This worked for me, Thanks @justin-mathews

Ziyaulmustafa avatar Feb 08 '21 16:02 Ziyaulmustafa

Also when the server launches I get this message The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO) Tried changing in base.html to but I get the same message. For reference running this on Pop!_OS 20.10

This actually fixed the issue

In base.html I changed

to this

and restarted the server

Yes, this patch fixed the issue with the "unsupported version of the Socket.IO or Engine.IO Protocols". Thanks. Are you planning to submit this patch?

sachinbhandare avatar Feb 08 '21 21:02 sachinbhandare

@justin-mathews It worked for me :), thanks.

AyushSehrawat avatar Feb 09 '21 01:02 AyushSehrawat

This issue was probably due to version of socket-io

AyushSehrawat avatar Feb 09 '21 01:02 AyushSehrawat

I know I am late to the party but #3 should work 😁

TechStudent10 avatar Mar 29 '21 13:03 TechStudent10

I know I am late to the party but #3 should work grin

Yeah , the pr was made after this issue only. Still Tim didn't approve till now

AyushSehrawat avatar Mar 30 '21 16:03 AyushSehrawat

Yeah , the pr was made after this issue only. Still Tim didn't approve till now

@AyushSehrawat maybe it's because @techwithtim is a bit busy and can't check some of his old repos.

TechStudent10 avatar Mar 31 '21 13:03 TechStudent10

Also when the server launches I get this message The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO) Tried changing in base.html to but I get the same message. For reference running this on Pop!_OS 20.10

This actually fixed the issue

In base.html I changed

to this

and restarted the server

Hi, I changed the script you mentioned as well but still get the same error! Is there anyone same as me?

frankiee12a9 avatar May 03 '21 09:05 frankiee12a9

Also when the server launches I get this message The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO) Tried changing in base.html to but I get the same message. For reference running this on Pop!_OS 20.10

This actually fixed the issue In base.html I changed

to this

and restarted the server

Hi, I changed the script you mentioned as well but still get the same error! Is there anyone same as me?

Well it worked for me and most of the other ! Maybe there might be some other issue

AyushSehrawat avatar May 04 '21 05:05 AyushSehrawat

Got the issue when running on replit

pixl8dev avatar May 08 '21 08:05 pixl8dev

Got the issue when running on replit

Well , dunno about repl, maybe some repl issue , but it works fine for localhost..

AyushSehrawat avatar May 09 '21 04:05 AyushSehrawat

may I know why, unable to send message, in doesn't appear on the chatbox

ansonmng avatar May 24 '21 16:05 ansonmng

Also when the server launches I get this message The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO) Tried changing in base.html to but I get the same message. For reference running this on Pop!_OS 20.10

This actually fixed the issue

In base.html I changed

to this

and restarted the server

Hi, that's due to the bad practice of not specifying the dependencies versions on the requirements.txt:

https://github.com/techwithtim/Chat-Web-App/blob/8467cf4b466539ce8f9f91e5edfd246e7fd993bd/requirements.txt#L1-L4

  • https://stackoverflow.com/questions/55052434/does-python-requirements-file-have-to-specify-version
  • https://pip.pypa.io/en/stable/user_guide/#requirements-files
  • https://iscompatible.readthedocs.io/en/latest/

hadialqattan avatar May 28 '21 13:05 hadialqattan

Also when the server launches I get this message The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO) Tried changing in base.html to but I get the same message. For reference running this on Pop!_OS 20.10

This actually fixed the issue

In base.html I changed

to this

and restarted the server

Thanks a million! I got that issue too, and now it's gone! Thanks!

Someone should close this issue now.

elpython3 avatar Jun 30 '21 23:06 elpython3

Also when the server launches I get this message The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO) Tried changing in base.html to but I get the same message. For reference running this on Pop!_OS 20.10

This actually fixed the issue In base.html I changed

to this

and restarted the server

Thanks a million! I got that issue too, and now it's gone! Thanks!

Someone should close this issue now.

I think this issue should not be closed until specifying dependencies versions in requirements.txt.

hadialqattan avatar Jun 30 '21 23:06 hadialqattan

I believe flask should be at least version 1.1.1 and up, looking at the livestream. image

elpython3 avatar Jul 01 '21 00:07 elpython3

I believe flask should be at least version 1.1.1 and up, looking at the livestream. image

I believe that the dependency which causes the issue is flask-socketio (not flask).

hadialqattan avatar Jul 01 '21 01:07 hadialqattan

The issue is that flask-socketio version is not compatible with the socket.io version in the index.html.

hadialqattan avatar Jul 01 '21 01:07 hadialqattan

"POST / HTTP/1.1" 405 362 0.000997 Screenshot_10

Hi, I am also facing this issue now, it worked really well yesterday but the issue appears today and I am unable to solve it (already replaced with this line in my base.html () but still doesn't work all. Anyone knows how to solve this issue?

ApacheT101 avatar Jul 03 '21 09:07 ApacheT101

@ApacheT101 Did you modify anything other than that line? Assuming you didn't, try restarting the server, computer, etc. It generally works for me when stuff like that happens. @hadialqattan I tested out if dependencies versions worked (by manually installing flask-socketio versions), and I discovered flask-socketio versions 5 and up works (at least, on my ubuntu 20.04). Anything else either doesn't send or has the Method Not Allowed error.

elpython3 avatar Jul 03 '21 18:07 elpython3

@ApacheT101 Did you modify anything other than that line? Assuming you didn't, try restarting the server, computer, etc. It generally works for me when stuff like that happens. @hadialqattan I tested out if dependencies versions worked (by manually installing flask-socketio versions), and I discovered flask-socketio versions 5 and up works (at least, on my ubuntu 20.04). Anything else either doesn't send or has the Method Not Allowed error.

I tried to restart the computer and server before and even reinstall every imports in another laptop to test the script (no modification except change ip address in env file) but the error codes still comes up. Could you try to execute script on your laptop?

ApacheT101 avatar Jul 03 '21 19:07 ApacheT101

@ApacheT101 I just executed the code on my end. It works for me. image

elpython3 avatar Jul 03 '21 19:07 elpython3