QutEcoacoustics / baw-server

The acoustic workbench server for storing and managing ecoacoustic data. Manages the structure and audio data. Provides an API for clients access.
Apache License 2.0
9 stars 4 forks source link

Harvest: authentication to sftpgo is failing when token is expired #602

Closed atruskie closed 2 years ago

atruskie commented 2 years ago
A NoMethodError occurred in harvests#create:

  undefined method `bytesize' for {:error=>"token is expired", :message=>"Unauthorized"}:Hash

    self.content_length = body.bytesize
                              ^^^^^^^^^
  lib/gems/sftpgo-client/lib/sftpgo_client/faraday/authentication_middleware.rb:34:in `block in call'

-------------------------------
Backtrace:
-------------------------------

  lib/gems/sftpgo-client/lib/sftpgo_client/faraday/authentication_middleware.rb:34:in `block in call'
  lib/gems/sftpgo-client/lib/sftpgo_client/faraday/authentication_middleware.rb:29:in `call'
  lib/gems/sftpgo-client/lib/sftpgo_client/faraday/response_result_middleware.rb:20:in `call'
  lib/gems/sftpgo-client/lib/sftpgo_client/user_service.rb:50:in `create_user'
  lib/gems/baw-workers/lib/baw_workers/upload_service/communicator.rb:64:in `create_upload_user'
  app/models/harvest.rb:296:in `open_upload_slot'
  app/controllers/harvests_controller.rb:66:in `create'
  app/modules/include_controller.rb:684:in `set_then_reset_user_stamper'

Two problems: