ActiveStorage - выгрузка в GoogleCloudStorage, возврат 500 Backend Error - PullRequest
0 голосов
/ 28 июня 2019

У меня проблема с загрузкой PDF-файлов в GoogleCloudStorage с использованием гема ActiveStorage. Вот журналы:

Sending upload start command to https://www.googleapis.com/upload/storage/v1/b/my-test-bucket/o?name=asdasdasdasd
Upload status active
Sending upload command to https://www.googleapis.com/upload/storage/v1/b/my-test-bucket/o?name=asdasdasdasd&upload_id=AEnB2Uos2i4a7HpX1Pf7lM_oLew9FmzLWLnvWScPxuLy36etCIbVZ1iCNcb4aIo39nHDfX5OrdqX2kTf57iSUvbf3kzKnl_BOA&upload_protocol=resumable
Upload status final
Success - #<Google::Apis::StorageV1::Object:0x00007f8aa4d6c460
 @bucket="my-test-bucket",
 @content_type="application/octet-stream",
 @crc32c="Mbr5xA==",
 @etag="CLHq763bi+MCEAE=",
 @generation=1561708992394545,
 @id="my-test-bucket/asdasdasdasd/1561708992394545",
 @kind="storage#object",
 @md5_hash="m1IvMRxbURpx3MYl2Yrxkg==",
 @media_link=
  "https://www.googleapis.com/download/storage/v1/b/my-test-bucket/o/asdasdasdasd?generation=1561708992394545&alt=media",
 @metageneration=1,
 @name="asdasdasdasd",
 @self_link=
  "https://www.googleapis.com/storage/v1/b/my-test-bucket/o/asdasdasdasd",
 @size=574327,
 @storage_class="MULTI_REGIONAL",
 @time_created=Fri, 28 Jun 2019 08:03:12 +0000,
 @time_storage_class_updated=Fri, 28 Jun 2019 08:03:12 +0000,
 @updated=Fri, 28 Jun 2019 08:03:12 +0000>

Sending HTTP patch https://www.googleapis.com/storage/v1/b/my-test-bucket/o/asdasdasdasd?
500
#<HTTP::Message:0x00007f8aa4da4888 @http_header=#<HTTP::Message::Headers:0x00007f8aa4da4860 @http_version="1.1", @body_size=0, @chunked=false, @request_method="PATCH", @request_uri=#<Addressable::URI:0x3fc5526d296c URI:https://www.googleapis.com/storage/v1/b/my-test-bucket/o/asdasdasdasd?>, @request_query=nil, @request_absolute_uri=nil, @status_code=500, @reason_phrase="Internal Server Error", @body_type=nil, @body_charset=nil, @body_date=nil, @body_encoding=#<Encoding:UTF-8>, @is_request=false, @header_item=[["X-GUploader-UploadID", "ASasdasdasdkjasgdDq123sdaQ"], ["Vary", "Origin"], ["Vary", "X-Origin"], ["Content-Type", "application/json; charset=UTF-8"], ["Content-Length", "177"], ["Date", "Fri, 28 Jun 2019 08:03:13 GMT"], ["Server", "UploadServer"], ["Alt-Svc", "quic=\":443\"; ma=2592000; v=\"46,44,43,39\""]], @dumped=false>, @peer_cert=#<OpenSSL::X509::Certificate: subject=#<OpenSSL::X509::Name CN=*.googleapis.com,O=Google LLC,L=Mountain View,ST=California,C=US>, issuer=#<OpenSSL::X509::Name CN=Google Internet Authority G3,O=Google Trust Services,C=US>, serial=#<OpenSSL::BN:0x00007f8aa4db6c40>, not_before=2019-06-11 12:22:17 UTC, not_after=2019-09-03 12:20:00 UTC>, @http_body=#<HTTP::Message::Body:0x00007f8aa4da47c0 @body="{\n \"error\": {\n  \"errors\": [\n   {\n    \"domain\": \"global\",\n    \"reason\": \"backendError\",\n    \"message\": \"Backend Error\"\n   }\n  ],\n  \"code\": 500,\n  \"message\": \"Backend Error\"\n }\n}\n", @size=0, @positions=nil, @chunk_size=nil>, @previous=nil>
Caught error Server error
Error - #<Google::Apis::ServerError: Server error status_code: 500 header: #<HTTP::Message::Headers:0x00007f8aa4db5750 @http_version="1.1", @body_size=0, @chunked=false, @request_method="PATCH", @request_uri=#<Addressable::URI:0x3fc5526d296c URI:https://www.googleapis.com/storage/v1/b/my-test-bucket/o/asdasdasdasd?>, @request_query=nil, @request_absolute_uri=nil, @status_code=500, @reason_phrase="Internal Server Error", @body_type=nil, @body_charset=nil, @body_date=nil, @body_encoding=#<Encoding:UTF-8>, @is_request=false, @header_item=[["X-GUploader-UploadID", "ASasdasdasdkjasgdDq123sdaQ"], ["Vary", "Origin"], ["Vary", "X-Origin"], ["Content-Type", "application/json; charset=UTF-8"], ["Content-Length", "177"], ["Date", "Fri, 28 Jun 2019 08:03:13 GMT"], ["Server", "UploadServer"], ["Alt-Svc", "quic=\":443\"; ma=2592000; v=\"46,44,43,39\""]], @dumped=false> body: "{\n \"error\": {\n  \"errors\": [\n   {\n    \"domain\": \"global\",\n    \"reason\": \"backendError\",\n    \"message\": \"Backend Error\"\n   }\n  ],\n  \"code\": 500,\n  \"message\": \"Backend Error\"\n }\n}\n">

Sending HTTP patch https://www.googleapis.com/storage/v1/b/my-test-bucket/o/asdasdasdasd?
500
#<HTTP::Message:0x00007f8aa4ddb540 @http_header=#<HTTP::Message::Headers:0x00007f8aa4ddb518 @http_version="1.1", @body_size=0, @chunked=false, @request_method="PATCH", @request_uri=#<Addressable::URI:0x3fc5526e6020 URI:https://www.googleapis.com/storage/v1/b/my-test-bucket/o/asdasdasdasd?>, @request_query=nil, @request_absolute_uri=nil, @status_code=500, @reason_phrase="Internal Server Error", @body_type=nil, @body_charset=nil, @body_date=nil, @body_encoding=#<Encoding:UTF-8>, @is_request=false, @header_item=[["X-GUploader-UploadID", "ASasdjkkjdkjhdas23231231tg"], ["Vary", "Origin"], ["Vary", "X-Origin"], ["Content-Type", "application/json; charset=UTF-8"], ["Content-Length", "177"], ["Date", "Fri, 28 Jun 2019 08:03:14 GMT"], ["Server", "UploadServer"], ["Alt-Svc", "quic=\":443\"; ma=2592000; v=\"46,44,43,39\""]], @dumped=false>, @peer_cert=#<OpenSSL::X509::Certificate: subject=#<OpenSSL::X509::Name CN=*.googleapis.com,O=Google LLC,L=Mountain View,ST=California,C=US>, issuer=#<OpenSSL::X509::Name CN=Google Internet Authority G3,O=Google Trust Services,C=US>, serial=#<OpenSSL::BN:0x00007f8aa4de1a08>, not_before=2019-06-11 12:22:17 UTC, not_after=2019-09-03 12:20:00 UTC>, @http_body=#<HTTP::Message::Body:0x00007f8aa4ddb478 @body="{\n \"error\": {\n  \"errors\": [\n   {\n    \"domain\": \"global\",\n    \"reason\": \"backendError\",\n    \"message\": \"Backend Error\"\n   }\n  ],\n  \"code\": 500,\n  \"message\": \"Backend Error\"\n }\n}\n", @size=0, @positions=nil, @chunk_size=nil>, @previous=nil>
Caught error Server error
Error - #<Google::Apis::ServerError: Server error status_code: 500 header: #<HTTP::Message::Headers:0x00007f8aa4de01f8 @http_version="1.1", @body_size=0, @chunked=false, @request_method="PATCH", @request_uri=#<Addressable::URI:0x3fc5526e6020 URI:https://www.googleapis.com/storage/v1/b/my-test-bucket/o/asdasdasdasd?>, @request_query=nil, @request_absolute_uri=nil, @status_code=500, @reason_phrase="Internal Server Error", @body_type=nil, @body_charset=nil, @body_date=nil, @body_encoding=#<Encoding:UTF-8>, @is_request=false, @header_item=[["X-GUploader-UploadID", "ASasdjkkjdkjhdas23231231tg"], ["Vary", "Origin"], ["Vary", "X-Origin"], ["Content-Type", "application/json; charset=UTF-8"], ["Content-Length", "177"], ["Date", "Fri, 28 Jun 2019 08:03:14 GMT"], ["Server", "UploadServer"], ["Alt-Svc", "quic=\":443\"; ma=2592000; v=\"46,44,43,39\""]], @dumped=false> body: "{\n \"error\": {\n  \"errors\": [\n   {\n    \"domain\": \"global\",\n    \"reason\": \"backendError\",\n    \"message\": \"Backend Error\"\n   }\n  ],\n  \"code\": 500,\n  \"message\": \"Backend Error\"\n }\n}\n">

Sending HTTP patch https://www.googleapis.com/storage/v1/b/my-test-bucket/o/asdasdasdasd?
500
#<HTTP::Message:0x00007f8aa4e02a50 @http_header=#<HTTP::Message::Headers:0x00007f8aa4e02a28 @http_version="1.1", @body_size=0, @chunked=false, @request_method="PATCH", @request_uri=#<Addressable::URI:0x3fc552701b40 URI:https://www.googleapis.com/storage/v1/b/my-test-bucket/o/asdasdasdasd?>, @request_query=nil, @request_absolute_uri=nil, @status_code=500, @reason_phrase="Internal Server Error", @body_type=nil, @body_charset=nil, @body_date=nil, @body_encoding=#<Encoding:UTF-8>, @is_request=false, @header_item=[["X-GUploader-UploadID", "AEnB2UppDO6Zmpw87AXD_95QziANtWmj8O-0RksiLMdcVJ-uMOYNghzP-oNy5K1HJxEGnDf-QoKZPx1nA4ZVEpArkeel4OeTDg"], ["Vary", "Origin"], ["Vary", "X-Origin"], ["Content-Type", "application/json; charset=UTF-8"], ["Content-Length", "177"], ["Date", "Fri, 28 Jun 2019 08:03:15 GMT"], ["Server", "UploadServer"], ["Alt-Svc", "quic=\":443\"; ma=2592000; v=\"46,44,43,39\""]], @dumped=false>, @peer_cert=#<OpenSSL::X509::Certificate: subject=#<OpenSSL::X509::Name CN=*.googleapis.com,O=Google LLC,L=Mountain View,ST=California,C=US>, issuer=#<OpenSSL::X509::Name CN=Google Internet Authority G3,O=Google Trust Services,C=US>, serial=#<OpenSSL::BN:0x00007f8aa4e08f68>, not_before=2019-06-11 12:22:17 UTC, not_after=2019-09-03 12:20:00 UTC>, @http_body=#<HTTP::Message::Body:0x00007f8aa4e02960 @body="{\n \"error\": {\n  \"errors\": [\n   {\n    \"domain\": \"global\",\n    \"reason\": \"backendError\",\n    \"message\": \"Backend Error\"\n   }\n  ],\n  \"code\": 500,\n  \"message\": \"Backend Error\"\n }\n}\n", @size=0, @positions=nil, @chunk_size=nil>, @previous=nil>
Caught error Server error
Error - #<Google::Apis::ServerError: Server error status_code: 500 header: #<HTTP::Message::Headers:0x00007f8aa1cef760 @http_version="1.1", @body_size=0, @chunked=false, @request_method="PATCH", @request_uri=#<Addressable::URI:0x3fc552701b40 URI:https://www.googleapis.com/storage/v1/b/my-test-bucket/o/asdasdasdasd?>, @request_query=nil, @request_absolute_uri=nil, @status_code=500, @reason_phrase="Internal Server Error", @body_type=nil, @body_charset=nil, @body_date=nil, @body_encoding=#<Encoding:UTF-8>, @is_request=false, @header_item=[["X-GUploader-UploadID", "AEnB2UppDO6Zmpw87AXD_95QziANtWmj8O-0RksiLMdcVJ-uMOYNghzP-oNy5K1HJxEGnDf-QoKZPx1nA4ZVEpArkeel4OeTDg"], ["Vary", "Origin"], ["Vary", "X-Origin"], ["Content-Type", "application/json; charset=UTF-8"], ["Content-Length", "177"], ["Date", "Fri, 28 Jun 2019 08:03:15 GMT"], ["Server", "UploadServer"], ["Alt-Svc", "quic=\":443\"; ma=2592000; v=\"46,44,43,39\""]], @dumped=false> body: "{\n \"error\": {\n  \"errors\": [\n   {\n    \"domain\": \"global\",\n    \"reason\": \"backendError\",\n    \"message\": \"Backend Error\"\n   }\n  ],\n  \"code\": 500,\n  \"message\": \"Backend Error\"\n }\n}\n">

Sending HTTP patch https://www.googleapis.com/storage/v1/b/my-test-bucket/o/asdasdasdasd?
500
#<HTTP::Message:0x00007f8aa1d051f0 @http_header=#<HTTP::Message::Headers:0x00007f8aa1d051c8 @http_version="1.1", @body_size=0, @chunked=false, @request_method="PATCH", @request_uri=#<Addressable::URI:0x3fc550e82e70 URI:https://www.googleapis.com/storage/v1/b/my-test-bucket/o/asdasdasdasd?>, @request_query=nil, @request_absolute_uri=nil, @status_code=500, @reason_phrase="Internal Server Error", @body_type=nil, @body_charset=nil, @body_date=nil, @body_encoding=#<Encoding:UTF-8>, @is_request=false, @header_item=[["X-GUploader-UploadID", "ASD2312312kjshdaskjdhakjsdhkjas"], ["Vary", "Origin"], ["Vary", "X-Origin"], ["Content-Type", "application/json; charset=UTF-8"], ["Content-Length", "177"], ["Date", "Fri, 28 Jun 2019 08:03:17 GMT"], ["Server", "UploadServer"], ["Alt-Svc", "quic=\":443\"; ma=2592000; v=\"46,44,43,39\""]], @dumped=false>, @peer_cert=#<OpenSSL::X509::Certificate: subject=#<OpenSSL::X509::Name CN=*.googleapis.com,O=Google LLC,L=Mountain View,ST=California,C=US>, issuer=#<OpenSSL::X509::Name CN=Google Internet Authority G3,O=Google Trust Services,C=US>, serial=#<OpenSSL::BN:0x00007f8aa1d17378>, not_before=2019-06-11 12:22:17 UTC, not_after=2019-09-03 12:20:00 UTC>, @http_body=#<HTTP::Message::Body:0x00007f8aa1d05150 @body="{\n \"error\": {\n  \"errors\": [\n   {\n    \"domain\": \"global\",\n    \"reason\": \"backendError\",\n    \"message\": \"Backend Error\"\n   }\n  ],\n  \"code\": 500,\n  \"message\": \"Backend Error\"\n }\n}\n", @size=0, @positions=nil, @chunk_size=nil>, @previous=nil>
Caught error Server error
Error - #<Google::Apis::ServerError: Server error status_code: 500 header: #<HTTP::Message::Headers:0x00007f8aa1d15de8 @http_version="1.1", @body_size=0, @chunked=false, @request_method="PATCH", @request_uri=#<Addressable::URI:0x3fc550e82e70 URI:https://www.googleapis.com/storage/v1/b/my-test-bucket/o/asdasdasdasd?>, @request_query=nil, @request_absolute_uri=nil, @status_code=500, @reason_phrase="Internal Server Error", @body_type=nil, @body_charset=nil, @body_date=nil, @body_encoding=#<Encoding:UTF-8>, @is_request=false, @header_item=[["X-GUploader-UploadID", "ASD2312312kjshdaskjdhakjsdhkjas"], ["Vary", "Origin"], ["Vary", "X-Origin"], ["Content-Type", "application/json; charset=UTF-8"], ["Content-Length", "177"], ["Date", "Fri, 28 Jun 2019 08:03:17 GMT"], ["Server", "UploadServer"], ["Alt-Svc", "quic=\":443\"; ma=2592000; v=\"46,44,43,39\""]], @dumped=false> body: "{\n \"error\": {\n  \"errors\": [\n   {\n    \"domain\": \"global\",\n    \"reason\": \"backendError\",\n    \"message\": \"Backend Error\"\n   }\n  ],\n  \"code\": 500,\n  \"message\": \"Backend Error\"\n }\n}\n">

  GCS Storage (10223.5ms) Uploaded file to key: asdasdasdasd (checksum: m1IvMRxbURpx3MYl2Yrxkg==)
Completed 500 Internal Server Error in 19773ms (ActiveRecord: 408.7ms)

Из того, что я вижу в журналах и в корзине, файл был загружен правильно и запрос на исправление для обновления метаданныхтерпит неудачу.Я связался со службой поддержки Google, но они не очень помогают ...

Заранее спасибо за любые идеи.

1 Ответ

0 голосов
/ 01 июля 2019

Применение патча, описанного в Github post , проблема может быть решена.

...