failed lsif uploads return relevant error logs
Created by: DaedalusG
Feature request description
It would be awesome if failed lsif uploads provided an error response from the frontend rather than the HTTP response
Is your feature request related to a problem? If so, please describe.
n/a
Describe alternatives you've considered.
Heres an upload request that fails because my S3 credentials suck and I have no authz
warrengifford@Warrens-MacBook-Pro echarts % src -endpoint=https://cse-aws-test.sgdev.org/ lsif upload
💡 Inferred arguments
repo: github.com/apache/echarts
commit: 566ba8e83dd283ba359fe9aceee0d4a12dbcd6c7
root:
file: ./dump.lsif
indexer: lsif-tsc
✅ Index compressed
💡 Indexed compressed (97.88MB -> 13.24MB).
❌ Failed to upload index file
unexpected status code: 500
warrengifford@Warrens-MacBook-Pro echarts % src -endpoint=https://cse-aws-test.sgdev.org/ lsif upload -trace=2
💡 Inferred arguments
repo: github.com/apache/echarts
commit: 566ba8e83dd283ba359fe9aceee0d4a12dbcd6c7
root:
file: ./dump.lsif
indexer: lsif-tsc
> POST https://cse-aws-test.sgdev.org/.api/lsif/upload?commit=566ba8e83dd283ba359fe9aceee0d4a12dbcd6c7&indexerName=lsif-tsc&repository=github.com%2Fapache%2Fecharts
> Request Headers:
> Authorization: [token <redacted>]
> Content-Type: [application/x-ndjson+lsif]
< POST https://cse-aws-test.sgdev.org/.api/lsif/upload?commit=566ba8e83dd283ba359fe9aceee0d4a12dbcd6c7&indexerName=lsif-tsc&repository=github.com%2Fapache%2Fecharts 500 Internal Server Error in 11.947359143s
< Response Headers:
< Cache-Control: [no-cache, max-age=0]
< Content-Length: [304]
< Content-Type: [text/plain; charset=utf-8]
< Date: [Thu, 30 Dec 2021 07:50:42 GMT]
< Server: [Caddy]
< Vary: [Accept-Encoding Authorization Cookie, Authorization, X-Requested-With Cookie]
< X-Content-Type-Options: [nosniff]
< X-Frame-Options: [DENY]
< X-Trace: []
< X-Xss-Protection: [1; mode=block]
> POST https://cse-aws-test.sgdev.org/.api/lsif/upload?commit=566ba8e83dd283ba359fe9aceee0d4a12dbcd6c7&indexerName=lsif-tsc&repository=github.com%2Fapache%2Fecharts
> Request Headers:
> Authorization: [token <redacted>]
> Content-Type: [application/x-ndjson+lsif]
< POST https://cse-aws-test.sgdev.org/.api/lsif/upload?commit=566ba8e83dd283ba359fe9aceee0d4a12dbcd6c7&indexerName=lsif-tsc&repository=github.com%2Fapache%2Fecharts 500 Internal Server Error in 3.668149835s
< Response Headers:
< Cache-Control: [no-cache, max-age=0]
< Content-Length: [304]
< Content-Type: [text/plain; charset=utf-8]
< Date: [Thu, 30 Dec 2021 07:50:46 GMT]
< Server: [Caddy]
< Vary: [Accept-Encoding Authorization Cookie, Authorization, X-Requested-With Cookie]
< X-Content-Type-Options: [nosniff]
< X-Frame-Options: [DENY]
< X-Trace: []
< X-Xss-Protection: [1; mode=block]
> POST https://cse-aws-test.sgdev.org/.api/lsif/upload?commit=566ba8e83dd283ba359fe9aceee0d4a12dbcd6c7&indexerName=lsif-tsc&repository=github.com%2Fapache%2Fecharts
> Request Headers:
> Authorization: [token <redacted>]
> Content-Type: [application/x-ndjson+lsif]
< POST https://cse-aws-test.sgdev.org/.api/lsif/upload?commit=566ba8e83dd283ba359fe9aceee0d4a12dbcd6c7&indexerName=lsif-tsc&repository=github.com%2Fapache%2Fecharts 500 Internal Server Error in 4.613667461s
< Response Headers:
< Cache-Control: [no-cache, max-age=0]
< Content-Length: [304]
< Content-Type: [text/plain; charset=utf-8]
< Date: [Thu, 30 Dec 2021 07:50:52 GMT]
< Server: [Caddy]
< Vary: [Accept-Encoding Authorization Cookie, Authorization, X-Requested-With Cookie]
< X-Content-Type-Options: [nosniff]
< X-Frame-Options: [DENY]
< X-Trace: []
< X-Xss-Protection: [1; mode=block]
> POST https://cse-aws-test.sgdev.org/.api/lsif/upload?commit=566ba8e83dd283ba359fe9aceee0d4a12dbcd6c7&indexerName=lsif-tsc&repository=github.com%2Fapache%2Fecharts
> Request Headers:
> Authorization: [token <redacted>]
> Content-Type: [application/x-ndjson+lsif]
< POST https://cse-aws-test.sgdev.org/.api/lsif/upload?commit=566ba8e83dd283ba359fe9aceee0d4a12dbcd6c7&indexerName=lsif-tsc&repository=github.com%2Fapache%2Fecharts 500 Internal Server Error in 4.262693107s
< Response Headers:
< Cache-Control: [no-cache, max-age=0]
< Content-Length: [304]
< Content-Type: [text/plain; charset=utf-8]
< Date: [Thu, 30 Dec 2021 07:50:58 GMT]
< Server: [Caddy]
< Vary: [Accept-Encoding Authorization Cookie, Authorization, X-Requested-With Cookie]
< X-Content-Type-Options: [nosniff]
< X-Frame-Options: [DENY]
< X-Trace: []
< X-Xss-Protection: [1; mode=block]
> POST https://cse-aws-test.sgdev.org/.api/lsif/upload?commit=566ba8e83dd283ba359fe9aceee0d4a12dbcd6c7&indexerName=lsif-tsc&repository=github.com%2Fapache%2Fecharts
> Request Headers:
> Authorization: [token <redacted>]
> Content-Type: [application/x-ndjson+lsif]
< POST https://cse-aws-test.sgdev.org/.api/lsif/upload?commit=566ba8e83dd283ba359fe9aceee0d4a12dbcd6c7&indexerName=lsif-tsc&repository=github.com%2Fapache%2Fecharts 500 Internal Server Error in 2.910556997s
< Response Headers:
< Cache-Control: [no-cache, max-age=0]
< Content-Length: [304]
< Content-Type: [text/plain; charset=utf-8]
< Date: [Thu, 30 Dec 2021 07:51:01 GMT]
< Server: [Caddy]
< Vary: [Accept-Encoding Authorization Cookie, Authorization, X-Requested-With Cookie]
< X-Content-Type-Options: [nosniff]
< X-Frame-Options: [DENY]
< X-Trace: []
< X-Xss-Protection: [1; mode=block]
> POST https://cse-aws-test.sgdev.org/.api/lsif/upload?commit=566ba8e83dd283ba359fe9aceee0d4a12dbcd6c7&indexerName=lsif-tsc&repository=github.com%2Fapache%2Fecharts
> Request Headers:
> Authorization: [token <redacted>]
> Content-Type: [application/x-ndjson+lsif]
< POST https://cse-aws-test.sgdev.org/.api/lsif/upload?commit=566ba8e83dd283ba359fe9aceee0d4a12dbcd6c7&indexerName=lsif-tsc&repository=github.com%2Fapache%2Fecharts 500 Internal Server Error in 2.705454028s
< Response Headers:
< Cache-Control: [no-cache, max-age=0]
< Content-Length: [304]
< Content-Type: [text/plain; charset=utf-8]
< Date: [Thu, 30 Dec 2021 07:51:05 GMT]
< Server: [Caddy]
< Vary: [Accept-Encoding Authorization Cookie, Authorization, X-Requested-With Cookie]
< X-Content-Type-Options: [nosniff]
< X-Frame-Options: [DENY]
< X-Trace: []
< X-Xss-Protection: [1; mode=block]
unexpected status code: 500
But in the frontend logs
t=2021-12-30T07:51:01+0000 lvl=eror msg=codeintel.uploadstore.Upload error="failed to upload object: operation error S3: CreateMultipartUpload, https response error StatusCode: 400, RequestID: 2SP3NYDTSRE8KTR8, HostID: em5XVN9MKp84ADU8LavdrazKhc3jLXPj4AxfYiU+R+w31/xaDzuTK0Djrn9F0HS+CN/zu7teuY0=, api error ExpiredToken: The provided token has expired." count=1.000 elapsed=2.804
t=2021-12-30T07:51:01+0000 lvl=eror msg="Failed to enqueue payload" error="failed to upload object: operation error S3: CreateMultipartUpload, https response error StatusCode: 400, RequestID: 2SP3NYDTSRE8KTR8, HostID: em5XVN9MKp84ADU8LavdrazKhc3jLXPj4AxfYiU+R+w31/xaDzuTK0Djrn9F0HS+CN/zu7teuY0=, api error ExpiredToken: The provided token has expired."
t=2021-12-30T07:51:01+0000 lvl=warn msg=http method=POST url="/.api/lsif/upload?commit=566ba8e83dd283ba359fe9aceee0d4a12dbcd6c7&indexerName=lsif-tsc&repository=github.com%2Fapache%2Fecharts" code=500 duration=2.812961097s x_forwarded_for=71.237.209.53 user=1
t=2021-12-30T07:51:05+0000 lvl=eror msg=codeintel.uploadstore.Upload error="failed to upload object: operation error S3: CreateMultipartUpload, https response error StatusCode: 400, RequestID: A75QHA3FM0C2ES9J, HostID: UY5UzQBxBw/4KfSQDnIKCRWb07w4EmRDWDJJ4a8uHChTlhOlgqZVmVQhHaJU8wf6VNjU9M5TNWs=, api error ExpiredToken: The provided token has expired." count=1.000 elapsed=2.602
t=2021-12-30T07:51:05+0000 lvl=eror msg="Failed to enqueue payload" error="failed to upload object: operation error S3: CreateMultipartUpload, https response error StatusCode: 400, RequestID: A75QHA3FM0C2ES9J, HostID: UY5UzQBxBw/4KfSQDnIKCRWb07w4EmRDWDJJ4a8uHChTlhOlgqZVmVQhHaJU8wf6VNjU9M5TNWs=, api error ExpiredToken: The provided token has expired."
t=2021-12-30T07:51:05+0000 lvl=warn msg=http method=POST url="/.api/lsif/upload?commit=566ba8e83dd283ba359fe9aceee0d4a12dbcd6c7&indexerName=lsif-tsc&repository=github.com%2Fapache%2Fecharts" code=500 duration=2.611047355s x_forwarded_for=71.237.209.53 user=1
It would be awesome if failing logs from the frontend could be returned in a failed upload request