HttpSession::sendHttpError(),code=405 Method Not Allowed

#1
Hi

I been playing around with latest version of openlitespeed for about 5 hours now and I can't figure out what this error really is, basically I have a file sharing website which the file server is separate from the core server which user access to upload files, now the problem I have is that in the latest version the upload function doesn't work and it return this error message

HttpSession::sendHttpError(),code=405 Method Not Allowed

I have another server using a slightly older version of openlitespeed with exactly the same configuration which works but this version seems to be not working, here is the error in firebug

http://expressimg.com/images/2015/0...59f9232419fde7ab7337396b6452aa7074e607323.jpg

and here is the debug of the server

================
2015-06-01 16:05:21.383 [DEBUG] [:37641] NtwkIOLink::handleEvents() events=1!
2015-06-01 16:05:21.383 [DEBUG] [:37641] HttpSession::eek:nReadEx(), state: 1!
2015-06-01 16:05:21.383 [DEBUG] [:37641] readToHeaderBuf().
2015-06-01 16:05:21.383 [DEBUG] [:37641] Read from client: 618
2015-06-01 16:05:21.383 [DEBUG] [:37641] read 618 bytes to header buffer
2015-06-01 16:05:21.383 [DEBUG] [:37641] processHeader() return 26, header state: 0.
2015-06-01 16:05:21.383 [DEBUG] [:37641] readToHeaderBuf() return 26.
2015-06-01 16:05:21.383 [DEBUG] [:37641] HttpSession::sendHttpError(),code=405 Method Not Allowed
2015-06-01 16:05:21.383 [DEBUG] [:37641] setupDynRespBodyBuf()
2015-06-01 16:05:21.383 [DEBUG] [:37641] allocate response body buffer
2015-06-01 16:05:21.383 [DEBUG] [:37641] response header finished!
2015-06-01 16:05:21.383 [DEBUG] [:37641] endResponse( 1 )
2015-06-01 16:05:21.383 [DEBUG] [:37641] endResponseInternal()
2015-06-01 16:05:21.383 [DEBUG] [:37641] HttpSession::flush()!
2015-06-01 16:05:21.383 [DEBUG] [:37641] sendRespHeaders()
2015-06-01 16:05:21.383 [DEBUG] [:37641] Written to client: 1362
2015-06-01 16:05:21.383 [DEBUG] [:37641] writeRespBody() len=1142 return 1142
2015-06-01 16:05:21.383 [DEBUG] [:37641] flushBody() return 0
2015-06-01 16:05:21.383 [DEBUG] [:37641] NtwkIOLink::flush...
2015-06-01 16:05:21.383 [DEBUG] [:37641] set HSS_COMPLETE flag.
2015-06-01 16:05:21.383 [DEBUG] [37641] NtwkIOLink::continueWrite()...
2015-06-01 16:05:21.383 [DEBUG] [:37641] write resumed!
2015-06-01 16:05:21.383 [DEBUG] [:37641] HttpSession::nextRequest()!
2015-06-01 16:05:21.383 [DEBUG] [:37641] NtwkIOLink::flush...
2015-06-01 16:05:21.383 [DEBUG] [:37641] Non-KeepAlive, CLOSING!
2015-06-01 16:05:21.383 [DEBUG] [:37641] HttpSession::recycle()
2015-06-01 16:05:21.384 [DEBUG] [37641] Shutting down out-bound socket ...
2015-06-01 16:05:21.384 [DEBUG] [:37641] Available Connections: 250, concurrent conn: 0
2015-06-01 16:05:21.384 [DEBUG] [37641] Shutting down out-bound socket ...
2015-06-01 16:05:21.421 [DEBUG] [37641] NtwkIOLink::handleEvents() events=17!
2015-06-01 16:05:21.421 [DEBUG] [:37641] Close socket ...
2015-06-01 16:05:21.421 [DEBUG] [:37641] Recycle NtwkIoLink
================

Note 1 : The script is base on PHP
Note 2 : Both servers are using the same version of php
Note 3 : Both server php setting is exactly the same
Note 4 : I checked the setting around the litespeed and they seems to be the same as well

Any help would be really appreciated
 
#2
Note - I just remembered that I used to have this problem on some of my other file servers which were running litespeed (Paid version) but my server manager somehow managed to fix the issue, I though I mention it because it might be something that you already fixed in litespeed, he is not available at the moment so I can ask him how he managed to fix it
 

lsfoo

Administrator
#3
Hi Parham,

Which OLS versions are you working with? Need to know the version that worked and the version that isn't working.

Also, I would like to make sure I understand your setup correctly, you have:
1. A server running Enterprise LiteSpeed(OLS?) that has all the files.
2. A server running OLS that users access that will get the files from Server 1.

So the client sends the request to Server 2, which gets the file from Server 1 and then serves it to the client. Please correct me if I'm wrong.

Which server sends the error message?

Thanks,
Kevin
 
#4
Hi Kevin

The version which is currently not working (or I couldn't get it to work) is Litespeed Web Server Open 1.3.11
The version which is currently working is Litespeed Web Server Open 1.3.6
Also I had the same issue with the paid version before but I don't anymore, it might have been that my server admin reported it and you guys fixed it

Now regarding the configuration

Client open Server 1, choose the file they want to upload and then something like this happen (So user upload directly to server 2)

POST http:/Server2/file_upload_handler.ajax.php?RandomDetail

As soon as this start I get the following error message on server

HttpSession::sendHttpError(),code=405 Method Not Allowed

and basically the post thing fail

Parham
 

lsfoo

Administrator
#5
Hi Parham,

Could you show us the request headers? There used to be some logic that may have caused it, but it should have been fixed since.

Kevin
 
#6
Hi Parham,
Could you show us the request headers? There used to be some logic that may have caused it, but it should have been fixed since.
Kevin
I think this is what you are looking for

(Request-Line) OPTIONS /core/page/ajax/file_upload_handler.ajax.php?r=domain.com&p=http&csaKey1=25da0bc9d2be59e569804399a819420831476e5c2876939df8d3a5070028f665&csaKey2=4bb247df41a06c49f7c9032ae926aee3f5da983e719eab4f54296651f778df1e HTTP/1.1
Host upload.4upld.com
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0 AlexaToolbar/pHZPKDGf-2.1
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language en-US,en;q=0.5
Accept-Encoding gzip, deflate
Origin http://domain.com
Access-Control-Request-Method POST
Connection keep-alive
Pragma no-cache
Cache-Control no-cache
 

lsfoo

Administrator
#7
Hi Parham,

OPTIONS /core/page/ajax/file_upload_handler.ajax.php?
This is the problem. Currently, the OPTIONS request will automatically return error 405.

I'm not sure how it used to work for you, or how your server manager fixed it, but this is what I am aware of:
Prior to 1.3.8, the OPTIONS request was not handled. This caused the server to hang (Which is why I'm not sure why yours is working.)
From 1.3.8 onward, OLS will just return 405.

For what it's worth, I did some research on this request type. It may result in security issues, which is likely why OLS will not handle this type of request.

Do you know of any alternative methods that you can use?

Kevin
 
#8
Ok I though I update this

I installed the normal litespeed and it's working fine (In the latest version of litespeed without any complicated setting it's working fine) so the issue is only in openlitespeed

Regards
Parham
 
Top