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

What happens when the file storage path becomes unavailable? #45

Open
Fishbowler opened this issue Dec 18, 2022 · 2 comments
Open

What happens when the file storage path becomes unavailable? #45

Fishbowler opened this issue Dec 18, 2022 · 2 comments

Comments

@Fishbowler
Copy link
Member

This behaviour in the HTTP File Upload plugin is unknown.

If the path is misconfigured, or is configured to a transient location (e.g. network storage), what does the plugin do when it cannot write the file upon file upload?
What should it do?

@Fishbowler
Copy link
Member Author

Fishbowler commented Dec 18, 2022

When the directory is available:

2022.12.18 15:34:04 INFO [pool-60-thread-3]: nl.goodbytes.xmpp.xep0363.Component - Entity 'user1@xmpp.localhost.example/Spark 3.0.0' tries to obtain slot.
2022.12.18 15:34:04 INFO [pool-60-thread-3]: nl.goodbytes.xmpp.xep0363.Component - Entity 'user1@xmpp.localhost.example/Spark 3.0.0' obtained slot for 'My+project-1.png' (1914393 bytes). PUT-URL: https://xmpp1.localhost.example:7443/httpfileupload/bYQ6LOkprTqpDuGaxpIbPesUHvw/My+project-1.png GET-URL: https://xmpp1.localhost.example:7443/httpfileupload/bYQ6LOkprTqpDuGaxpIbPesUHvw/My+project-1.png
2022.12.18 15:34:04 INFO [Jetty-QTP-BOSH-64]: nl.goodbytes.xmpp.xep0363.Servlet - Processing PUT request... (172.60.0.1 submitting to /httpfileupload/bYQ6LOkprTqpDuGaxpIbPesUHvw/My+project-1.png)
2022.12.18 15:34:04 INFO [Jetty-QTP-BOSH-64]: nl.goodbytes.xmpp.xep0363.Servlet - ... responded with CREATED. Stored data from the request body in the repository.

When it becomes unavailable (performed here by moving the directory that is configured in plugin.httpfileupload.fileRepo)

2022.12.18 15:38:52 INFO [pool-60-thread-4]: nl.goodbytes.xmpp.xep0363.Component - Entity 'user1@xmpp.localhost.example/Spark 3.0.0' tries to obtain slot.
2022.12.18 15:38:52 INFO [pool-60-thread-4]: nl.goodbytes.xmpp.xep0363.Component - Entity 'user1@xmpp.localhost.example/Spark 3.0.0' obtained slot for 'My+project-1.png' (1914393 bytes). PUT-URL: https://xmpp1.localhost.example:7443/httpfileupload/WxB6cCH2tDAyZOriXl1T9aReKW4/My+project-1.png GET-URL: https://xmpp1.localhost.example:7443/httpfileupload/WxB6cCH2tDAyZOriXl1T9aReKW4/My+project-1.png
2022.12.18 15:38:52 INFO [Jetty-QTP-BOSH-105]: nl.goodbytes.xmpp.xep0363.Servlet - Processing PUT request... (172.60.0.1 submitting to /httpfileupload/WxB6cCH2tDAyZOriXl1T9aReKW4/My+project-1.png)
2022.12.18 15:38:52 WARN [Jetty-QTP-BOSH-105]: org.eclipse.jetty.server.HttpChannel - handleException /httpfileupload/WxB6cCH2tDAyZOriXl1T9aReKW4/My+project-1.png java.nio.file.NoSuchFileException: /tmp/potato/WxB6cCH2tDAyZOriXl1T9aReKW4

The HTTP File Upload plugin has returned an HTTP 500 to the client.
(There's also a Spark bug here, in that no feedback is given to the user)

@Fishbowler
Copy link
Member Author

Notable:

  • No errors are logged, only warnings
  • The fileRepo prop is intentionally only evaluated at initialisation, along with its reachability
  • No feedback is delivered to the client in the HTTP 500 message - it's an empty body

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

1 participant