techwithtim / Chat-Web-App

Made during livestream
325 stars 141 forks source link

The method is not allowed for the requested URL. #2

Open anim1311 opened 3 years ago

anim1311 commented 3 years ago

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

samarmohan commented 3 years ago

You need to be logged in

AyushSehrawat commented 3 years ago

It's after logged in only

Ziyaulmustafa commented 3 years ago

I faced same issue, after I logged in

justin-mathews commented 3 years ago

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)

samarmohan commented 3 years ago

Do you guys have the sockets properly configured?

justin-mathews commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

Ziyaulmustafa commented 3 years ago

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

sachinbhandare commented 3 years ago

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?

AyushSehrawat commented 3 years ago

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

AyushSehrawat commented 3 years ago

This issue was probably due to version of socket-io

TechStudent10 commented 3 years ago

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

AyushSehrawat commented 3 years ago

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

TechStudent10 commented 3 years ago

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.

frankiee12a9 commented 3 years ago

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?

AyushSehrawat commented 3 years ago

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

pixl8dev commented 3 years ago

Got the issue when running on replit

AyushSehrawat commented 3 years ago

Got the issue when running on replit

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

ansonmng commented 3 years ago

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

hadialqattan commented 3 years ago

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

elpython3 commented 3 years ago

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.

hadialqattan commented 3 years ago

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.

elpython3 commented 3 years ago

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

hadialqattan commented 3 years ago

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 commented 3 years ago

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

ApacheT101 commented 3 years ago

"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?

elpython3 commented 3 years ago

@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.

ApacheT101 commented 3 years ago

@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?

elpython3 commented 3 years ago

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

sivanesh-dsp commented 2 years ago

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

Bro I still got the error please tell me what to do :(

Gaiasem commented 2 years ago

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

I'm having the same problem. I replaced the script tag as suggested:

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

I can Login successfully, but when I write a message and hit the "Send" button, nothing is sent and nothing appears on the chat. I didn't modify anything else except that script tag. Can someone help?

AlfinaN commented 2 years ago

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

Thank u so muchhhhh , God bless u