Artifacts not being created by CLI

I am using the Sentry CLI to create releases and upload source maps for a Next.js project. Although the CLI works perfectly to create a release, associate commits, and create a deployment, it does not create any artifacts despite not throwing errors when the upload-sourcemaps command is run.

Here is how I am using the CLI:

$ VERSION="$CI_COMMIT_SHA"
$ sentry-cli releases new $VERSION --project $SENTRY_PROJECT
$ sentry-cli releases set-commits $VERSION --auto
$ sentry-cli releases files $VERSION upload-sourcemaps ".next" \
  --rewrite \
  --url-prefix "~/_next" \
  --strip-prefix "webpack://_N_E/" \
  --verbose \
  --validate \
  --wait
$ sentry-cli releases deploys $VERSION new \
  -e $DEPLOY_ENVIRONMENT_NAME \
  --url $DEPLOY_ENVIRONMENT_URL \
  --started $DEPLOY_START \
  --finished $DEPLOY_FINISH
$ sentry-cli releases finalize $VERSION

When I apply the --wait flag to the upload source maps command, the CLI will hang indefinitely. If I remove the flag, the CLI reports the maps as being uploaded with no error.

Reviewing the release in Sentry afterwards reveals that no artifacts were uploaded.

Here is the output of the upload source maps command before it hangs indefinitely:

$ sentry-cli releases files $VERSION upload-sourcemaps ".next" \
  --rewrite \
  --url-prefix "~/_next" \
  --strip-prefix "webpack://_N_E/" \
  --verbose \
  --validate \
  --wait
> Found 85 release files
> Analyzing 85 sources
> Rewriting sources
> Adding source map references
> Validating sources
> Bundled 85 files for upload
> Uploaded release files to Sentry

And here is the output with SENTRY_LOG_LEVEL set to debug:

$ sentry-cli releases files $VERSION upload-sourcemaps ".next" \
  --rewrite \
  --url-prefix "~/_next" \
  --strip-prefix "webpack://_N_E/" \
  --verbose \
  --validate \
  --wait
  DEBUG   2020-10-23 16:44:33.503638226 +00:00 < X-Frame-Options: deny
  DEBUG   2020-10-23 16:44:33.503644240 +00:00 < Access-Control-Allow-Credentials: true
  DEBUG   2020-10-23 16:44:33.503660230 +00:00 response status: 200
  DEBUG   2020-10-23 16:44:33.503672474 +00:00 body: {"dateReleased":null,"newGroups":0,"commitCount":3,"url":null,"data":{},"lastDeploy":null,"deployCount":0,"dateCreated":"2020-10-23T16:10:35.660712Z","lastEvent":null,"version":"REDACTED-COMMIT-SHA","firstEvent":null,"lastCommit":{"repository":{"status":"active","integrationId":"3","externalSlug":264,"name":"REDACTED-PROJECT","provider":{"id":"integrations:gitlab","name":"Gitlab"},"url":"https://REDACTED-GIT-HOST/REACTED-TEAM/REDACTED-PROJECT","id":"3","dateCreated":"2020-09-16T18:39:45.202813Z"},"releases":[{"dateReleased":null,"url":null,"dateCreated":"2020-10-23T16:10:35.660712Z","version":"REDACTED-COMMIT-SHA","shortVersion":"REDACTED-COMMIT-SHA","ref":null}],"author":{"username":"REDACTED","lastLogin":"2020-10-22T20:49:30.075451Z","isSuperuser":false,"isManaged":false,"experiments":{},"lastActive":"2020-10-22T22:29:53.623386Z","isStaff":false,"id":"3","isActive":true,"has2fa":false,"name":"READACTED","avatarUrl":"READACTED","dateJoined":"2020-09-16T15:10:23.953139Z","emails":[{"is_verified":true,"id":"3","email":"[MASKED]"}],"avatar":{"avatarUuid":"REACTED","avatarType":"upload"},"hasPasswordAuth":false,"email":"[MASKED]"},"dateCreated":"2020-10-23T16:05:31Z","message":"Update readme","id":"REDACTED-COMMIT-SHA"},"shortVersion":"REDACTED-COMMIT-SHA","authors":[{"username":"REDACTED","lastLogin":"2020-10-22T20:49:30.075451Z","isSuperuser":false,"isManaged":false,"experiments":{},"lastActive":"2020-10-22T22:29:53.623386Z","isStaff":false,"id":"3","isActive":true,"has2fa":false,"name":"READACTED","avatarUrl":"READACTED","dateJoined":"2020-09-16T15:10:23.953139Z","emails":[{"is_verified":true,"id":"3","email":"[MASKED]"}],"avatar":{"avatarUuid":"REACTED","avatarType":"upload"},"hasPasswordAuth":false,"email":"[MASKED]"}],"owner":null,"versionInfo":{"buildHash":"REDACTED-COMMIT-SHA","version":{"raw":"REDACTED-COMMIT-SHA"},"description":"857dc5c6f170","package":null},"ref":null,"projects":[{"name":"REDACTED-PROJECT","platform":"javascript-react","slug":"REDACTED-PROJECT","platforms":[],"newGroups":0,"id":2}]}
  DEBUG   2020-10-23 16:44:33.503672474 +00:00 body: {"dateReleased":null,"newGroups":0,"commitCount":3,"url":null,"data":{},"lastDeploy":null,"deployCount":0,"dateCreated":"2020-10-23T16:10:35.660712Z","lastEvent":null,"version":"REDACTED-COMMIT-SHA","firstEvent":null,"lastCommit":{"repository":{"status":"active","integrationId":"3","externalSlug":264,"name":"REDACTED-PROJECT","provider":{"id":"integrations:gitlab","name":"Gitlab"},"url":"https://REDACTED-GIT-HOST/REACTED-TEAM/REDACTED-PROJECT","id":"3","dateCreated":"2020-09-16T18:39:45.202813Z"},"releases":[{"dateReleased":null,"url":null,"dateCreated":"2020-10-23T16:10:35.660712Z","version":"REDACTED-COMMIT-SHA","shortVersion":"REDACTED-COMMIT-SHA","ref":null}],"author":{"username":"REDACTED","lastLogin":"2020-10-22T20:49:30.075451Z","isSuperuser":false,"isManaged":false,"experiments":{},"lastActive":"2020-10-22T22:29:53.623386Z","isStaff":false,"id":"3","isActive":true,"has2fa":false,"name":"REDACTED","avatarUrl":"READACTED","dateJoined":"2020-09-16T15:10:23.953139Z","emails":[{"is_verified":true,"id":"3","email":"[MASKED]"}],"avatar":{"avatarUuid":"REACTED","avatarType":"upload"},"hasPasswordAuth":false,"email":"[MASKED]"},"dateCreated":"2020-10-23T16:05:31Z","message":"Update readme","id":"REDACTED-COMMIT-SHA"},"shortVersion":"REDACTED-COMMIT-SHA","authors":[{"username":"REDACTED","lastLogin":"2020-10-22T20:49:30.075451Z","isSuperuser":false,"isManaged":false,"experiments":{},"lastActive":"2020-10-22T22:29:53.623386Z","isStaff":false,"id":"3","isActive":true,"has2fa":false,"name":"READACTED","avatarUrl":"READACTED","dateJoined":"2020-09-16T15:10:23.953139Z","emails":[{"is_verified":true,"id":"3","email":"[MASKED]"}],"avatar":{"avatarUuid":"REACTED","avatarType":"upload"},"hasPasswordAuth":false,"email":"[MASKED]"}],"owner":null,"versionInfo":{"buildHash":"REDACTED-COMMIT-SHA","version":{"raw":"REDACTED-COMMIT-SHA"},"description":"857dc5c6f170","package":null},"ref":null,"projects":[{"name":"REDACTED-PROJECT","platform":"javascript-react","slug":"REDACTED-PROJECT","platforms":[],"newGroups":0,"id":2}]}
  DEBUG   2020-10-23 16:44:33.507885727 +00:00 sentry-cli version: 1.58.0, platform: "linux", architecture: "x86_64"
  INFO    2020-10-23 16:44:33.507926926 +00:00 sentry-cli was invoked with the following command line: "sentry-cli" "releases" "files" "REDACTED-COMMIT-SHA" "upload-sourcemaps" ".next" "--rewrite" "--url-prefix" "~/_next" "--strip-prefix" "webpack://_N_E/" "--verbose" "--validate" "--wait"
