Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
PoyntingPro opened this issue Feb 3, 2021 · 33 comments
Open

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

PoyntingPro opened this issue Feb 3, 2021 · 33 comments

Comments

@PoyntingPro
Copy link

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

@samarmohan
Copy link

You need to be logged in

@AyushSehrawat
Copy link

It's after logged in only

@Ziyaulmustafa
Copy link

I faced same issue, after I logged in

@justin-mathews
Copy link

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
Copy link

Do you guys have the sockets properly configured?

@justin-mathews
Copy link

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
Copy link

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 <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script> in base.html to <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.1.1/socket.io.min.js"></script> but I get the same message.

For reference running this on Pop!_OS 20.10

@justin-mathews
Copy link

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 <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script> in base.html to <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.1.1/socket.io.min.js"></script> 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

<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script>

to this

<script src="https://cdn.socket.io/3.1.1/socket.io.min.js"></script>

and restarted the server

@Ziyaulmustafa
Copy link

Ziyaulmustafa commented Feb 8, 2021

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 <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script> in base.html to <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.1.1/socket.io.min.js"></script> 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

<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script>

to this

<script src="https://cdn.socket.io/3.1.1/socket.io.min.js"></script>

and restarted the server

This worked for me, Thanks @justin-mathews

@sachinbhandare
Copy link

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 <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script> in base.html to <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.1.1/socket.io.min.js"></script> 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

<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script>

to this

<script src="https://cdn.socket.io/3.1.1/socket.io.min.js"></script>

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
Copy link

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

@AyushSehrawat
Copy link

This issue was probably due to version of socket-io

@TechStudent10
Copy link

TechStudent10 commented Mar 29, 2021

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

@AyushSehrawat
Copy link

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
Copy link

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
Copy link

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 <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script> in base.html to <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.1.1/socket.io.min.js"></script> 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

<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script>

to this

<script src="https://cdn.socket.io/3.1.1/socket.io.min.js"></script>

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
Copy link

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 <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script> in base.html to <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.1.1/socket.io.min.js"></script> 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

<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script>

to this

<script src="https://cdn.socket.io/3.1.1/socket.io.min.js"></script>

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
Copy link

pixl8dev commented May 8, 2021

Got the issue when running on replit

@AyushSehrawat
Copy link

Got the issue when running on replit

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

@ansonmng
Copy link

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

@hadialqattan
Copy link

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 <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script> in base.html to <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.1.1/socket.io.min.js"></script> 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

<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script>

to this

<script src="https://cdn.socket.io/3.1.1/socket.io.min.js"></script>

and restarted the server

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

flask
flask-socketio
eventlet
python-dotenv

@elpython3
Copy link

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 <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script> in base.html to <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.1.1/socket.io.min.js"></script> 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

<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script>

to this

<script src="https://cdn.socket.io/3.1.1/socket.io.min.js"></script>

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
Copy link

hadialqattan commented Jun 30, 2021

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 <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script> in base.html to <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.1.1/socket.io.min.js"></script> 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

<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script>

to this

<script src="https://cdn.socket.io/3.1.1/socket.io.min.js"></script>

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
Copy link

elpython3 commented Jul 1, 2021

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

@hadialqattan
Copy link

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
Copy link

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

@ApacheT101
Copy link

ApacheT101 commented Jul 3, 2021

"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 (<script src="https://cdn.socket.io/3.1.1/socket.io.min.js"></script>) but still doesn't work all. Anyone knows how to solve this issue?

@elpython3
Copy link

elpython3 commented Jul 3, 2021

@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
Copy link

@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
Copy link

elpython3 commented Jul 3, 2021

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

@sivanesh-dsp
Copy link

sivanesh-dsp commented Dec 18, 2021

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 <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script> in base.html to <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.1.1/socket.io.min.js"></script> 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

<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script>

to this

<script src="https://cdn.socket.io/3.1.1/socket.io.min.js"></script>

and restarted the server

This worked for me, Thanks @justin-mathews

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

@Gaiasem
Copy link

Gaiasem commented Feb 20, 2022

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 <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script> in base.html to <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.1.1/socket.io.min.js"></script> 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

<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script>

to this

<script src="https://cdn.socket.io/3.1.1/socket.io.min.js"></script>

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
Copy link

AlfinaN commented Oct 2, 2022

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 <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script> in base.html to <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.1.1/socket.io.min.js"></script> 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

<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script>

to this

<script src="https://cdn.socket.io/3.1.1/socket.io.min.js"></script>

and restarted the server

This worked for me, Thanks @justin-mathews

Thank u so muchhhhh , God bless u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests