500 error instead of 503 when SMB not available #22826

Closed
PVince81 opened this Issue Mar 3, 2016 · 1 comment

Projects

None yet

4 participants

@PVince81
Collaborator
PVince81 commented Mar 3, 2016

Steps

  1. Go to admin page
  2. Setup a SMB mount with custom credentials as "/smb". (make sure there are already files in there)
  3. PROPFIND on "/smb" => see non-empty contents
  4. Shut down the SMB server. This should result in "connection refused" internally.
  5. PROPFIND on "/smb" again
  6. Restart SMB server
  7. PROPFIND on "/smb" again

Expected result

  • Should receive a 503 Storage Not Available response on the PROPFIND while the SMB server is down. The entry in oc_storages must have "available" set to 0.
  • On the last PROPFIND after restarting the server, the results should appear again.

Actual result

  • The entry in oc_storages must have "available" is still set to 1.
  • PROPFIND returns a 500 error "Connection refused"

Versions

Observed on stable9 and master

We should adapt the SMB storage implementation to properly throw StorageNotAvailableException in all code paths. Note that relevant exceptions like "not found" or "forbidden" should NOT get converted.

Would it make sense to have a storage wrapper that is able to catch all kinds of exceptions and translate them to StorageNotAvailableException ?

@icewind1991 @Xenopathic

@PVince81 PVince81 added this to the 9.0.1-next-maintenance milestone Mar 3, 2016
@icewind1991 icewind1991 was assigned by PVince81 Mar 9, 2016
@PVince81
Collaborator

PR is here #23300

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment