You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While troubleshooting issue #2009 we noticed that when there is a firewall/NGINX issue uploading a file the error is reported in the wrong place. This is how it is reported when the problem is uploading the README:
The problem is that when this happen the Rails application does not even get the request and it is NGINX that reports back the error and it does it as an HTML page with status code 200 (see details in #2009). We could handle these errors by updating the JavaScript that process the response.
uppy.use(Uppy.XHRUpload, {
endpoint: uploadUrl,
headers: { 'X-CSRF-Token': tokenContent },
bundle: true, // upload all selected files at once
formData: true, // required when bundle: true
getResponseData(filename) {
$('#new-readme').html(`File <b>${filename}</b> has been uploaded and set as the README for this dataset.`);
$('#readme-upload').prop('disabled', false);
},
});
Notice how this code expected a filename but since the load balancer returned the error message instead we dump that message on the form.
While troubleshooting issue #2009 we noticed that when there is a firewall/NGINX issue uploading a file the error is reported in the wrong place. This is how it is reported when the problem is uploading the README:
The problem is that when this happen the Rails application does not even get the request and it is NGINX that reports back the error and it does it as an HTML page with status code 200 (see details in #2009). We could handle these errors by updating the JavaScript that process the response.
The JavaScript code for the README is this:
Notice how this code expected a filename but since the load balancer returned the error message instead we dump that message on the form.
The file upload for files other than the readme (https://github.com/pulibrary/pdc_describe/blob/main/app/javascript/entrypoints/pdc/work_edit_file_upload.es6) has the same problem except in that code we never display the error.
The text was updated successfully, but these errors were encountered: