Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcloud update components - permission denied on file ...\kuberun_licenses\LICENSES.txt

Start udating gcloud:

Your current Cloud SDK version is: 321.0.0
You will be upgraded to version: 322.0.0

┌──────────────────────────────────────────────────┐
│        These components will be updated.         │
├──────────────────────────┬────────────┬──────────┤
│           Name           │  Version   │   Size   │
├──────────────────────────┼────────────┼──────────┤
│ Cloud SDK Core Libraries │ 2021.01.05 │ 16.1 MiB │
│ Kuberun                  │      0.0.1 │ 20.6 MiB │
└──────────────────────────┴────────────┴──────────┘

I get error:

╠═ Uninstalling: Cloud SDK Core Libraries                   ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Uninstalling: Kuberun                                    ═╣
ERROR: (gcloud.components.update) Отказано в доступе: [C:\Users\USER_NAME\AppData\Local\Google\ct4j-cloud-sdk\LATEST\google-cloud-sdk.staging\platform\kuberun_licenses\LICENSES.txt]

Ensure you have the permissions to access the file and that the file is not in use.

Env: Win10

  1. i try from IDEA appEngine Plugin.
  2. try from CMD with admin privilegies. with some error

How to update this ? Maybe you can disable Kuberun ? I use only appengine

like image 458
Helloworld Avatar asked Jan 10 '21 15:01

Helloworld


2 Answers

I solved this issue by removing the folder kuberun_licenses from google-cloud-sdk\platform path. Not the one with .staging.

like image 156
Rodrigo Bortolon Avatar answered Nov 09 '22 19:11

Rodrigo Bortolon


It looks like this is a known issue: https://status.cloud.google.com/incident/support/21001

Here is the workaround provided at that link:

Please run the following commands in a PowerShell window:

$gcloudDir = Get-Command gcloud | Select -ExpandProperty "Source" | Split-Path | Split-Path
attrib -r "$gcloudDir\platform\kuberun_licenses*.*" /s
attrib -r "$gcloudDir\lib\kuberun*.*" /s
attrib -r "$gcloudDir..\google-cloud-sdk.staging\platform\kuberun_licenses*.*" /s
attrib -r "$gcloudDir..\google-cloud-sdk.staging\lib\kuberun*.*" /s
Remove-Item "$gcloudDir..\google-cloud-sdk.staging" -Recurse

If any of the commands fail, proceed with running the remaining commands.

After running the PowerShell script, run the following in a regular Command Prompt (not PowerShell):

gcloud components update --version 320.0.0

Please note, after applying this workaround, do not run 'gcloud components update' as this will re-trigger the issue. Please wait until the fix is released before updating components.

like image 34
spencersmall Avatar answered Nov 09 '22 21:11

spencersmall