> Found 85 release files
> Analyzing 85 sources
> Rewriting sources
> Adding source map references
> Validating sources
  DEBUG   2020-10-23 16:44:33.984199163 +00:00 request POST https://REDACTED-SENTRY-INSTANCE.tld/api/0/projects/REDACTED-ORGANIZATION/REDACTED-PROJECT/releases/
  DEBUG   2020-10-23 16:44:33.984218065 +00:00 using token authentication
  DEBUG   2020-10-23 16:44:33.984225904 +00:00 json body: {"version":"REDACTED-COMMIT-SHA","projects":["REDACTED-PROJECT"]}
  DEBUG   2020-10-23 16:44:33.984231315 +00:00 retry number 0, max retries: 0
  DEBUG   2020-10-23 16:44:34.002301189 +00:00 > POST /api/0/projects/REDACTED-ORGANIZATION/REDACTED-PROJECT/releases/ HTTP/1.1
  DEBUG   2020-10-23 16:44:34.002321820 +00:00 > Host: REDACTED-SENTRY-INSTANCE.tld
  DEBUG   2020-10-23 16:44:34.002327436 +00:00 > Accept: */*
  DEBUG   2020-10-23 16:44:34.002332183 +00:00 > Connection: TE
  DEBUG   2020-10-23 16:44:34.002336949 +00:00 > TE: gzip
  DEBUG   2020-10-23 16:44:34.002341696 +00:00 > User-Agent: sentry-cli/1.58.0
  DEBUG   2020-10-23 16:44:34.002676203 +00:00 > Authorization: Bearer 18243fd2***
  DEBUG   2020-10-23 16:44:34.002686788 +00:00 > Content-Type: application/json
  DEBUG   2020-10-23 16:44:34.002691965 +00:00 > Content-Length: 78
  DEBUG   2020-10-23 16:44:34.200394215 +00:00 < HTTP/1.1 208 Unknown Status Code
  DEBUG   2020-10-23 16:44:34.200422205 +00:00 < Date: Fri, 23 Oct 2020 16:44:34 GMT
  DEBUG   2020-10-23 16:44:34.200429753 +00:00 < Content-Type: application/json
  DEBUG   2020-10-23 16:44:34.200436221 +00:00 < Content-Length: 2482
  DEBUG   2020-10-23 16:44:34.200442132 +00:00 < Connection: keep-alive
  DEBUG   2020-10-23 16:44:34.200447741 +00:00 < Server: openresty/1.15.8.2
  DEBUG   2020-10-23 16:44:34.200457653 +00:00 < Access-Control-Allow-Headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization
  DEBUG   2020-10-23 16:44:34.200465847 +00:00 < X-Content-Type-Options: nosniff
  DEBUG   2020-10-23 16:44:34.200471914 +00:00 < Content-Language: en
  DEBUG   2020-10-23 16:44:34.200479738 +00:00 < Access-Control-Expose-Headers: X-Sentry-Error, Retry-After
  DEBUG   2020-10-23 16:44:34.200485237 +00:00 < Vary: Accept-Language, Cookie
  DEBUG   2020-10-23 16:44:34.200492137 +00:00 < X-XSS-Protection: 1; mode=block
  DEBUG   2020-10-23 16:44:34.200497617 +00:00 < Allow: GET, POST, HEAD, OPTIONS
  DEBUG   2020-10-23 16:44:34.200505318 +00:00 < Access-Control-Allow-Origin: *
  DEBUG   2020-10-23 16:44:34.200511010 +00:00 < Access-Control-Allow-Methods: PUT,GET,POST,OPTIONS
  DEBUG   2020-10-23 16:44:34.200520481 +00:00 < X-Frame-Options: deny
  DEBUG   2020-10-23 16:44:34.200528784 +00:00 < Access-Control-Allow-Credentials: true
  DEBUG   2020-10-23 16:44:34.200553194 +00:00 response status: 208REDACTED
  DEBUG   2020-10-23 16:44:34.200573235 +00:00 body: {"dateReleased":null,"newGroups":0,"commitCount":3,"url":null,"data":{},"lastDeploy":null,"deployCount":0,"dateCreated":"2020-10-23T16:10:35.660712Z","lastEvent":null,"version":"REDACTED-COMMIT-SHA","firstEvent":null,"lastCommit":{"repository":{"status":"active","integrationId":"3","externalSlug":264,"name":"REDACTED-PROJECT","provider":{"id":"integrations:gitlab","name":"Gitlab"},"url":"https://REDACTED-GIT-HOST/REACTED-TEAM/REDACTED-PROJECT","id":"3","dateCreated":"2020-09-16T18:39:45.202813Z"},"releases":[{"dateReleased":null,"url":null,"dateCreated":"2020-10-23T16:10:35.660712Z","version":"REDACTED-COMMIT-SHA","shortVersion":"REDACTED-COMMIT-SHA","ref":null}],"author":{"username":"REDACTED","lastLogin":"2020-10-22T20:49:30.075451Z","isSuperuser":false,"isManaged":false,"experiments":{},"lastActive":"2020-10-22T22:29:53.623386Z","isStaff":false,"id":"3","isActive":true,"has2fa":false,"name":"READACTED","avatarUrl":"READACTED","dateJoined":"2020-09-16T15:10:23.953139Z","emails":[{"is_verified":true,"id":"3","email":"[MASKED]"}],"avatar":{"avatarUuid":"REACTED","avatarType":"upload"},"hasPasswordAuth":false,"email":"[MASKED]"},"dateCreated":"2020-10-23T16:05:31Z","message":"Update readme","id":"REDACTED-COMMIT-SHA"},"shortVersion":"REDACTED-COMMIT-SHA","authors":[{"username":"REDACTED","lastLogin":"2020-10-22T20:49:30.075451Z","isSuperuser":false,"isManaged":false,"experiments":{},"lastActive":"2020-10-22T22:29:53.623386Z","isStaff":false,"id":"3","isActive":true,"has2fa":false,"name":"READACTED","avatarUrl":"READACTED","dateJoined":"2020-09-16T15:10:23.953139Z","emails":[{"is_verified":true,"id":"3","email":"[MASKED]"}],"avatar":{"avatarUuid":"REACTED","avatarType":"upload"},"hasPasswordAuth":false,"email":"[MASKED]"}],"owner":null,"versionInfo":{"buildHash":"REDACTED-COMMIT-SHA","version":{"raw":"REDACTED-COMMIT-SHA"},"description":"857dc5c6f170","package":null},"ref":null,"projects":[{"name":"REDACTED-PROJECT","platform":"javascript-react","slug":"REDACTED-PROJECT","platforms":[],"newGroups":0,"id":2}]}
  DEBUG   2020-10-23 16:44:34.200573235 +00:00 body: {"dateReleased":null,"newGroups":0,"commitCount":3,"url":null,"data":{},"lastDeploy":null,"deployCount":0,"dateCreated":"2020-10-23T16:10:35.660712Z","lastEvent":null,"version":"REDACTED-COMMIT-SHA","firstEvent":null,"lastCommit":{"repository":{"status":"active","integrationId":"3","externalSlug":264,"name":"REDACTED-PROJECT","provider":{"id":"integrations:gitlab","name":"Gitlab"},"url":"https://REDACTED-GIT-HOST/REACTED-TEAM/REDACTED-PROJECT","id":"3","dateCreated":"2020-09-16T18:39:45.202813Z"},"releases":[{"dateReleased":null,"url":null,"dateCreated":"2020-10-23T16:10:35.660712Z","version":"REDACTED-COMMIT-SHA","shortVersion":"REDACTED-COMMIT-SHA","ref":null}],"author":{"username":"REDACTED","lastLogin":"2020-10-22T20:49:30.075451Z","isSuperuser":false,"isManaged":false,"experiments":{},"lastActive":"2020-10-22T22:29:53.623386Z","isStaff":false,"id":"3","isActive":true,"has2fa":false,"name":"READACTED","avatarUrl":"READACTED","dateJoined":"2020-09-16T15:10:23.953139Z","emails":[{"is_verified":true,"id":"3","email":"[MASKED]"}],"avatar":{"avatarUuid":"REACTED","avatarType":"upload"},"hasPasswordAuth":false,"email":"[MASKED]"},"dateCreated":"2020-10-23T16:05:31Z","message":"Update readme","id":"REDACTED-COMMIT-SHA"},"shortVersion":"REDACTED-COMMIT-SHA","authors":[{"username":"REDACTED","lastLogin":"2020-10-22T20:49:30.075451Z","isSuperuser":false,"isManaged":false,"experiments":{},"lastActive":"2020-10-22T22:29:53.623386Z","isStaff":false,"id":"3","isActive":true,"has2fa":false,"name":"READACTED","avatarUrl":"READACTED","dateJoined":"2020-09-16T15:10:23.953139Z","emails":[{"is_verified":true,"id":"3","email":"[MASKED]"}],"avatar":{"avatarUuid":"REACTED","avatarType":"upload"},"hasPasswordAuth":false,"email":"[MASKED]"}],"owner":null,"versionInfo":{"buildHash":"REDACTED-COMMIT-SHA","version":{"raw":"REDACTED-COMMIT-SHA"},"description":"857dc5c6f170","package":null},"ref":null,"projects":[{"name":"REDACTED-PROJECT","platform":"javascript-react","slug":"REDACTED-PROJECT","platforms":[],"newGroups":0,"id":2}]}
  DEBUG   2020-10-23 16:44:34.200573235 +00:00 body: {"dateReleased":null,"newGroups":0,"commitCount":3,"url":null,"data":{},"lastDeploy":null,"deployCount":0,"dateCreated":"2020-10-23T16:10:35.660712Z","lastEvent":null,"version":"REDACTED-COMMIT-SHA","firstEvent":null,"lastCommit":{"repository":{"status":"active","integrationId":"3","externalSlug":264,"name":"REDACTED-PROJECT","provider":{"id":"integrations:gitlab","name":"Gitlab"},"url":"https://REDACTED-GIT-HOST/REACTED-TEAM/REDACTED-PROJECT","id":"3","dateCreated":"2020-09-16T18:39:45.202813Z"},"releases":[{"dateReleased":null,"url":null,"dateCreated":"2020-10-23T16:10:35.660712Z","version":"REDACTED-COMMIT-SHA","shortVersion":"REDACTED-COMMIT-SHA","ref":null}],"author":{"username":"REDACTED","lastLogin":"2020-10-22T20:49:30.075451Z","isSuperuser":false,"isManaged":false,"experiments":{},"lastActive":"2020-10-22T22:29:53.623386Z","isStaff":false,"id":"3","isActive":true,"has2fa":false,"name":"REDACTED","avatarUrl":"READACTED","dateJoined":"2020-09-16T15:10:23.953139Z","emails":[{"is_verified":true,"id":"3","email":"[MASKED]"}],"avatar":{"avatarUuid":"REACTED","avatarType":"upload"},"hasPasswordAuth":false,"email":"[MASKED]"},"dateCreated":"2020-10-23T16:05:31Z","message":"Update readme","id":"REDACTED-COMMIT-SHA"},"shortVersion":"REDACTED-COMMIT-SHA","authors":[{"username":"REDACTED","lastLogin":"2020-10-22T20:49:30.075451Z","isSuperuser":false,"isManaged":false,"experiments":{},"lastActive":"2020-10-22T22:29:53.623386Z","isStaff":false,"id":"3","isActive":true,"has2fa":false,"name":"REDACTED","avatarUrl":"READACTED","dateJoined":"2020-09-16T15:10:23.953139Z","emails":[{"is_verified":true,"id":"3","email":"[MASKED]"}],"avatar":{"avatarUuid":"REACTED","avatarType":"upload"},"hasPasswordAuth":false,"email":"[MASKED]"}],"owner":null,"versionInfo":{"buildHash":"REDACTED-COMMIT-SHA","version":{"raw":"REDACTED-COMMIT-SHA"},"description":"857dc5c6f170","package":null},"ref":null,"projects":[{"name":"REDACTED-PROJECT","platform":"javascript-react","slug":"REDACTED-PROJECT","platforms":[],"newGroups":0,"id":2}]}
  DEBUG   2020-10-23 16:44:34.206377479 +00:00 request GET https://REDACTED-SENTRY-INSTANCE.tld/api/0/organizations/REDACTED-ORGANIZATION/chunk-upload/
  DEBUG   2020-10-23 16:44:34.206400366 +00:00 using token authentication
  DEBUG   2020-10-23 16:44:34.206408790 +00:00 retry number 0, max retries: 0
  DEBUG   2020-10-23 16:44:34.206519266 +00:00 > GET /api/0/organizations/REDACTED-ORGANIZATION/chunk-upload/ HTTP/1.1
  DEBUG   2020-10-23 16:44:34.206533536 +00:00 > Host: REDACTED-SENTRY-INSTANCE.tld
  DEBUG   2020-10-23 16:44:34.206539636 +00:00 > Accept: */*
  DEBUG   2020-10-23 16:44:34.206544512 +00:00 > Connection: TE
  DEBUG   2020-10-23 16:44:34.206549257 +00:00 > TE: gzip
  DEBUG   2020-10-23 16:44:34.206554119 +00:00 > User-Agent: sentry-cli/1.58.0
  DEBUG   2020-10-23 16:44:34.206577152 +00:00 > Authorization: Bearer 18243fd2***
  DEBUG   2020-10-23 16:44:34.285333409 +00:00 < HTTP/1.1 200 OK
  DEBUG   2020-10-23 16:44:34.285350329 +00:00 < Date: Fri, 23 Oct 2020 16:44:34 GMT
  DEBUG   2020-10-23 16:44:34.285356840 +00:00 < Content-Type: application/json
  DEBUG   2020-10-23 16:44:34.285362809 +00:00 < Content-Length: 297
  DEBUG   2020-10-23 16:44:34.285368806 +00:00 < Connection: keep-alive
  DEBUG   2020-10-23 16:44:34.285374585 +00:00 < Server: openresty/1.15.8.2
  DEBUG   2020-10-23 16:44:34.285380078 +00:00 < Vary: Accept-Encoding
  DEBUG   2020-10-23 16:44:34.285387018 +00:00 < Access-Control-Allow-Headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization
  DEBUG   2020-10-23 16:44:34.285395741 +00:00 < X-Content-Type-Options: nosniff
  DEBUG   2020-10-23 16:44:34.285401758 +00:00 < Content-Language: en
  DEBUG   2020-10-23 16:44:34.285407362 +00:00 < Access-Control-Expose-Headers: X-Sentry-Error, Retry-After
  DEBUG   2020-10-23 16:44:34.285414640 +00:00 < Vary: Accept-Language, Cookie
  DEBUG   2020-10-23 16:44:34.285421702 +00:00 < X-XSS-Protection: 1; mode=block
  DEBUG   2020-10-23 16:44:34.285430805 +00:00 < Allow: GET, POST, HEAD, OPTIONS
  DEBUG   2020-10-23 16:44:34.285438419 +00:00 < Access-Control-Allow-Origin: *
  DEBUG   2020-10-23 16:44:34.285445932 +00:00 < Access-Control-Allow-Methods: PUT,GET,POST,OPTIONS
  DEBUG   2020-10-23 16:44:34.285452916 +00:00 < X-Frame-Options: deny
  DEBUG   2020-10-23 16:44:34.285461263 +00:00 < Access-Control-Allow-Credentials: true
  DEBUG   2020-10-23 16:44:34.285483643 +00:00 response status: 200
  DEBUG   2020-10-23 16:44:34.285494309 +00:00 body: {"maxFileSize":2147483648,"hashAlgorithm":"sha1","concurrency":8,"chunkSize":8388608,"maxRequestSize":33554432,"url":"https://REDACTED-SENTRY-INSTANCE.tld/api/0/organizations/REDACTED-ORGANIZATION/chunk-upload/","chunksPerRequest":64,"accept":["debug_files","release_files","pdbs","sources"],"compression":["gzip"]}
> Bundled 85 files for upload
> Uploaded release files to Sentry

Any idea why artifacts are not being uploaded AND why the CLI doesn’t throw an error?

The self-hosted Sentry instance is version 20.8.0 (17e488c) and is running on kubernetes.

Hi @htunnicliff, sorry for the late response.

CLI is not throwing an error as the server returns HTTP 208 which means success. If these are large they may be stuck in processing. It may also be due to some file storage issue so the best way to diagnose is to get some server side logs when you try to upload artifacts. Nginx and Sentry Web logs would be most useful but no harm in getting other service logs too.