sentry-cli icon indicating copy to clipboard operation
sentry-cli copied to clipboard

Sentry-cli update always asks for elevated permissions

Open Nefarion opened this issue 1 year ago • 4 comments

Environment

What version of the CLI and what OS are you running? CLI: 2.20.6, OS: Windows 10 and Windows Server 2019

Steps to Reproduce

Run sentry-cli.exe update in a folder where the executing user has full permissions

Expected/Actual Result

Expected: Sentry-cli should update without elevation prompt.

Actual: Sentry-cli prompts for admin access, which is a huge problem in containers, because you cannot confirm the prompt, so the process hangs indefinitely. Also, it outputs Updated to 2.21.1! even though the prompt was cancelled!

Logs

PS C:\Users\<UserName>\Downloads> .\sentry-cli.exe update --log-level debug
  DEBUG   2023-09-26 19:37:59.683917800 +02:00 sentry-cli version: 2.20.6, platform: "windows", architecture: "x86_64"
  INFO    2023-09-26 19:37:59.684315700 +02:00 sentry-cli was invoked with the following command line: "C:\Users\<UserName>\Downloads\sentry-cli.exe" "update" "--log-level" "debug"
  DEBUG   2023-09-26 19:37:59.684679900 +02:00 request GET https://release-registry.services.sentry.io/apps/sentry-cli/latest
  DEBUG   2023-09-26 19:37:59.684740 +02:00 retry number 0, max retries: 0
  DEBUG   2023-09-26 19:37:59.745256500 +02:00 > GET /apps/sentry-cli/latest HTTP/1.1
  DEBUG   2023-09-26 19:37:59.745350 +02:00 > Host: release-registry.services.sentry.io
  DEBUG   2023-09-26 19:37:59.745399500 +02:00 > Accept: */*
  DEBUG   2023-09-26 19:37:59.745444300 +02:00 > Connection: TE
  DEBUG   2023-09-26 19:37:59.745488400 +02:00 > TE: gzip
  DEBUG   2023-09-26 19:37:59.745535400 +02:00 > User-Agent: sentry-cli/2.20.6
  DEBUG   2023-09-26 19:37:59.880629100 +02:00 < HTTP/1.1 200 OK
  DEBUG   2023-09-26 19:37:59.880794200 +02:00 < content-type: application/json
  DEBUG   2023-09-26 19:37:59.880867200 +02:00 < content-length: 7978
  DEBUG   2023-09-26 19:37:59.880917 +02:00 < access-control-allow-origin: *
  DEBUG   2023-09-26 19:37:59.880966100 +02:00 < x-from-cache: 1
  DEBUG   2023-09-26 19:37:59.881009900 +02:00 < x-envoy-upstream-service-time: 1
  DEBUG   2023-09-26 19:37:59.881074400 +02:00 < date: Tue, 26 Sep 2023 17:37:59 GMT
  DEBUG   2023-09-26 19:37:59.881124800 +02:00 < server: envoy
  DEBUG   2023-09-26 19:37:59.881170 +02:00 < Via: 1.1 google
  DEBUG   2023-09-26 19:37:59.881242100 +02:00 < Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
  DEBUG   2023-09-26 19:37:59.885455600 +02:00 response status: 200
  INFO    2023-09-26 19:37:59.885579700 +02:00 Looking for file named: sentry-cli-Windows-x86_64.exe
  DEBUG   2023-09-26 19:37:59.885683900 +02:00 body: {"canonical":"app:sentry-cli","file_urls":{"sentry-cli-2.21.1.tgz":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-2.21.1.tgz","sentry-cli-Darwin-arm64":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-Darwin-arm64","sentry-cli-Darwin-universal":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-Darwin-universal","sentry-cli-Darwin-x86_64":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-Darwin-x86_64","sentry-cli-Linux-aarch64":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-Linux-aarch64","sentry-cli-Linux-armv7":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-Linux-armv7","sentry-cli-Linux-i686":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-Linux-i686","sentry-cli-Linux-x86_64":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-Linux-x86_64","sentry-cli-Windows-i686.exe":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-Windows-i686.exe","sentry-cli-Windows-x86_64.exe":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-Windows-x86_64.exe","sentry_cli-2.21.1-py3-none-macosx_10_15_x86_64.whl":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1-py3-none-macosx_10_15_x86_64.whl","sentry_cli-2.21.1-py3-none-macosx_11_0_arm64.whl":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1-py3-none-macosx_11_0_arm64.whl","sentry_cli-2.21.1-py3-none-macosx_11_0_universal2.whl":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1-py3-none-macosx_11_0_universal2.whl","sentry_cli-2.21.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_2_aarch64.whl":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_2_aarch64.whl","sentry_cli-2.21.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_2_armv7l.whl":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_2_armv7l.whl","sentry_cli-2.21.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.musllinux_1_2_i686.whl":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.musllinux_1_2_i686.whl","sentry_cli-2.21.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_2_x86_64.whl":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_2_x86_64.whl","sentry_cli-2.21.1-py3-none-win32.whl":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1-py3-none-win32.whl","sentry_cli-2.21.1-py3-none-win_amd64.whl":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1-py3-none-win_amd64.whl","sentry_cli-2.21.1.tar.gz":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1.tar.gz"},"files":{"sentry-cli-2.21.1.tgz":{"checksums":{"sha256-hex":"849b3eb872ccdb6de86621887e45880395e6b0e0316faf07f19cb46ad3c1afd6"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-2.21.1.tgz"},"sentry-cli-Darwin-arm64":{"checksums":{"sha256-hex":"14873f24b9b35b5fa164899e35461d296c54910c149834495fc09890aad3e476"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-Darwin-arm64"},"sentry-cli-Darwin-universal":{"checksums":{"sha256-hex":"b3fa785eb951a1baa19c5eadff88f62294249e34f57bc3ca619e6ed3fcc191d8"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-Darwin-universal"},"sentry-cli-Darwin-x86_64":{"checksums":{"sha256-hex":"52fb15bfb2d90fc279ae8aee2fb4adf91a93e8b56fe3969d907045c08927e03e"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-Darwin-x86_64"},"sentry-cli-Linux-aarch64":{"checksums":{"sha256-hex":"14a0085f8008313a27b89332682d81a61621d7d368c76c93c46c5f01b34ee441"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-Linux-aarch64"},"sentry-cli-Linux-armv7":{"checksums":{"sha256-hex":"6363f60fbad5204abc7f70f7ca82c857c9b3c0ecde073fb5f89b23f3c808fcad"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-Linux-armv7"},"sentry-cli-Linux-i686":{"checksums":{"sha256-hex":"f30d67893c9eb7b193658fb7cf2f066aa9c44af37d0c9ad4f2fd885b2abe5a1b"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-Linux-i686"},"sentry-cli-Linux-x86_64":{"checksums":{"sha256-hex":"dbdd719481867f55072c7769d04ad3f70dda648ef406b87f613722d09a0ec625"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-Linux-x86_64"},"sentry-cli-Windows-i686.exe":{"checksums":{"sha256-hex":"d2a3ea8c7ecdaddd8cf5fb8da09667b647a926870a6c172f42a7686cd71abdaf"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-Windows-i686.exe"},"sentry-cli-Windows-x86_64.exe":{"checksums":{"sha256-hex":"f0fcd76905e8f0f06a7d8c35d667a485fefd88495cdc1ac0603c99e6c39e9b98"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-Windows-x86_64.exe"},"sentry_cli-2.21.1-py3-none-macosx_10_15_x86_64.whl":{"checksums":{"sha256-hex":"775f57e90c2c0b99f09c5fa9381168bac5d34ccbbc45f6e4ad02d1123d83ff9d"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1-py3-none-macosx_10_15_x86_64.whl"},"sentry_cli-2.21.1-py3-none-macosx_11_0_arm64.whl":{"checksums":{"sha256-hex":"4294f3e53f7748935f346ec1a6f6e120d3e37e90f417c02ee12b0167228164f3"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1-py3-none-macosx_11_0_arm64.whl"},"sentry_cli-2.21.1-py3-none-macosx_11_0_universal2.whl":{"checksums":{"sha256-hex":"0469a6136adc746a9acdebeb2238d4a26898d78cf1a22415e97ebf1514b42481"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1-py3-none-macosx_11_0_universal2.whl"},"sentry_cli-2.21.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_2_aarch64.whl":{"checksums":{"sha256-hex":"485b7fc711c0d459b4dbe6c3208cfe58e3efd11f0f90a13020eeb48163a33c59"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_2_aarch64.whl"},"sentry_cli-2.21.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_2_armv7l.whl":{"checksums":{"sha256-hex":"969dec9fd6ecbc541bc0cd220a4a2980b767cd2c27a653c2b691ab739d28f604"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_2_armv7l.whl"},"sentry_cli-2.21.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.musllinux_1_2_i686.whl":{"checksums":{"sha256-hex":"7661d1c20187faef4312e6be1e5d305330e6f3de8a2645167cf47caf592c97a4"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.musllinux_1_2_i686.whl"},"sentry_cli-2.21.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_2_x86_64.whl":{"checksums":{"sha256-hex":"9e67ac4912870bfa8001cd397bfa58bc87bdbc5e8e22c1064ae9e302ca30c289"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_2_x86_64.whl"},"sentry_cli-2.21.1-py3-none-win32.whl":{"checksums":{"sha256-hex":"80617faa53b5bda535d0cffeabccc354d3267c714c10ed69a993ab42b3a95664"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1-py3-none-win32.whl"},"sentry_cli-2.21.1-py3-none-win_amd64.whl":{"checksums":{"sha256-hex":"03cfd8f5d68560188c15f18a033439c1545ee96e4b1886682e5b40ef840e970b"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1-py3-none-win_amd64.whl"},"sentry_cli-2.21.1.tar.gz":{"checksums":{"sha256-hex":"3f3a859b6e2f49339a3827f8ecbfb99ce674a53e72e1871efdaa4bcb172a56b6"},"url":"https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry_cli-2.21.1.tar.gz"}},"main_docs_url":"https://docs.sentry.io/learn/cli","name":"Sentry CLI","repo_url":"https://github.com/getsentry/sentry-cli","version":"2.21.1"}

  INFO    2023-09-26 19:37:59.886484700 +02:00 Found asset sentry_cli-2.21.1.tar.gz
  INFO    2023-09-26 19:37:59.886543300 +02:00 Found asset sentry_cli-2.21.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_2_x86_64.whl
  INFO    2023-09-26 19:37:59.886602300 +02:00 Found asset sentry-cli-Linux-x86_64
  INFO    2023-09-26 19:37:59.886688700 +02:00 Found asset sentry-cli-Darwin-universal
  INFO    2023-09-26 19:37:59.886783300 +02:00 Found asset sentry-cli-Linux-aarch64
  INFO    2023-09-26 19:37:59.886878 +02:00 Found asset sentry-cli-Windows-x86_64.exe
Latest release is 2.21.1
Updating executable at C:\Users\<UserName>\Downloads\sentry-cli.exe
  INFO    2023-09-26 19:37:59.887239300 +02:00 expecting elevation for update: true
  DEBUG   2023-09-26 19:37:59.888874 +02:00 request GET https://downloads.sentry-cdn.com/sentry-cli/2.21.1/sentry-cli-Windows-x86_64.exe
  DEBUG   2023-09-26 19:37:59.889011 +02:00 follow redirects: true
  DEBUG   2023-09-26 19:37:59.929425100 +02:00 > GET /sentry-cli/2.21.1/sentry-cli-Windows-x86_64.exe HTTP/1.1
  DEBUG   2023-09-26 19:37:59.929509800 +02:00 > Host: downloads.sentry-cdn.com
  DEBUG   2023-09-26 19:37:59.929562600 +02:00 > Accept: */*
  DEBUG   2023-09-26 19:37:59.929613900 +02:00 > Connection: TE
  DEBUG   2023-09-26 19:37:59.929663700 +02:00 > TE: gzip
  DEBUG   2023-09-26 19:37:59.929714400 +02:00 > User-Agent: sentry-cli/2.20.6
  DEBUG   2023-09-26 19:37:59.940284800 +02:00 < HTTP/1.1 200 OK
  DEBUG   2023-09-26 19:37:59.940415200 +02:00 < Connection: close
  DEBUG   2023-09-26 19:37:59.940500600 +02:00 < Content-Length: 11026432
  DEBUG   2023-09-26 19:37:59.940576600 +02:00 < Expires: Mon, 23 Oct 2023 00:40:23 GMT
  DEBUG   2023-09-26 19:37:59.940650800 +02:00 < Cache-Control: public, max-age=2592000
  DEBUG   2023-09-26 19:37:59.940726300 +02:00 < Last-Modified: Fri, 22 Sep 2023 14:31:42 GMT
  DEBUG   2023-09-26 19:37:59.940800500 +02:00 < Content-Type: application/octet-stream
  DEBUG   2023-09-26 19:37:59.940896300 +02:00 < Accept-Ranges: bytes
  DEBUG   2023-09-26 19:37:59.940962300 +02:00 < Age: 320256
  DEBUG   2023-09-26 19:37:59.941012300 +02:00 < Date: Tue, 26 Sep 2023 17:38:00 GMT
  DEBUG   2023-09-26 19:37:59.941076600 +02:00 < Vary: Accept-Encoding
  DEBUG   2023-09-26 19:37:59.941126800 +02:00 < Access-Control-Allow-Origin: *
  DEBUG   2023-09-26 19:37:59.941180400 +02:00 < Server: Fastly
  DEBUG   2023-09-26 19:37:59.941231100 +02:00 < Strict-Transport-Security: max-age=31536000; includeSubDomains
  DEBUG   2023-09-26 19:38:00.234435300 +02:00 response status: 200
Updated to 2.21.1!

Nefarion avatar Sep 26 '23 17:09 Nefarion

Thank you for the report.

loewenheim avatar Sep 27 '23 06:09 loewenheim

This is caused by the check for whether the executable is writeable not working correctly on Windows.

loewenheim avatar Sep 27 '23 07:09 loewenheim

I opened a new issue for improving the updater. I can't tell you when we'll get around to it.

loewenheim avatar Sep 27 '23 09:09 loewenheim

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Oct 19 '23 00:10 github-actions[bot]