ruby on rails - s3io: ArgumentError: wrong number of arguments (1 for 0) -


i have strange problem in production app. in 1 of workers uses sidekiq have code this:

  def unzip_file_to_bucket(file_url, filename)     s3io.open(upload_bucket.objects[filename], 'w', max_file_size: 0) |os|       zip::file.open(open(file_url)) |zip|         zip.first.get_input_stream |is|           while buf = is.sysread(::zip::decompressor::chunk_size, buf)             os << buf           end         end       end     end   end    def upload_bucket     aws::s3.new(access_key_id: env['aws_access_key_id_io'], secret_access_key: env['aws_secret_access_key_io']).buckets[env['aws_bucket_io']]   end 

this code returns me following error: argumenterror: wrong number of arguments (1 0)

here stacktrace:

argumenterror: wrong number of arguments (1 0)   celluloid/tasks/task_fiber.rb:15:in `block in create'   celluloid/tasks.rb:57:in `block in initialize'   celluloid/actor.rb:357:in `block in task'   celluloid/cell.rb:71:in `block in task'   celluloid/cell.rb:60:in `block in invoke'   celluloid/calls.rb:122:in `dispatch'   celluloid/calls.rb:26:in `dispatch'   celluloid/calls.rb:26:in `public_send'   sidekiq/processor.rb:50:in `process'   sidekiq/processor.rb:98:in `stats'   sidekiq/processor.rb:51:in `block in process'   sidekiq/middleware/chain.rb:132:in `invoke'   sidekiq/middleware/chain.rb:132:in `call'   sidekiq/middleware/chain.rb:129:in `block in invoke'   sidekiq/middleware/server/logging.rb:11:in `call'   sidekiq/logging.rb:30:in `with_context'   sidekiq/middleware/server/logging.rb:15:in `block in call'   sidekiq/middleware/chain.rb:129:in `block in invoke'   sidekiq/failures/middleware.rb:9:in `call'   sidekiq/middleware/chain.rb:129:in `block in invoke'   sidekiq/middleware/server/retry_jobs.rb:74:in `call'   sidekiq/middleware/chain.rb:129:in `block in invoke'   sidekiq/middleware/server/active_record.rb:6:in `call'   sidekiq/middleware/chain.rb:129:in `block in invoke'   sidekiq/batch/middleware.rb:25:in `call'   sidekiq/middleware/chain.rb:129:in `block in invoke'   sidekiq_unique_jobs/middleware/server/unique_jobs.rb:16:in `call'   sidekiq/middleware/chain.rb:129:in `block in invoke'   sidetiq/middleware/history.rb:8:in `call'   sidekiq/middleware/chain.rb:129:in `block in invoke'   new_relic/agent/instrumentation/sidekiq.rb:29:in `call'   new_relic/agent/instrumentation/controller_instrumentation.rb:352:in `perform_action_with_newrelic_trace'   new_relic/agent/instrumentation/sidekiq.rb:33:in `block in call'   sidekiq/middleware/chain.rb:127:in `block in invoke'   sidekiq/processor.rb:52:in `block (2 levels) in process'   sidekiq/processor.rb:75:in `execute_job'   app/workers/qualtrics_download_job_worker.rb:22:in `perform'   app/workers/qualtrics_download_job_worker.rb:37:in `unzip_file_to_bucket'   s3io/wrapper.rb:13:in `open'   s3io/wrapper.rb:13:in `new'   s3io/write_wrapper.rb:30:in `initialize'   aws/s3/s3_object.rb:724:in `multipart_upload'   aws/s3/object_upload_collection.rb:50:in `create'   (eval):3:in `initiate_multipart_upload'   aws/core/client.rb:476:in `client_request'   aws/core/client.rb:373:in `return_or_raise'   aws/core/client.rb:477:in `block in client_request'   aws/core/client.rb:391:in `log_client_request'   aws/core/client.rb:514:in `block (2 levels) in client_request'   aws/core/async_handle.rb:40:in `on_success'   aws/core/async_handle.rb:40:in `call'   aws/core/client.rb:515:in `block (3 levels) in client_request'   aws/s3/client.rb:127:in `block (2 levels) in bucket_method'   aws/core/xml/parser.rb:33:in `parse'   aws/core/xml/parser.rb:61:in `sax_handler'   aws/core/xml/parser.rb:61:in `new'   aws/core/xml/parser.rb:61:in `initialize' 

any ideas may problem?

sounds autoloading / threading issue in aws-sdk. try running in initializer:

aws.eager_autoload!(services: %w(s3)) 

Comments