Closed peterverraedt closed 3 years ago
Hmm, this is news. Will reproduce here - pretty sure we had it working prior to 4.2.9 release.
The following patch shows why this problem occurs and solves it. To be more precise, the error only occurs if the 'Advanced view' is disabled and the user does not see the form to select a target resource. On submission of the form, resourcesToUpload contains the string "undefined" which is in the end passed to irods as target resource.
diff --git a/src/metalnx-web/src/main/java/com/emc/metalnx/controller/UploadController.java b/src/metalnx-web/src/main/java/com/emc/metalnx/controller/UploadController.java
index 7c295d3c..5dc470e3 100755
--- a/src/metalnx-web/src/main/java/com/emc/metalnx/controller/UploadController.java
+++ b/src/metalnx-web/src/main/java/com/emc/metalnx/controller/UploadController.java
@@ -109,6 +109,10 @@ public class UploadController {
boolean overwrite = Boolean.parseBoolean(multipartRequest.getParameter("overwriteDuplicateFiles"));
String resources = multipartRequest.getParameter("resources");
String resourcesToUpload = multipartRequest.getParameter("resourcesToUpload");
+ if (resourcesToUpload.equals("undefined")) {
+ resourcesToUpload = "default";
+ }
+
String destPath = multipartRequest.getParameter("uploadDestinationPath");
logger.info("parsed parameters...");
Very good find. Thank you.
If we enable the advanced settings and try to upload a file, we're given a dropdown box that allows us to pick a valid resource. The entries in the dropdown box are populated by calling getAvailableRescForPath.
Based on that, I can think of a few choices for this issue:
Further experimentation shows that attempting to set resourcesToUpload to null or an empty string results in the file not being uploaded. There is no indication of failure either.
For now, I think the best option is to set the parameter to the value of default.storage.resource
if undefined is encountered. If no default resource has been defined, return an error to the client.
Another solution is to always use the advanced view. That way, users always provide a valid resource.
Upload of new files through metalnx fail against irods 4.2.9. The following error is reported in the rods log:
We have set
default.storage.resource=default
in metalnx.properties, but setting to an empty value gives the same problem. We have set"default_resource_name": "default"
in our irods configuration, and the following incore.re
.This was tested with metalnx 2.3.0 and 2.4.0 (with patches for mysql) against irods 4.2.9. The exact same versions of metalnx do work fine against irods 4.2.8 with exact the same configuration.
I wonder whether
msiSetDefaultResc
is still doing its thing in time, or metalnx is ignoring thedefault.storage.resource
property altogether - maybe best to test first whether this can be reproduced.