(500) Internal server error on deleting files
See original GitHub issueI am unable to delete the 6 files that tus creates when for each uploaded file. I am pretty much using the TusClient and TusHttpClient from Tus.io
On the odd occasion it does actually delete the files but 95% of the time I get an internal server error.
2019-07-30 12:15:54.1926 ERROR [8:] TusFileTransferClient.TusHttpClient.PerformRequest TusException : TusFileTransferClient.TusException: The remote server returned an error: (500) Internal Server Error. —> System.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse()
var file = new FileInfo(filename);
var client = new TusClient();
var metaData = new Dictionary<string, string>
{
{"product", _fileRetrievalInfo.DisplayName},
{"fileType", _fileRetrievalInfo.RetrievalType.ToString()},
{"id", _surveyor.Id.ToString()}
};
var fileUrl = client.Create(uploadAddress, file, metaData);
client.Upload(fileUrl, file);
client.Delete(fileUrl));
''''
Issue Analytics
- State:
- Created 4 years ago
- Comments:9
Top Results From Across the Web
Can't delete or move empty folder: 500 Internal Server Error
I have discovered a couple of folders in my nextcloud account that can not be deleted or moved. For at least one folder...
Read more >How to Fix a 500 Internal Server Error on Your Site
The 500 Internal Server Error status code occurs when the server encounters an error that prevents it from fulfilling the request.
Read more >What is “HTTP 500 Internal Server Error” and How to Fix It?
A common cause of the “Internal Server Error” is a problem within the .htaccess file. If the file is corrupted, it defines an...
Read more >HTTP 500 Internal Server Error: What It Means & How to Fix It
If You're Trying to Load a Page with a 500 Internal Server Error: · 1. Refresh the page. · 2. Come back later....
Read more >How to Fix a 500 Internal Server Error
In most cases, a 500 Internal Server Error is due to an incorrect permission on one or more files or folders. In most...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So whilst I have not managed to get a proper error message I have found the cause. It was obviously me being a dufus!
So in this code to save the uploaded file
I had forgotten to close the file.
Perhaps some error checking around the file deletion so it can give a better error message for idiot users like me?
Thanks for all your help it works perfectly now
I haven’t as yet I am afraid I was dragged off the project for a week or so. I am back on it now and will try tomorrow to get the logs. The project I am working on is using asp.net and mvc 5 so will have to work out how to get global error handlers for it as I believe its not as easy as core.
I have however found that sometimes it does delete the files without errors, not often but sometimes. I suspect something is keeping the file open or some such.
Thanks