irods: `itree` gives confusing errors for missing data objects and collections
- main
- 4-3-stable
- 4-2-stable
We are testing 4.2.11 with iCommands 4.2.11. We observed itree
command cannot correctly handle wrong inputs/arguments for options.
[user1@dev-u0137480 ~]$ itree -L 1 0
terminating with uncaught exception of type irods::experimental::filesystem::filesystem_error: could not open collection for reading: Unknown error -310000
Aborted (core dumped)
Logs:
[2022-10-07T09:06:04.434Z][icts-t-cloud-hev-3] rsyslogd stdout | 2022-10-07T11:06:04.433858+02:00 demo rodsServer[29524]: icts_demo - remote addresses: 2a02:2c40:0:221::3306:10, 2a02:2c40:0:451:67:242:ac11:16 ERROR: [-]#011/work/server/core/src/rodsAgent.cpp:566:int runIrodsAgentFactory(sockaddr_un) : status [SSL_SHUTDOWN_ERROR] errno [] -- message [failed to call 'agent stop']#012#011[-]#011/work/lib/core/src/sockComm.cpp:160:irods::error sockAgentStop(irods::network_object_ptr) : status [SSL_SHUTDOWN_ERROR] errno [] -- message [failed to call 'agent stop']#012#011#011[-]#011/work/plugins/network/ssl/libssl.cpp:952:irods::error ssl_agent_stop(irods::plugin_context &) : status [SSL_SHUTDOWN_ERROR] errno [] -- message [error completing shutdown of SSL connection]#012
[2022-10-07T09:06:04.434Z][icts-t-cloud-hev-3] rsyslogd stdout | 2022-10-07T11:06:04.433267+02:00 demo rodsServer[29524]: icts_demo - remote addresses: 127.0.0.1, 2a02:2c40:0:221::3306:10, 2a02:2c40:0:451:67:242:ac11:16 ERROR: [-]#011/work/server/core/src/rsApiHandler.cpp:542:int readAndProcClientMsg(rsComm_t *, int) : status [SYS_HEADER_READ_LEN_ERR] errno [] -- message [failed to call 'read header']#012#011[-]#011/work/lib/core/src/sockComm.cpp:198:irods::error readMsgHeader(irods::network_object_ptr, msgHeader_t *, struct timeval *) : status [SYS_HEADER_READ_LEN_ERR] errno [] -- message [failed to call 'read header']#012#011#011[-]#011/work/plugins/network/ssl/libssl.cpp:572:irods::error ssl_read_msg_header(irods::plugin_context &, void *, struct timeval *) : status [SYS_HEADER_READ_LEN_ERR] errno [] -- message [read 0 expected 4]#012
[2022-10-07T09:06:04.461Z][icts-t-cloud-hev-3] rsyslogd stdout | 2022-10-07T11:06:04.461080+02:00 demo rodsServer[102]: (null) - ERROR: Agent process [29524] exited with status [64]
We see the same for usages below:
[user1@dev-u0137480 ~]$ itree --indent 3 0
terminating with uncaught exception of type irods::experimental::filesystem::filesystem_error: could not open collection for reading: Unknown error -310000
Aborted (core dumped)
[user1@dev-u0137480 ~]$ itree -I alice.txt test.txt
terminating with uncaught exception of type irods::experimental::filesystem::filesystem_error: could not open collection for reading: Unknown error -814000
Aborted (core dumped)
Also, we can say that having a feature to provide more than one argument or patter (regex) to itree -I
itree --ignore
could be much useful. (Or a possibility to use in combination with --pattern)
Thanks.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 32 (21 by maintainers)
Commits related to this issue
- [irods/irods#6627] Output better error messages for invalid path arguments. If the logical path argument given to itree is not an existing collection, we call this an error and return prematurely. — committed to d-w-moore/irods_client_icommands by d-w-moore a year ago
- [#6627] tests for itree with invalid arguments. Testing for path arguments to itree which are not collections, or do not exist. — committed to d-w-moore/irods by d-w-moore a year ago
- [#6627] tests for itree with invalid arguments. Testing for path arguments to itree which are not collections, or do not exist. — committed to irods/irods by d-w-moore a year ago
- [irods/irods#6627] Output better error messages for invalid path arguments. If the logical path argument given to itree is not an existing collection, we call this an error and return prematurely. — committed to irods/irods_client_icommands by d-w-moore a year ago
- [#6627] tests for itree with invalid arguments. Testing for path arguments to itree which are not collections, or do not exist. — committed to d-w-moore/irods by d-w-moore a year ago
- [#6627] tests for itree with invalid arguments. Testing for path arguments to itree which are not collections, or do not exist. — committed to d-w-moore/irods by d-w-moore a year ago
- [irods/irods#6627] Output better error messages for invalid path arguments. If the logical path argument given to itree is not an existing collection, we call this an error and return prematurely. — committed to d-w-moore/irods_client_icommands by d-w-moore a year ago
- [irods/irods#6627] Output better error messages for invalid path arguments. If the logical path argument given to itree is not an existing collection, we call this an error and return prematurely. — committed to d-w-moore/irods_client_icommands by d-w-moore a year ago
- [irods/irods#6627] Output better error messages for invalid path arguments. If the logical path argument given to itree is not an existing collection, we call this an error and return prematurely. — committed to irods/irods_client_icommands by d-w-moore a year ago
- [#6627] tests for itree with invalid arguments. Testing for path arguments to itree which are not collections, or do not exist. — committed to irods/irods by d-w-moore a year ago
- [irods/irods#6627] Output better error messages for invalid path arguments. If the logical path argument given to itree is not an existing collection, we call this an error and return prematurely. — committed to irods/irods_client_icommands by d-w-moore a year ago
- [#6627] tests for itree with invalid arguments. Testing for path arguments to itree which are not collections, or do not exist. — committed to irods/irods by d-w-moore a year ago
Things still seem off. Given the path to a data object which does exist, we get the
what
message (in []):whereas if the path argument is a collection that doesn’t exist, we have (as before)
I’ll do a little bit more investigating as to where & why the errors are being thrown, but this does seem odd and not as helpful as it could be.
To get the integer value, call
e.code().value()
.See https://en.cppreference.com/w/cpp/error/error_code/value
Oh, good.
Ok, will make the new issue then, regarding the style of help text.
I also finally spotted the
cout << desc
, which is responsible for printing the help text.