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

Server returns 500 error on upload. Fixed by restarting openfire service but problem keeps appearing later. #26

Open
hakakou opened this issue Sep 5, 2021 · 1 comment

Comments

@hakakou
Copy link

hakakou commented Sep 5, 2021

Using OpenFire 4.6.4, HTTP File Upload 1,1.3, on Windows Server 2016.
I'm using a converse.js client to upload files in the chat. Almost always it's succesful, however sometimes the response from the server is a 500 error. In the openfile logs, under the "All" tab, I see lines like:

2021.09.06 02:03:37 nl.goodbytes.xmpp.xep0363.Component - Entity '[email protected]/converse.js-44692399' tries to obtain slot.
2021.09.06 02:03:37 nl.goodbytes.xmpp.xep0363.Component - Entity '[email protected]/converse.js-44692399' obtained slot for 'DSC5659.jpg' (1741635 bytes). PUT-URL: https://chat.xxx.com:7443/httpfileupload/0f341d6d-564e-45d3-b0a2-1648f6f25450/DSC5659.jpg GET-URL: https://chat.xxx.com:7443/httpfileupload/0f341d6d-564e-45d3-b0a2-1648f6f25450/DSC5659.jpg
2021.09.06 02:03:37 nl.goodbytes.xmpp.xep0363.Servlet - Processing PUT request... (XX.XX.112.23 submitting to /httpfileupload/0f341d6d-564e-45d3-b0a2-1648f6f25450/DSC5659.jpg)
--- nothing else after about the upload

In the "Warn Tab"

2021.09.06 02:03:37 org.eclipse.jetty.server.HttpChannel - handleException /httpfileupload/0f341d6d-564e-45d3-b0a2-1648f6f25450/DSC5659.jpg java.nio.file.NoSuchFileException: C:\Windows\TEMP\xmppfileupload3257014815371578219\0f341d6d-564e-45d3-b0a2-1648f6f25450

The problem is that if I start getting these errors, then they appear indefinitely on every upload. However problem is fixed immediately if I restart the openfire service.

For example, if I restart the service, the upload works fine, and the logs are instead:

2021.09.06 02:08:13 nl.goodbytes.xmpp.xep0363.Servlet - Processing PUT request... (XX.XX.112.23 submitting to /httpfileupload/8c8018b8-1e1b-4ad3-bb68-4fa95a9293ec/DSC5659.jpg)
2021.09.06 02:08:14 nl.goodbytes.xmpp.xep0363.Servlet - ... responded with CREATED. Stored data from the request body in the repository.
2021.09.06 02:08:15 nl.goodbytes.xmpp.xep0363.Servlet - Processing GET request... (XX.XX.112.23 requesting from /httpfileupload/8c8018b8-1e1b-4ad3-bb68-4fa95a9293ec/DSC5659.jpg)
2021.09.06 02:08:15 org.jivesoftware.util.cache.CacheFactory - Created cache [org.jivesoftware.util.cache.DefaultLocalCacheStrategy] for Sequences
2021.09.06 02:08:15 nl.goodbytes.xmpp.xep0363.Servlet - ... responded with OK and included the data in the response body.

Any hints on how to fix this problem? After each service restart, the uploads work again for perhaps 24 hours, until this problem starts appearing again. I have checked permissions on c:\windows\temp, and this is not the problem.

@guusdk
Copy link
Member

guusdk commented Nov 4, 2021

Hmm... I wonder if this is caused by your operating system automatically purging the temp folder that is being used.

You could try to use a different directory by adding this system property to Openfire plugin.httpfileupload.fileRepo (you will need to restart the plugin afterwards).

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

2 participants