Skip to content

Instantly share code, notes, and snippets.

@fukata
Last active Jul 30, 2022
Embed
What would you like to do?
Retryable CarrierWave::Storage::Fog
class ImageUploader < CarrierWave::Uploader::Base
storage RetryableStorageFog
cache_storage RetryableStorageFog
end
class RetryableStorageFog < CarrierWave::Storage::Fog
def store!(file)
retryable(__method__) { super }
end
def cache!(new_file)
retryable(__method__) { super }
end
def retrieve_from_cache!(identifier)
retryable(__method__) { super }
end
def retrieve!(identifier)
retryable(__method__) { super }
end
private
def retryable(method_name)
retryable_options = {
tries: 5,
sleep: lambda{|retries|
retries += 1
sleep_seconds = 2**retries
Rails.logger.warn("[RetryableStorageFog##{method_name}] sleep=#{sleep_seconds}, retries=#{retries}")
sleep_seconds
},
on: [StandardError],
}
Retryable.retryable(retryable_options) do |retries, e|
if retries > 0
Rails.logger.warn("[RetryableStorageFog##{method_name}] retries=#{retries}, e=#{e}")
end
yield
end
end
end
I, [2022-07-30T16:05:10.391880 #1] INFO -- : Started POST "/posts" for 172.23.0.1 at 2022-07-30 16:05:10 +0000
I, [2022-07-30T16:05:10.392415 #1] INFO -- : Cannot render console from 172.23.0.1! Allowed networks: 127.0.0.0/127.255.255.255, ::1
D, [2022-07-30T16:05:10.394488 #1] DEBUG -- :  (0.3ms) SELECT sqlite_version(*)
D, [2022-07-30T16:05:10.416782 #1] DEBUG -- : ActiveRecord::SchemaMigration Pluck (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
I, [2022-07-30T16:05:10.483825 #1] INFO -- : Processing by PostsController#create as HTML
I, [2022-07-30T16:05:10.483899 #1] INFO -- : Parameters: {"authenticity_token"=>"[FILTERED]", "post"=>{"title"=>"TEST9", "image"=>#<ActionDispatch::Http::UploadedFile:0x00007f238f2e5cc0 @tempfile=#<Tempfile:/tmp/RackMultipart20220730-1-sjgp43.jpg>, @original_filename="PXL_20220706_214233600.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"post[image]\"; filename=\"PXL_20220706_214233600.jpg\"\r\nContent-Type: image/jpeg\r\n">}, "commit"=>"投稿"}
D, [2022-07-30T16:05:10.489431 #1] DEBUG -- : TRANSACTION (0.0ms) begin transaction
D, [2022-07-30T16:05:10.489703 #1] DEBUG -- : ↳ app/controllers/posts_controller.rb:9:in `block in create'
W, [2022-07-30T16:05:10.493960 #1] WARN -- : [RetryableStorageFog#cache!]
W, [2022-07-30T16:05:10.841958 #1] WARN -- : [RetryableStorageFog#cache!] sleep=2, retries=1
W, [2022-07-30T16:05:12.842294 #1] WARN -- : [RetryableStorageFog#cache!] retries=1, e=Expected(200) <=> Actual(400 Bad Request)
excon.error.response
:body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>XMinioAdminBucketQuotaExceeded</Code><Message>Bucket quota exceeded</Message><Key>uploads/tmp/1659197110-517425914174540-0001-8512/PXL_20220706_214233600.jpg</Key><BucketName>images</BucketName><Resource>/images/uploads/tmp/1659197110-517425914174540-0001-8512/PXL_20220706_214233600.jpg</Resource><RequestId>1706A6FB409A7830</RequestId><HostId>68ab2aa1-914f-42e0-bd0e-84139e3255da</HostId></Error>"
:cookies => [
]
:headers => {
"Accept-Ranges" => "bytes"
"Connection" => "close"
"Content-Length" => "450"
"Content-Security-Policy" => "block-all-mixed-content"
"Content-Type" => "application/xml"
"Date" => "Sat, 30 Jul 2022 16:05:10 GMT"
"Server" => "MinIO"
"Strict-Transport-Security" => "max-age=31536000; includeSubDomains"
"Vary" => "Origin, Accept-Encoding"
"X-Amz-Request-Id" => "1706A6FB409A7830"
"X-Content-Type-Options" => "nosniff"
"X-Xss-Protection" => "1; mode=block"
}
:host => "minio"
:local_address => "172.23.0.2"
:local_port => 51964
:path => "/images/uploads/tmp/1659197110-517425914174540-0001-8512/PXL_20220706_214233600.jpg"
:port => 9000
:reason_phrase => "Bad Request"
:remote_ip => "172.23.0.3"
:status => 400
:status_line => "HTTP/1.1 400 Bad Request\r\n"
W, [2022-07-30T16:05:13.153844 #1] WARN -- : [RetryableStorageFog#cache!] sleep=4, retries=2
W, [2022-07-30T16:05:17.154189 #1] WARN -- : [RetryableStorageFog#cache!] retries=2, e=Expected(200) <=> Actual(400 Bad Request)
excon.error.response
:body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>XMinioAdminBucketQuotaExceeded</Code><Message>Bucket quota exceeded</Message><Key>uploads/tmp/1659197110-517425914174540-0001-8512/PXL_20220706_214233600.jpg</Key><BucketName>images</BucketName><Resource>/images/uploads/tmp/1659197110-517425914174540-0001-8512/PXL_20220706_214233600.jpg</Resource><RequestId>1706A6FBCB6B4416</RequestId><HostId>68ab2aa1-914f-42e0-bd0e-84139e3255da</HostId></Error>"
:cookies => [
]
:headers => {
"Accept-Ranges" => "bytes"
"Connection" => "close"
"Content-Length" => "450"
"Content-Security-Policy" => "block-all-mixed-content"
"Content-Type" => "application/xml"
"Date" => "Sat, 30 Jul 2022 16:05:13 GMT"
"Server" => "MinIO"
"Strict-Transport-Security" => "max-age=31536000; includeSubDomains"
"Vary" => "Origin, Accept-Encoding"
"X-Amz-Request-Id" => "1706A6FBCB6B4416"
"X-Content-Type-Options" => "nosniff"
"X-Xss-Protection" => "1; mode=block"
}
:host => "minio"
:local_address => "172.23.0.2"
:local_port => 51972
:path => "/images/uploads/tmp/1659197110-517425914174540-0001-8512/PXL_20220706_214233600.jpg"
:port => 9000
:reason_phrase => "Bad Request"
:remote_ip => "172.23.0.3"
:status => 400
:status_line => "HTTP/1.1 400 Bad Request\r\n"
W, [2022-07-30T16:05:18.267472 #1] WARN -- : [RetryableStorageFog#cache!] sleep=8, retries=3
W, [2022-07-30T16:05:26.267961 #1] WARN -- : [RetryableStorageFog#cache!] retries=3, e=HTTP/1.1 400 Bad Request
Accept-Ranges: bytes
Content-Length: 450
Content-Security-Policy: block-all-mixed-content
Content-Type: application/xml
Server: MinIO
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Origin
Vary: Accept-Encoding
X-Amz-Request-Id: 1706A6FCE097C660
X-Content-Type-Options: nosniff
X-Xss-Protection: 1; mode=block
Date: Sat, 30 Jul 2022 16:05:17 GMT
Connection: close
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>XMinioAdminBucketQuotaExceeded</Code><Message>Bucket quota exceeded</Message><Key>uploads/tmp/1659197110-517425914174540-0001-8512/PXL_20220706_214233600.jpg</Key><BucketName>images</BucketName><Resource>/images/uploads/tmp/1659197110-517425914174540-0001-8512/PXL_20220706_214233600.jpg</Resource><RequestId>1706A6FCE097C660</RequestId><HostId>68ab2aa1-914f-42e0-bd0e-84139e3255da</HostId></Error>Broken pipe (Excon::Error)
W, [2022-07-30T16:05:27.401897 #1] WARN -- : [RetryableStorageFog#cache!] sleep=16, retries=4
W, [2022-07-30T16:05:43.402420 #1] WARN -- : [RetryableStorageFog#cache!] retries=4, e=Expected(200) <=> Actual(400 Bad Request)
excon.error.response
:body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>XMinioAdminBucketQuotaExceeded</Code><Message>Bucket quota exceeded</Message><Key>uploads/tmp/1659197110-517425914174540-0001-8512/PXL_20220706_214233600.jpg</Key><BucketName>images</BucketName><Resource>/images/uploads/tmp/1659197110-517425914174540-0001-8512/PXL_20220706_214233600.jpg</Resource><RequestId>1706A6FF1C05ED74</RequestId><HostId>68ab2aa1-914f-42e0-bd0e-84139e3255da</HostId></Error>"
:cookies => [
]
:headers => {
"Accept-Ranges" => "bytes"
"Connection" => "close"
"Content-Length" => "450"
"Content-Security-Policy" => "block-all-mixed-content"
"Content-Type" => "application/xml"
"Date" => "Sat, 30 Jul 2022 16:05:27 GMT"
"Server" => "MinIO"
"Strict-Transport-Security" => "max-age=31536000; includeSubDomains"
"Vary" => "Origin, Accept-Encoding"
"X-Amz-Request-Id" => "1706A6FF1C05ED74"
"X-Content-Type-Options" => "nosniff"
"X-Xss-Protection" => "1; mode=block"
}
:host => "minio"
:local_address => "172.23.0.2"
:local_port => 51988
:path => "/images/uploads/tmp/1659197110-517425914174540-0001-8512/PXL_20220706_214233600.jpg"
:port => 9000
:reason_phrase => "Bad Request"
:remote_ip => "172.23.0.3"
:status => 400
:status_line => "HTTP/1.1 400 Bad Request\r\n"
D, [2022-07-30T16:05:43.600699 #1] DEBUG -- : TRANSACTION (0.1ms) rollback transaction
D, [2022-07-30T16:05:43.601075 #1] DEBUG -- : ↳ app/controllers/posts_controller.rb:8:in `create'
E, [2022-07-30T16:05:43.601237 #1] ERROR -- : Expected(200) <=> Actual(400 Bad Request)
excon.error.response
:body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>XMinioAdminBucketQuotaExceeded</Code><Message>Bucket quota exceeded</Message><Key>uploads/tmp/1659197110-517425914174540-0001-8512/PXL_20220706_214233600.jpg</Key><BucketName>images</BucketName><Resource>/images/uploads/tmp/1659197110-517425914174540-0001-8512/PXL_20220706_214233600.jpg</Resource><RequestId>1706A702E2694796</RequestId><HostId>68ab2aa1-914f-42e0-bd0e-84139e3255da</HostId></Error>"
:cookies => [
]
:headers => {
"Accept-Ranges" => "bytes"
"Connection" => "close"
"Content-Length" => "450"
"Content-Security-Policy" => "block-all-mixed-content"
"Content-Type" => "application/xml"
"Date" => "Sat, 30 Jul 2022 16:05:43 GMT"
"Server" => "MinIO"
"Strict-Transport-Security" => "max-age=31536000; includeSubDomains"
"Vary" => "Origin, Accept-Encoding"
"X-Amz-Request-Id" => "1706A702E2694796"
"X-Content-Type-Options" => "nosniff"
"X-Xss-Protection" => "1; mode=block"
}
:host => "minio"
:local_address => "172.23.0.2"
:local_port => 51996
:path => "/images/uploads/tmp/1659197110-517425914174540-0001-8512/PXL_20220706_214233600.jpg"
:port => 9000
:reason_phrase => "Bad Request"
:remote_ip => "172.23.0.3"
:status => 400
:status_line => "HTTP/1.1 400 Bad Request\r\n"
E, [2022-07-30T16:05:43.601693 #1] ERROR -- : /app/vendor/bundle/ruby/3.1.0/gems/excon-0.92.4/lib/excon/middlewares/expects.rb:13:in `response_call'
/app/vendor/bundle/ruby/3.1.0/gems/excon-0.92.4/lib/excon/middlewares/response_parser.rb:12:in `response_call'
/app/vendor/bundle/ruby/3.1.0/gems/excon-0.92.4/lib/excon/connection.rb:456:in `response'
/app/vendor/bundle/ruby/3.1.0/gems/excon-0.92.4/lib/excon/connection.rb:287:in `request'
/app/vendor/bundle/ruby/3.1.0/gems/excon-0.92.4/lib/excon/middlewares/idempotent.rb:50:in `error_call'
/app/vendor/bundle/ruby/3.1.0/gems/excon-0.92.4/lib/excon/middlewares/base.rb:17:in `error_call'
/app/vendor/bundle/ruby/3.1.0/gems/excon-0.92.4/lib/excon/middlewares/base.rb:17:in `error_call'
/app/vendor/bundle/ruby/3.1.0/gems/excon-0.92.4/lib/excon/connection.rb:312:in `rescue in request'
/app/vendor/bundle/ruby/3.1.0/gems/excon-0.92.4/lib/excon/connection.rb:227:in `request'
/app/vendor/bundle/ruby/3.1.0/gems/excon-0.92.4/lib/excon/middlewares/idempotent.rb:50:in `error_call'
/app/vendor/bundle/ruby/3.1.0/gems/excon-0.92.4/lib/excon/middlewares/base.rb:17:in `error_call'
/app/vendor/bundle/ruby/3.1.0/gems/excon-0.92.4/lib/excon/middlewares/base.rb:17:in `error_call'
/app/vendor/bundle/ruby/3.1.0/gems/excon-0.92.4/lib/excon/connection.rb:312:in `rescue in request'
/app/vendor/bundle/ruby/3.1.0/gems/excon-0.92.4/lib/excon/connection.rb:227:in `request'
/app/vendor/bundle/ruby/3.1.0/gems/excon-0.92.4/lib/excon/middlewares/idempotent.rb:50:in `error_call'
/app/vendor/bundle/ruby/3.1.0/gems/excon-0.92.4/lib/excon/middlewares/base.rb:17:in `error_call'
/app/vendor/bundle/ruby/3.1.0/gems/excon-0.92.4/lib/excon/middlewares/base.rb:17:in `error_call'
/app/vendor/bundle/ruby/3.1.0/gems/excon-0.92.4/lib/excon/connection.rb:312:in `rescue in request'
/app/vendor/bundle/ruby/3.1.0/gems/excon-0.92.4/lib/excon/connection.rb:227:in `request'
/app/vendor/bundle/ruby/3.1.0/gems/fog-core-2.2.4/lib/fog/core/connection.rb:79:in `request'
/app/vendor/bundle/ruby/3.1.0/gems/fog-xml-0.1.4/lib/fog/xml/connection.rb:9:in `request'
/app/vendor/bundle/ruby/3.1.0/gems/fog-aws-3.14.0/lib/fog/aws/storage.rb:672:in `_request'
/app/vendor/bundle/ruby/3.1.0/gems/fog-aws-3.14.0/lib/fog/aws/storage.rb:667:in `request'
/app/vendor/bundle/ruby/3.1.0/gems/fog-aws-3.14.0/lib/fog/aws/requests/storage/put_object.rb:48:in `put_object'
/app/vendor/bundle/ruby/3.1.0/gems/fog-aws-3.14.0/lib/fog/aws/models/storage/file.rb:282:in `save'
/app/vendor/bundle/ruby/3.1.0/gems/fog-core-2.2.4/lib/fog/core/collection.rb:50:in `create'
/app/vendor/bundle/ruby/3.1.0/gems/carrierwave-2.2.2/lib/carrierwave/storage/fog.rb:345:in `store'
/app/vendor/bundle/ruby/3.1.0/gems/carrierwave-2.2.2/lib/carrierwave/storage/fog.rb:118:in `cache!'
/app/app/lib/retryable_storage_fog.rb:7:in `block in cache!'
/app/app/lib/retryable_storage_fog.rb:34:in `block in retryable'
/app/vendor/bundle/ruby/3.1.0/gems/retryable-3.0.5/lib/retryable.rb:72:in `retryable'
/app/app/lib/retryable_storage_fog.rb:30:in `retryable'
/app/app/lib/retryable_storage_fog.rb:7:in `cache!'
/app/vendor/bundle/ruby/3.1.0/gems/carrierwave-2.2.2/lib/carrierwave/uploader/cache.rb:145:in `block in cache!'
/app/vendor/bundle/ruby/3.1.0/gems/carrierwave-2.2.2/lib/carrierwave/uploader/callbacks.rb:15:in `with_callbacks'
/app/vendor/bundle/ruby/3.1.0/gems/carrierwave-2.2.2/lib/carrierwave/uploader/cache.rb:144:in `cache!'
/app/vendor/bundle/ruby/3.1.0/gems/carrierwave-2.2.2/lib/carrierwave/mounter.rb:63:in `block (2 levels) in cache'
/app/vendor/bundle/ruby/3.1.0/gems/carrierwave-2.2.2/lib/carrierwave/mounter.rb:176:in `handle_error'
/app/vendor/bundle/ruby/3.1.0/gems/carrierwave-2.2.2/lib/carrierwave/mounter.rb:47:in `block in cache'
/app/vendor/bundle/ruby/3.1.0/gems/carrierwave-2.2.2/lib/carrierwave/mounter.rb:46:in `map'
/app/vendor/bundle/ruby/3.1.0/gems/carrierwave-2.2.2/lib/carrierwave/mounter.rb:46:in `cache'
/app/vendor/bundle/ruby/3.1.0/gems/carrierwave-2.2.2/lib/carrierwave/mount.rb:146:in `image='
/app/vendor/bundle/ruby/3.1.0/gems/carrierwave-2.2.2/lib/carrierwave/mount.rb:373:in `image='
/app/vendor/bundle/ruby/3.1.0/gems/carrierwave-2.2.2/lib/carrierwave/orm/activerecord.rb:75:in `image='
/app/vendor/bundle/ruby/3.1.0/gems/activemodel-7.0.3.1/lib/active_model/attribute_assignment.rb:49:in `public_send'
/app/vendor/bundle/ruby/3.1.0/gems/activemodel-7.0.3.1/lib/active_model/attribute_assignment.rb:49:in `_assign_attribute'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.3.1/lib/active_record/attribute_assignment.rb:21:in `block in _assign_attributes'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.3.1/lib/active_record/attribute_assignment.rb:13:in `each'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.3.1/lib/active_record/attribute_assignment.rb:13:in `_assign_attributes'
/app/vendor/bundle/ruby/3.1.0/gems/activemodel-7.0.3.1/lib/active_model/attribute_assignment.rb:34:in `assign_attributes'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.3.1/lib/active_record/core.rb:468:in `initialize'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.3.1/lib/active_record/inheritance.rb:75:in `new'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.3.1/lib/active_record/inheritance.rb:75:in `new'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.3.1/lib/active_record/persistence.rb:54:in `create!'
/app/app/controllers/posts_controller.rb:9:in `block in create'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.3.1/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.3.1/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:316:in `transaction'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.3.1/lib/active_record/transactions.rb:209:in `transaction'
/app/app/controllers/posts_controller.rb:8:in `create'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/abstract_controller/base.rb:215:in `process_action'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_controller/metal/rendering.rb:53:in `process_action'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/abstract_controller/callbacks.rb:234:in `block in process_action'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.3.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/app/vendor/bundle/ruby/3.1.0/gems/actiontext-7.0.3.1/lib/action_text/rendering.rb:20:in `with_renderer'
/app/vendor/bundle/ruby/3.1.0/gems/actiontext-7.0.3.1/lib/action_text/engine.rb:69:in `block (4 levels) in <class:Engine>'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.3.1/lib/active_support/callbacks.rb:127:in `instance_exec'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.3.1/lib/active_support/callbacks.rb:127:in `block in run_callbacks'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.3.1/lib/active_support/callbacks.rb:138:in `run_callbacks'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/abstract_controller/callbacks.rb:233:in `process_action'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_controller/metal/rescue.rb:22:in `process_action'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_controller/metal/instrumentation.rb:67:in `block in process_action'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.3.1/lib/active_support/notifications.rb:206:in `block in instrument'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.3.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.3.1/lib/active_support/notifications.rb:206:in `instrument'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_controller/metal/instrumentation.rb:66:in `process_action'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_controller/metal/params_wrapper.rb:259:in `process_action'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.3.1/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/abstract_controller/base.rb:151:in `process'
/app/vendor/bundle/ruby/3.1.0/gems/actionview-7.0.3.1/lib/action_view/rendering.rb:39:in `process'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_controller/metal.rb:188:in `dispatch'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_controller/metal.rb:251:in `dispatch'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/routing/route_set.rb:32:in `serve'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/journey/router.rb:50:in `block in serve'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/journey/router.rb:32:in `each'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/journey/router.rb:32:in `serve'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/routing/route_set.rb:852:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/tempfile_reaper.rb:15:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/etag.rb:27:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/conditional_get.rb:40:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/head.rb:12:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/http/permissions_policy.rb:38:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/http/content_security_policy.rb:36:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/session/abstract/id.rb:266:in `context'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/session/abstract/id.rb:260:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/middleware/cookies.rb:697:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.3.1/lib/active_record/migration.rb:603:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.3.1/lib/active_support/callbacks.rb:99:in `run_callbacks'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/middleware/executor.rb:14:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/middleware/debug_exceptions.rb:28:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/web-console-4.2.0/lib/web_console/middleware.rb:132:in `call_app'
/app/vendor/bundle/ruby/3.1.0/gems/web-console-4.2.0/lib/web_console/middleware.rb:19:in `block in call'
/app/vendor/bundle/ruby/3.1.0/gems/web-console-4.2.0/lib/web_console/middleware.rb:17:in `catch'
/app/vendor/bundle/ruby/3.1.0/gems/web-console-4.2.0/lib/web_console/middleware.rb:17:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/middleware/show_exceptions.rb:26:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.3.1/lib/rails/rack/logger.rb:40:in `call_app'
/app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.3.1/lib/rails/rack/logger.rb:25:in `block in call'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.3.1/lib/active_support/tagged_logging.rb:114:in `block in tagged'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.3.1/lib/active_support/tagged_logging.rb:38:in `tagged'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.3.1/lib/active_support/tagged_logging.rb:114:in `tagged'
/app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.3.1/lib/rails/rack/logger.rb:25:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/middleware/remote_ip.rb:93:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/middleware/request_id.rb:26:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/method_override.rb:24:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/runtime.rb:22:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.3.1/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/middleware/server_timing.rb:20:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/middleware/executor.rb:14:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/middleware/static.rb:23:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/sendfile.rb:110:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/actionpack-7.0.3.1/lib/action_dispatch/middleware/host_authorization.rb:137:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.3.1/lib/rails/engine.rb:530:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/puma-5.6.4/lib/puma/configuration.rb:252:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/puma-5.6.4/lib/puma/request.rb:77:in `block in handle_request'
/app/vendor/bundle/ruby/3.1.0/gems/puma-5.6.4/lib/puma/thread_pool.rb:340:in `with_force_shutdown'
/app/vendor/bundle/ruby/3.1.0/gems/puma-5.6.4/lib/puma/request.rb:76:in `handle_request'
/app/vendor/bundle/ruby/3.1.0/gems/puma-5.6.4/lib/puma/server.rb:441:in `process_client'
/app/vendor/bundle/ruby/3.1.0/gems/puma-5.6.4/lib/puma/thread_pool.rb:147:in `block in spawn_thread'
I, [2022-07-30T16:05:43.602054 #1] INFO -- : Completed 500 Internal Server Error in 33118ms (ActiveRecord: 0.4ms | Allocations: 141093)
F, [2022-07-30T16:05:43.606317 #1] FATAL -- :
Excon::Error::BadRequest (Expected(200) <=> Actual(400 Bad Request)
excon.error.response
:body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>XMinioAdminBucketQuotaExceeded</Code><Message>Bucket quota exceeded</Message><Key>uploads/tmp/1659197110-517425914174540-0001-8512/PXL_20220706_214233600.jpg</Key><BucketName>images</BucketName><Resource>/images/uploads/tmp/1659197110-517425914174540-0001-8512/PXL_20220706_214233600.jpg</Resource><RequestId>1706A702E2694796</RequestId><HostId>68ab2aa1-914f-42e0-bd0e-84139e3255da</HostId></Error>"
:cookies => [
]
:headers => {
"Accept-Ranges" => "bytes"
"Connection" => "close"
"Content-Length" => "450"
"Content-Security-Policy" => "block-all-mixed-content"
"Content-Type" => "application/xml"
"Date" => "Sat, 30 Jul 2022 16:05:43 GMT"
"Server" => "MinIO"
"Strict-Transport-Security" => "max-age=31536000; includeSubDomains"
"Vary" => "Origin, Accept-Encoding"
"X-Amz-Request-Id" => "1706A702E2694796"
"X-Content-Type-Options" => "nosniff"
"X-Xss-Protection" => "1; mode=block"
}
:host => "minio"
:local_address => "172.23.0.2"
:local_port => 51996
:path => "/images/uploads/tmp/1659197110-517425914174540-0001-8512/PXL_20220706_214233600.jpg"
:port => 9000
:reason_phrase => "Bad Request"
:remote_ip => "172.23.0.3"
:status => 400
:status_line => "HTTP/1.1 400 Bad Request\r\n"
):
app/lib/retryable_storage_fog.rb:7:in `block in cache!'
app/lib/retryable_storage_fog.rb:34:in `block in retryable'
app/lib/retryable_storage_fog.rb:30:in `retryable'
app/lib/retryable_storage_fog.rb:7:in `cache!'
app/controllers/posts_controller.rb:9:in `block in create'
app/controllers/posts_controller.rb:8:in `create'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment