Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 7zip causes decompress permission errors #4647

Open
quotidian-ennui opened this issue Nov 26, 2021 · 23 comments
Open

[Bug] 7zip causes decompress permission errors #4647

quotidian-ennui opened this issue Nov 26, 2021 · 23 comments
Labels
upstream The problem is with the download, not scoop

Comments

@quotidian-ennui
Copy link
Contributor

quotidian-ennui commented Nov 26, 2021

Steps to reproduce

I think this is related to ScoopInstaller/Extras#7310

If you install/update 7zip to 21.06 then gcloud doesn't install properly (365.0.1 or 365.0.0). It fails to unzip the file properly.

PS C:\Users\MyUserName> scoop install 7zip
WARN  Scoop uses 'aria2c' for multi-connection downloads.
WARN  Should it cause issues, run 'scoop config aria2-enabled false' to disable it.
WARN  To disable this warning, run 'scoop config aria2-warning-enabled false'.
Installing '7zip' (21.06) [64bit]
Starting download with aria2 ...
Download: Download Results:
Download: gid   |stat|avg speed  |path/URI
Download: ======+====+===========+=======================================================
Download: e9fcf2|OK  |    32KiB/s|C:/Users/MyUserName/scoop/cache/7zip#21.06#https_raw.githubusercontent.com_ScoopInstaller_Main_master_scripts_7-zip_uninstall-context.reg
Download: 89d45b|OK  |        n/a|C:/Users/MyUserName/scoop/cache/7zip#21.06#https_raw.githubusercontent.com_ScoopInstaller_Main_master_scripts_7-zip_install-context.reg
Download: 4f1361|OK  |   5.0MiB/s|C:/Users/MyUserName/scoop/cache/7zip#21.06#https_7-zip.org_a_7z2106-x64.msi
Download: Status Legend:
Download: (OK):download completed.
Checking hash of 7z2106-x64.msi ... ok.
Checking hash of install-context.reg ... ok.
Checking hash of uninstall-context.reg ... ok.
Extracting 7z2106-x64.msi ... done.
Running pre-install script...
Linking ~\scoop\apps\7zip\current => ~\scoop\apps\7zip\21.06
Creating shim for '7z'.
Creating shortcut for 7-Zip (7zFM.exe)
Persisting Codecs
Persisting Formats
'7zip' (21.06) was installed successfully!
Notes
-----
Add 7-Zip as a context menu option by running: "C:\Users\MyUserName\scoop\apps\7zip\current\install-context.reg"
PS C:\Users\MyUserName> scoop install gcloud
WARN  Scoop uses 'aria2c' for multi-connection downloads.
WARN  Should it cause issues, run 'scoop config aria2-enabled false' to disable it.
WARN  To disable this warning, run 'scoop config aria2-warning-enabled false'.
Installing 'gcloud' (365.0.1) [64bit]
Starting download with aria2 ...
Download: Download Results:
Download: gid   |stat|avg speed  |path/URI
Download: ======+====+===========+=======================================================
Download: 820255|OK  |   7.9MiB/s|C:/Users/MyUserName/scoop/cache/gcloud#365.0.1#https_dl.google.com_dl_cloudsdk_channels_rapid_downloads_google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip
Download: Status Legend:
Download: (OK):download completed.
Checking hash of google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip ... ok.
Extracting google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip ... ERROR Exit code was 2!
Failed to extract files from C:\Users\MyUserName\scoop\apps\gcloud\365.0.1\google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip.
Log file:
  ~\scoop\apps\gcloud\365.0.1\7zip.log

Please try again or create a new issue by using the following link and paste your console output:
https://github.com/lukesampson/scoop-extras/issues/new?title=gcloud%40365.0.1%3a+decompress+error

The 7zip.log file contains

PS C:\Users\MyUserName> type  ~\scoop\apps\gcloud\365.0.1\7zip.log

7-Zip 21.06 (x64) : Copyright (c) 1999-2021 Igor Pavlov : 2021-11-24

Scanning the drive for archives:
1 file, 146151332 bytes (140 MiB)

Extracting archive: C:\Users\MyUserName\scoop\apps\gcloud\365.0.1\google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip
--
Path = C:\Users\MyUserName\scoop\apps\gcloud\365.0.1\google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip
Type = zip
Physical Size = 146151332


Sub items Errors: 4

Archives with Errors: 1

Sub items Errors: 4

Workaround

Downgrading to 7zip 19.00 appears to work with gcloud 365.0.1 and 365.0.0; so I'm not sure which of the packages is actually showing up the exception.

I chose 7zip 19.00 as this was the last version I had installed (not for any other reason) before updating to 21.06

This sequence of steps works :

scoop uninstall gcloud 7zip
scoop install [email protected]
scoop install gcloud

EDIT: Enabling developer mode is also viable as a workaround, if you have that choice : #4647 (comment) / #4647 (comment)

It also appears to be the case that scoop may now install the 7zip19.00-helper in some situations to mitigate this problem (it depends on the application manifest in question).

@rashil2000
Copy link
Member

I just upgraded 7zip to 21.06, but gcloud installs fine for me.

Installing 'gcloud' (365.0.1) [64bit]
Loading google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip from cache
Checking hash of google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip ... ok.
Extracting google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip ... done.
Linking ~\scoop\apps\gcloud\current => ~\scoop\apps\gcloud\365.0.1
Creating shim for 'gcloud'.
Creating shim for 'gsutil'.
Creating shim for 'bq'.
Creating shim for 'docker-credential-gcloud'.
Creating shim for 'git-credential-gcloud'.
'gcloud' (365.0.1) was installed successfully!
Notes
-----
To initialize Cloud SDK, you will need to run: 'gcloud init'

@HUMORCE
Copy link
Member

HUMORCE commented Nov 26, 2021

reproduced with main/[email protected] and versions/[email protected]

PS C:\Users\HUMOR> scoop list 7zip
Installed apps matching '7zip':

  7zip 21.06 [main]
  7zip-zstd v21.03-v1.5.0-R2 [versions]

PS C:\Users\HUMOR> scoop reset 7zip
Resetting 7zip (21.06).
Linking ~\scoop\apps\7zip\current => ~\scoop\apps\7zip\21.06
Creating shim for '7z'.
Creating shortcut for 7-Zip (7zFM.exe)
Persisting Codecs
Persisting Formats
PS C:\Users\HUMOR> scoop install gcloud
WARN  Purging previous failed installation of gcloud.
Uninstalling 'gcloud' ().
'gcloud' was uninstalled.
Installing 'gcloud' (365.0.1) [64bit]
Loading google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip from cache
Checking hash of google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip ... ok.
Extracting google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip ... ERROR Exit code was 2!
Failed to extract files from C:\Users\HUMOR\scoop\apps\gcloud\365.0.1\google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip.
Log file:
  ~\scoop\apps\gcloud\365.0.1\7zip.log

Please try again or create a new issue by using the following link and paste your console output:
https://github.com/ScoopInstaller/Extras/issues/new?title=gcloud%40365.0.1%3a+decompress+error
PS C:\Users\HUMOR> cat ~\scoop\apps\gcloud\365.0.1\7zip.log

7-Zip 21.06 (x64) : Copyright (c) 1999-2021 Igor Pavlov : 2021-11-24

Scanning the drive for archives:
1 file, 146151332 bytes (140 MiB)

Extracting archive: C:\Users\HUMOR\scoop\apps\gcloud\365.0.1\google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip
--
Path = C:\Users\HUMOR\scoop\apps\gcloud\365.0.1\google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip
Type = zip
Physical Size = 146151332


Sub items Errors: 4

Archives with Errors: 1

Sub items Errors: 4
PS C:\Users\HUMOR> scoop reset 7zip-zstd
Resetting 7zip-zstd (v21.03-v1.5.0-R2).
Linking ~\scoop\apps\7zip-zstd\current => ~\scoop\apps\7zip-zstd\v21.03-v1.5.0-R2
Creating shim for '7z'.
WARN  Overwriting shim to 7z.exe installed from 7zip
Creating shim for '7zG'.
Creating shortcut for 7-Zip (7zFM.exe)
PS C:\Users\HUMOR> scoop install gcloud
WARN  Purging previous failed installation of gcloud.
Uninstalling 'gcloud' ().
'gcloud' was uninstalled.
Installing 'gcloud' (365.0.1) [64bit]
Loading google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip from cache
Checking hash of google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip ... ok.
Extracting google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip ... ERROR Exit code was 2!
Failed to extract files from C:\Users\HUMOR\scoop\apps\gcloud\365.0.1\google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip.
Log file:
  ~\scoop\apps\gcloud\365.0.1\7zip.log

Please try again or create a new issue by using the following link and paste your console output:
https://github.com/ScoopInstaller/Extras/issues/new?title=gcloud%40365.0.1%3a+decompress+error
PS C:\Users\HUMOR> cat ~\scoop\apps\gcloud\365.0.1\7zip.log

7-Zip 21.06 (x64) : Copyright (c) 1999-2021 Igor Pavlov : 2021-11-24

Scanning the drive for archives:
1 file, 146151332 bytes (140 MiB)

Extracting archive: C:\Users\HUMOR\scoop\apps\gcloud\365.0.1\google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip
--
Path = C:\Users\HUMOR\scoop\apps\gcloud\365.0.1\google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip
Type = zip
Physical Size = 146151332


Sub items Errors: 4

Archives with Errors: 1

Sub items Errors: 4

### SCOOP'S BUG, TEMPORARY UNINSTALL `main/7zip`
PS C:\Users\HUMOR> scoop uninstall 7zip
Uninstalling '7zip' (21.06).
Removing shim for '7z'.
Removing shortcut ~\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Scoop Apps\7-Zip.lnk
Unlinking ~\scoop\apps\7zip\current
'7zip' was uninstalled.
PS C:\Users\HUMOR> scoop reset 7zip-zstd
Resetting 7zip-zstd (v21.03-v1.5.0-R2).
Linking ~\scoop\apps\7zip-zstd\current => ~\scoop\apps\7zip-zstd\v21.03-v1.5.0-R2
Creating shim for '7z'.
Creating shim for '7zG'.
Creating shortcut for 7-Zip (7zFM.exe)
PS C:\Users\HUMOR> scoop install gcloud
WARN  Purging previous failed installation of gcloud.
Uninstalling 'gcloud' ().
'gcloud' was uninstalled.
Installing 'gcloud' (365.0.1) [64bit]
Loading google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip from cache
Checking hash of google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip ... ok.
Extracting google-cloud-sdk-365.0.1-windows-x86_64-bundled-python.zip ...
### STUCK HERE MORE THAN 10 MINS (FOREVERY?)

with 7zip:
7zip

with 7zip-zstd:
7zip-zstd

update:
screenshot_20211126213144

@chynes-re
Copy link

Also seeing this bug using the latest versions of 7zip and gcloud available through scoop.

@glever
Copy link

glever commented Dec 8, 2021

Had the same issue for gcloud-366.
Used minor altered version of @quotidian-ennui 's fix :

scoop uninstall 7zip
scoop install [email protected]
scoop update gcloud

Thanks!

@pcgeek86
Copy link

pcgeek86 commented Dec 9, 2021

I'm having the same problem with gcloud version 366.

7-Zip 21.06 (x64) : Copyright (c) 1999-2021 Igor Pavlov : 2021-11-24

Scanning the drive for archives:
1 file, 146611955 bytes (140 MiB)

Extracting archive: C:\Users\TrevorSullivan\scoop\apps\gcloud\366.0.0\google-cloud-sdk-366.0.0-windows-x86_64-bundled-python.zip
--
Path = C:\Users\TrevorSullivan\scoop\apps\gcloud\366.0.0\google-cloud-sdk-366.0.0-windows-x86_64-bundled-python.zip
Type = zip
Physical Size = 146611955


Sub items Errors: 4

Archives with Errors: 1

Sub items Errors: 4

@ViCrack
Copy link

ViCrack commented Dec 10, 2021

@pcgeek86
Maybe it'll help you

#4569

@rashil2000 rashil2000 transferred this issue from ScoopInstaller/Extras Jan 12, 2022
@rashil2000
Copy link
Member

From @peterleif in ScoopInstaller/Main#3042:

I changed SCOOP_BRANCH to develop and now I can see the error message from 7-zip.

7-Zip 21.06 (x64) : Copyright (c) 1999-2021 Igor Pavlov : 2021-11-24

Scanning the drive for archives:
1 file, 190207 bytes (186 KiB)

Extracting archive: C:\Users\peter\scoop\apps\git-filter-repo\2.34.0\v2.34.0.zip
--
Path = C:\Users\peter\scoop\apps\git-filter-repo\2.34.0\v2.34.0.zip
Type = zip
Physical Size = 190207
Comment = 235fed326910a90b3322bc535d643a9003f8d7e1


Sub items Errors: 2

Archives with Errors: 1

Sub items Errors: 2

ERROR: Cannot create symbolic link : クライアントは要求された特権を保有していません。 : C:\Users\peter\scoop\apps\git-filter-repo\2.34.0\git-filter-repo-2.34.0\contrib\filter-repo-demos\filter-branch-ish
ERROR: Cannot create symbolic link : クライアントは要求された特権を保有していません。 : C:\Users\peter\scoop\apps\git-filter-repo\2.34.0\git-filter-repo-2.34.0\git_filter_repo.py

The error message is Japanese (I'm using Japanese environment), which says "The client does not have the requested permission." It seems that 7-zip tries to decompress symbolic link as symbolic link even on Windows (system decompressor decompresses it as a text file).

@rashil2000
Copy link
Member

From @zoof in ScoopInstaller/Extras#7310:

geany is not installing correctly on my setup. I have lessmsi installed and the system 7zip installed. The installation fails with Extracting dl.7z ... ERROR Exit code was 2!. Going into the installation folder and manually extracting dl.7z, 7z is tripping up on a single file: ERROR: Can not open output file : Access is denied. : .\data\filedefs\filetypes.abc.

@rashil2000 rashil2000 changed the title 7zip 21.06 causes [email protected]: decompress error [Bug] 7zip causes decompress permission errors Jan 12, 2022
@peterleif
Copy link

As I wrote in ScoopInstaller/Main#3042 I suspect that 7zip recently changed the handling of symbolic link (and other kinds of special files?) and it causes issues on some Windows environments (where symbolic link creation by a normal user is prohibited).

@peterleif
Copy link

Downgrading 7zip to 19.00 solved ScoopInstaller/Main#3042.

@peterleif
Copy link

I think 7zip team needs to fix this issue, but simple workaround here is to show message to suggest changing windows settings like this (I've not tested this article)?
https://community.perforce.com/s/article/3472

@rashil2000
Copy link
Member

Downgrading 7zip to 19.00 solved ScoopInstaller/Main#3042.

Seems like it's the only workaround for now.

I think 7zip team needs to fix this issue, but simple workaround here is to show message to suggest changing windows settings like this (I've not tested this article)? https://community.perforce.com/s/article/3472

The instructions here are for Win 7 and 8. For Windows 10, 11, you can just enable Developer Mode in the Settings.

@niheaven
Copy link
Member

niheaven commented Jan 12, 2022

I test geany and git-filter-repo and they can be both extracted in PS5 and PS7... 'cos that, I've no idea what cause this bug.

And also, after checking 7-zip's history.txt, there isn't something that related to Windows system permission.

@peterleif
Copy link

@rashil2000 Thanks for the information. I switched to developer mode and now I can install git-filter-repo using the latest 7-zip.

@niheaven Maybe you are running windows with the developer mode enabled.

@rdbisme
Copy link

rdbisme commented Jan 12, 2022

I can't switch to developer mode because... Rights.

(and that's the reason why I use scoop to install things locally to my account)

Has an issue been raised on 7zip?

@rashil2000
Copy link
Member

7zip was updated to 22.00. Does this issue still occur?

@peterleif
Copy link

Yes, the problem is not solved. Situation is the same.

@urwrstkn8mare
Copy link

If this helps anyone it wouldn't let me to downgrade to 19.00 (scoop uninstall 7zip; scoop update; scoop install [email protected])
Instead install 7zip beta worked: scoop bucket add versions; scoop install 7zip-beta

@YauHsien
Copy link

YauHsien commented Nov 7, 2022

I'm fighting this issue on PowerShell 5.1 with old 7zip v22.x setting .

@menguele
Copy link

If this helps anyone it wouldn't let me to downgrade to 19.00 (scoop uninstall 7zip; scoop update; scoop install [email protected]) Instead install 7zip beta worked: scoop bucket add versions; scoop install 7zip-beta

7zip-beta still gives me error, also I cant downgrade to 19.00:
`scoop install [email protected]
WARN Given version (19.00) does not match manifest (22.01)
WARN Attempting to generate manifest for '7zip' (19.00)
Autoupdating 7zip
Downloading 7z1900.msi to compute hashes!
Loading 7z1900.msi from cache
Computed hash: b49d55a52bc0eab14947c8982c413d9be141c337da1368a24aa0484cbb5e89cd
Downloading 7z1900-x64.msi to compute hashes!
Loading 7z1900-x64.msi from cache
Computed hash: a7803233eedb6a4b59b3024ccf9292a6fffb94507dc998aa67c5b745d197a5dc
Downloading 7z1900-arm64.exe to compute hashes!
The remote server returned an error: (404) Not Found.
URL https://www.7-zip.org/a/7z1900-arm64.exe is not valid
Could not install [email protected]
Select-CurrentVersion : Cannot bind argument to parameter 'AppName' because it is an empty string.
At B:\scoop\apps\scoop\current\lib\core.ps1:239 char:54

  • return $null -ne (Select-CurrentVersion -AppName $app -Global:$gl ...
    
  •                                                  ~~~~
    
    • CategoryInfo : InvalidData: (:) [Select-CurrentVersion], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Select-CurrentVersion

You cannot call a method on a null-valued expression.
At B:\scoop\apps\scoop\current\lib\manifest.ps1:36 char:5

  • $app = $app.TrimStart('/')
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull`

@quotidian-ennui
Copy link
Contributor Author

The remote server returned an error: (404) Not Found. URL https://www.7-zip.org/a/7z1900-arm64.exe is not valid.

arm64 is the clue here for why you can't downgrade.

7zip-19 dates from before arm64 versions of windows, so that's why you can't downgrade; developer mode is the other accepted work-around, your mileage may vary with that, but I always turn on developer mode now.

@the-nurk

This comment was marked as abuse.

@fgimian
Copy link

fgimian commented May 11, 2024

Just wanted to add some info. 7-Zip 19.00 actually succeeds because it's not creating a symbolic link for the two files affected upon extraction. Instead it just creates a plain text file whose contents is the symlink target.

Thus technically, newer versions of 7-Zip are actually doing the right thing. The problem really is that Windows doesn't allow non-admins to create symbolic links unless Developer Mode is enabled.

The only solution I can suggest is that the Scoop package is updated to skip extraction of the two symlinks.

  • contrib\filter-repo-demos\filter-branch-ish (which symlinks to filter-lamely)
  • git_filter_repo.py (which symlinks to git-filter-repo which is the main executable Python script used by the tool)

The symlinks really are not needed and appear to be there moreso for backwards compatibility for those using the old commands.

Cheers
Fotis

amorphobia added a commit to amorphobia/ScoopSources that referenced this issue Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream The problem is with the download, not scoop
Projects
None yet
Development

No branches or pull requests