IBM / aspera-cli

IBM Aspera CLI
Apache License 2.0
75 stars 17 forks source link

ascli aoc intermittent issues when browsing or uploading #148

Open prosergi opened 3 months ago

prosergi commented 3 months ago

Customer is complaining to have intermittent issues with ascli aoc on support case TS016745972.

Customer already tried with different ascli versions including version 4.18 including upload or browse.

It’s possible customer can use read_timeout option to avoid intermittence:

ascli aoc admin res package list --http-options=@json:‘{“read_timeout”:10.0}’

Last error reported:

Logs of support case:

D, [2024-07-26T19:28:42.740977 #3293] DEBUG -- : add_cmd_line_options:commands/arguments=["aoc", "files", "browse", "/int10/int10-data/dev-wads"],options=["--log-level=debug"]

D, [2024-07-26T19:28:44.116400 #3293] DEBUG -- : send request (retries=0)
D, [2024-07-26T19:28:44.116643 #3293] DEBUG -- : ignore cert? ["ats-aws-us-west-2", 443] -> false
D, [2024-07-26T19:28:44.525742 #3293] DEBUG -- : result: code=200 mime=application/json
D, [2024-07-26T19:28:44.526096 #3293] DEBUG -- : data (json)=
[
  {
    "id": "1",
    "name": "folder10",
    "type": "link",
    "modified_time": null,
    "access_levels": [
      "list",
      "read",
      "write",
      "delete",
      "mkdir",
      "rename",
      "preview"
    ],
    "access_level": "edit"
  },
  {
    "id": "5",
    "name": "test10",
    "type": "link",
    "modified_time": null,
    "access_levels": [
      "list",
      "read",
      "write",
      "delete",
      "mkdir",
      "rename",
      "preview"
    ],
    "access_level": "edit"
  }
]
D, [2024-07-26T19:28:44.526435 #3293] DEBUG -- : raise_on_error GET //files/21/files 200
D, [2024-07-26T19:28:44.526781 #3293] DEBUG -- : result={:http=>#<Net::HTTPOK 200 OK readbody=true>, :data=>[{"id"=>"1", "name"=>"folder10", "type"=>"link", "modified_time"=>nil, "access_levels"=>["list", "read", "write", "delete", "mkdir", "rename", "preview"], "access_level"=>"edit"}, {"id"=>"5", "name"=>"test10", "type"=>"link", "modified_time"=>nil, "access_levels"=>["list", "read", "write", "delete", "mkdir", "rename", "preview"], "access_level"=>"edit"}]}
D, [2024-07-26T19:28:44.527072 #3293] DEBUG -- : folder_contents (json)=
[
  {
    "id": "1",
    "name": "test10",
    "type": "link",
    "modified_time": null,
    "access_levels": [
      "list",
      "read",
      "write",
      "delete",
      "mkdir",
      "rename",
      "preview"
    ],
    "access_level": "edit"
  },
  {
    "id": "5",
    "name": "test10",
    "type": "link",
    "modified_time": null,
    "access_levels": [
      "list",
      "read",
      "write",
      "delete",
      "mkdir",
      "rename",
      "preview"
    ],
    "access_level": "edit"
  }
]
D, [2024-07-26T19:28:44.527342 #3293] DEBUG -- : process_folder_tree checking /folder10
D, [2024-07-26T19:28:44.527528 #3293] DEBUG -- : process_folder_tree checking /test10
ERROR: Other(Aspera::AssertError): assertion failed: expecting String, but have nil: /usr/local/bundle/gems/aspera-cli-4.18.0/lib/aspera/api/node.rb:160:in `node_id_to_node'
/usr/local/bundle/gems/aspera-cli-4.18.0/lib/aspera/assert.rb:18:in `assert': assertion failed: expecting String, but have nil: /usr/local/bundle/gems/aspera-cli-4.18.0/lib/aspera/api/node.rb:160:in `node_id_to_node' (Aspera::AssertError)
    from /usr/local/bundle/gems/aspera-cli-4.18.0/lib/aspera/assert.rb:25:in `assert_type'
    from /usr/local/bundle/gems/aspera-cli-4.18.0/lib/aspera/api/aoc.rb:306:in `node_api_from'
    from /usr/local/bundle/gems/aspera-cli-4.18.0/lib/aspera/api/node.rb:160:in `node_id_to_node'
    from /usr/local/bundle/gems/aspera-cli-4.18.0/lib/aspera/api/node.rb:203:in `block in process_folder_tree'
    from /usr/local/bundle/gems/aspera-cli-4.18.0/lib/aspera/api/node.rb:193:in `each'
    from /usr/local/bundle/gems/aspera-cli-4.18.0/lib/aspera/api/node.rb:193:in `process_folder_tree'
    from /usr/local/bundle/gems/aspera-cli-4.18.0/lib/aspera/api/node.rb:223:in `resolve_api_fid'
    from /usr/local/bundle/gems/aspera-cli-4.18.0/lib/aspera/cli/plugins/node.rb:484:in `execute_command_gen4'
    from /usr/local/bundle/gems/aspera-cli-4.18.0/lib/aspera/cli/plugins/aoc.rb:317:in `execute_nodegen4_command'
    from /usr/local/bundle/gems/aspera-cli-4.18.0/lib/aspera/cli/plugins/aoc.rb:759:in `execute_action'
    from /usr/local/bundle/gems/aspera-cli-4.18.0/lib/aspera/cli/main.rb:300:in `process_command_line'
    from /usr/local/bundle/gems/aspera-cli-4.18.0/bin/ascli:24:in `<top (required)>'
    from /usr/local/bundle/bin/ascli:25:in `load'
    from /usr/local/bundle/bin/ascli:25:in `<main>'
Workspace: redacted
laurent-martin commented 3 months ago

The problem is that when a folder entry returns a type link , it shall also return keys: target_node_id and target_id, but some some reason here, the node api does not include this information. ascli cannot invent this.

laurent-martin commented 3 months ago

I have put some additional logic: if the folder listing does not include link information, then link information is read specifically, (but if second time fails, then it fails for good). Beta here: https://ibm.biz/aspera-cli-beta

laurent-martin commented 2 months ago

Release 4.18.1 includes the fix. I could not test it though.