BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
15.35k stars 1.92k forks source link

Can't save draft - Error 405 #2218

Closed navvienna closed 4 years ago

navvienna commented 4 years ago

Describe the bug When a draft is saved, a green checkmark will appear next to the text "undefined 0NaN:0NaN". On reopening the page, no draft is loaded.

Chrome Webconsole shows the error "PUT http://SERVERNAME:8081/ajax/page/55/save-draft 405 (Method Not Allowed)"

Steps To Reproduce Steps to reproduce the behavior:

  1. Open any page in edit mode and press CTRL + S
  2. See error

Expected behavior A draft should be saved on CTRL+S - when the same user reopens the page later, the saved draft should be loaded again to give the user the option to resume previous work.

Your Configuration (please complete the following information):

Additional context .env Value APP_URL=http://SERVERNAME:8081 Every other feature other than saving draft seem to work

ssddanbrown commented 4 years ago

Hi @navvienna, Sorry to hear you're experiencing this issue.

Just to confirm, can you successfully upload images & files to a page without issue? Just trying to determine if this is maybe an issue with all background requests on your instance.

navvienna commented 4 years ago

Hi @ssddanbrown uploading files / images works without issue. As far as I can see, every other feature is working fine for us.

navvienna commented 4 years ago

Hi @ssddanbrown apparently we are also unable to delete attachments - I'm not sure if this is linked to this problem, I just wanted to mention it. After the confirmation dialog, I see a green checkmark without text, but the attachment doesnt get deleted.

Thank you for your help and best regards

navvienna commented 4 years ago

Any chance to get help with this issue?

ssddanbrown commented 4 years ago

Hi @navvienna, Sorry for the lack of help, I generally feel a bit clueless when it comes to IIS specific issues.

The operations you describe, that are failing, are some of the only PUT/DELETE HTTP requests in the app, all others are GET/POST or only pretend to be PUT/DELETE. A search of ISS along with the response message seems to pick up quite a few results: https://www.google.com/search?q=iis+method+not+allowed

Many of these point to the WebDAV module interfering with these kinds of requests. Do you have that installed and is that something you can try disabling to test?

Otherwise we'll need to dig to see if this fails at IIS level or BookStack level.

navvienna commented 4 years ago

Hi @ssddanbrown I checked the installed roles on the server and the WebDAV module is neither activated nor installed.

Attached you can find the google chrome webconsole error which appears when saving a draft - maybe it helps? I tried googling the error, but couldnt find anything useful to be honest.

![Uploading 2020-10-06 10_47_46-Meeting 06.10.2020 - OneNote.png…]()

navvienna commented 4 years ago

Uploading here doesnt work, here is a link: https://ibb.co/0QW64mY

ssddanbrown commented 4 years ago

Thanks @navvienna, Unfortunately that does not provide much extra detail.

If you can, Can you open the chrome devtools, re-create the error, go to the "Network" tab, Click on the last red line, Then view the "preview" tab as see what the response looks like (If any)?

image

Also, Do you have anywhere to configure HTTP verbs for requests to the application as per this guide?: https://support.deskpro.com/en/kb/articles/configuring-http-verbs-on-windows-iis

navvienna commented 4 years ago

Hi @ssddanbrown thank you so much - apparently the HTTP verbs for request were the problem. I followed the article (although you have to set it for both php handlers), restarted IIS and now everything works as it should.

Best regards

ssddanbrown commented 4 years ago

@navvienna That's awesome to hear, Glad that got things working. Will try to remember if I see issues for other IIS users. Will therefore close this off.

awarre commented 2 years ago

In addition to enabling All verbs in the PHP Handler Mappings in IIS (noted above), I needed to do the following:

  1. Internet Information Services (IIS) Manager
  2. Select your BookStack site
  3. WebDAV Authoring Rules feature menu
  4. Disable WebDAV from the Action Menu on the right
  5. Modules feature menu
  6. Remove WebDAV Module
  7. Handler Mappings feature menu
  8. Remove WebDAV
  9. Restart BookStack website

Reference https://stackoverflow.com/a/29415149/860698

Apologies for responding to a closed issue. This is the top Google result on this issue so hopefully IIS folks will see this.

valentinkang commented 1 year ago

Hi everyone, I have 403 error for the automatic save draft action image image image

My server is hosted on OVH (french web host). It is a shared server Is it because of the HTTP PUT verb which will not be accepted by my host?

navvienna commented 1 year ago

Did you follow the steps mentioned in the previous posts?

valentinkang commented 1 year ago

Did you follow the steps mentioned in the previous posts?

It's for IIS Microsoft server, mine is a LAMP and I just checked my Laravel applications, they also use the PUT verb as well as DELETE and it works fine so that's ultimately not the problem.

ssddanbrown commented 1 year ago

@valentinkang I'd be very surprised if OVH were blocking specific HTTP verbs, especially since I don't think that'd be visible to them over HTTPS traffic anyway (without sketchy goings on). Since your scenario and environment is different to one discussed here please open a new support issue so you can detail out your specific case/environment.