-
Notifications
You must be signed in to change notification settings - Fork 63
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
Failure to unzip when UNC path in use, leading to package installation failure in pak::pkg_install #745
Comments
Thanks for the report! I assume having a package library at a UNC path work well otherwise? Eg you can install packages with install.packages and you can load them, etc.? |
Hi Gábor,
Yes that is correct! Ordinarily install.packages works just fine over UNC paths. Come to think of it, in the reprexes pak is installed with install.packages, and is successful.
While I cannot produce a reprex with the error over a network path (not having any at home), the issue is the same at work. I used a similar workflow at work, actually, where pak is installed via install.packages and then it takes over from there.
However I suppose I’ve been working with binaries for the most part — I will try to install a source package over a UNC path and see about success that way.
Thank you,
Alec
…________________________________
From: Gábor Csárdi ***@***.***>
Sent: Friday, February 28, 2025 3:08:31 AM
To: r-lib/pak ***@***.***>
Cc: awong234 ***@***.***>; Author ***@***.***>
Subject: Re: [r-lib/pak] Failure to unzip when UNC path in use, leading to package installation failure in pak::pkg_install (Issue #745)
Thanks for the report! I assume having a package library at a UNC path work well otherwise? Eg you can install packages with install.packages and you can load them, etc.?
—
Reply to this email directly, view it on GitHub<#745 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AI62KF6USP4OE6OFAYVCZGL2SAKP7AVCNFSM6AAAAABYBL72FSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOBZHE4TEMJSHA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
[gaborcsardi]gaborcsardi left a comment (r-lib/pak#745)<#745 (comment)>
Thanks for the report! I assume having a package library at a UNC path work well otherwise? Eg you can install packages with install.packages and you can load them, etc.?
—
Reply to this email directly, view it on GitHub<#745 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AI62KF6USP4OE6OFAYVCZGL2SAKP7AVCNFSM6AAAAABYBL72FSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOBZHE4TEMJSHA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
As it turns out, on my work PC installing packages over the network drives with install.packages() fails with either UNC or letter-mounted paths. C: drive works as expected. While curious, this is out of scope for this issue, though.
…________________________________
From: Alec Wong ***@***.***>
Sent: Friday, February 28, 2025 7:39:50 AM
To: r-lib/pak ***@***.***>; r-lib/pak ***@***.***>
Cc: Author ***@***.***>
Subject: Re: [r-lib/pak] Failure to unzip when UNC path in use, leading to package installation failure in pak::pkg_install (Issue #745)
Hi Gábor,
Yes that is correct! Ordinarily install.packages works just fine over UNC paths. Come to think of it, in the reprexes pak is installed with install.packages, and is successful.
While I cannot produce a reprex with the error over a network path (not having any at home), the issue is the same at work. I used a similar workflow at work, actually, where pak is installed via install.packages and then it takes over from there.
However I suppose I’ve been working with binaries for the most part — I will try to install a source package over a UNC path and see about success that way.
Thank you,
Alec
________________________________
From: Gábor Csárdi ***@***.***>
Sent: Friday, February 28, 2025 3:08:31 AM
To: r-lib/pak ***@***.***>
Cc: awong234 ***@***.***>; Author ***@***.***>
Subject: Re: [r-lib/pak] Failure to unzip when UNC path in use, leading to package installation failure in pak::pkg_install (Issue #745)
Thanks for the report! I assume having a package library at a UNC path work well otherwise? Eg you can install packages with install.packages and you can load them, etc.?
—
Reply to this email directly, view it on GitHub<#745 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AI62KF6USP4OE6OFAYVCZGL2SAKP7AVCNFSM6AAAAABYBL72FSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOBZHE4TEMJSHA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
[gaborcsardi]gaborcsardi left a comment (r-lib/pak#745)<#745 (comment)>
Thanks for the report! I assume having a package library at a UNC path work well otherwise? Eg you can install packages with install.packages and you can load them, etc.?
—
Reply to this email directly, view it on GitHub<#745 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AI62KF6USP4OE6OFAYVCZGL2SAKP7AVCNFSM6AAAAABYBL72FSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOBZHE4TEMJSHA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Meant to say, installing *source* package `fs` failed.
…________________________________
From: Alec Wong ***@***.***>
Sent: Friday, February 28, 2025 9:20:10 AM
To: r-lib/pak ***@***.***>; r-lib/pak ***@***.***>
Cc: Author ***@***.***>
Subject: Re: [r-lib/pak] Failure to unzip when UNC path in use, leading to package installation failure in pak::pkg_install (Issue #745)
As it turns out, on my work PC installing packages over the network drives with install.packages() fails with either UNC or letter-mounted paths. C: drive works as expected. While curious, this is out of scope for this issue, though.
________________________________
From: Alec Wong ***@***.***>
Sent: Friday, February 28, 2025 7:39:50 AM
To: r-lib/pak ***@***.***>; r-lib/pak ***@***.***>
Cc: Author ***@***.***>
Subject: Re: [r-lib/pak] Failure to unzip when UNC path in use, leading to package installation failure in pak::pkg_install (Issue #745)
Hi Gábor,
Yes that is correct! Ordinarily install.packages works just fine over UNC paths. Come to think of it, in the reprexes pak is installed with install.packages, and is successful.
While I cannot produce a reprex with the error over a network path (not having any at home), the issue is the same at work. I used a similar workflow at work, actually, where pak is installed via install.packages and then it takes over from there.
However I suppose I’ve been working with binaries for the most part — I will try to install a source package over a UNC path and see about success that way.
Thank you,
Alec
________________________________
From: Gábor Csárdi ***@***.***>
Sent: Friday, February 28, 2025 3:08:31 AM
To: r-lib/pak ***@***.***>
Cc: awong234 ***@***.***>; Author ***@***.***>
Subject: Re: [r-lib/pak] Failure to unzip when UNC path in use, leading to package installation failure in pak::pkg_install (Issue #745)
Thanks for the report! I assume having a package library at a UNC path work well otherwise? Eg you can install packages with install.packages and you can load them, etc.?
—
Reply to this email directly, view it on GitHub<#745 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AI62KF6USP4OE6OFAYVCZGL2SAKP7AVCNFSM6AAAAABYBL72FSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOBZHE4TEMJSHA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
[gaborcsardi]gaborcsardi left a comment (r-lib/pak#745)<#745 (comment)>
Thanks for the report! I assume having a package library at a UNC path work well otherwise? Eg you can install packages with install.packages and you can load them, etc.?
—
Reply to this email directly, view it on GitHub<#745 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AI62KF6USP4OE6OFAYVCZGL2SAKP7AVCNFSM6AAAAABYBL72FSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOBZHE4TEMJSHA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
So installing source packages fails with both dir(system.file(package = "fs"))
packageDescription("fs", lib.loc = .libPaths()[1]) |
That is correct. Another head-scratcher is that, in my work environment, pak succeeds both binary and source installation when using the letter-based libpath (in particular, when the _working directory_ is also a letter path). But utils fails….
Anyway I don’t want to sidetrack the discussion too much with these issues if they’re not related and if they’re specific to our setup, I know these observations are quite vague.
…________________________________
From: Gábor Csárdi ***@***.***>
Sent: Friday, February 28, 2025 9:25:50 AM
To: r-lib/pak ***@***.***>
Cc: awong234 ***@***.***>; Author ***@***.***>
Subject: Re: [r-lib/pak] Failure to unzip when UNC path in use, leading to package installation failure in pak::pkg_install (Issue #745)
Meant to say, installing source package fs failed.
So installing source packages fails with both pak and install.packages(), but if you install binaries with install.packages(), you can load and use them. E.g. if you install fs from binary you can run things like
dir(system.file(package = "fs"))
packageDescription("fs", lib.loc = .libPaths()[1])
—
Reply to this email directly, view it on GitHub<#745 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AI62KF4BF7GPJANYU7UQ5DD2SBWW5AVCNFSM6AAAAABYBL72FSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOJQG43TOMBSHE>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
[gaborcsardi]gaborcsardi left a comment (r-lib/pak#745)<#745 (comment)>
Meant to say, installing source package fs failed.
So installing source packages fails with both pak and install.packages(), but if you install binaries with install.packages(), you can load and use them. E.g. if you install fs from binary you can run things like
dir(system.file(package = "fs"))
packageDescription("fs", lib.loc = .libPaths()[1])
—
Reply to this email directly, view it on GitHub<#745 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AI62KF4BF7GPJANYU7UQ5DD2SBWW5AVCNFSM6AAAAABYBL72FSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOJQG43TOMBSHE>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Error
I am encountering an error similar to #518 and #310. In these examples, the error was due to the user library path not being writeable. But I believe I am encountering a different issue.
Here are my session details:
Here is an example of the error:
Created on 2025-02-27 with reprex v2.1.1
You might notice the strange handling in the second line; I am converting the path to use a UNC path, because I believe this to be the source of the error. In my particular case at work, we have network drives that are accessed commonly using UNC paths for greater consistency instead of letter drives, which can vary from user to user.
Expected behavior
Using the ordinary letter drive (in this case
C:
), we receive the ordinary outcome.Created on 2025-02-27 with reprex v2.1.1
Problem details:
pkgdepends
andzip
I chose to post this issue in
pak
because there is precedent for the exact error message in other issues. But the underlying error is withzip
, viapkgdepends
.Here is the full trace of the error:
I arrived at the source of the error by debugging through
pkgdepends:::install_package_plan
,start_task_install
,make_install_process
,make_unzip_process
.The unzip process actually fails silently, and it is not until
verify_extracted_package(filename, pkg_cache)
does an error raise, and only because theparent_path
is empty (fromverify_extracted_package
)But here is what we see when we run the unzip process manually, using either a regular path:
Created on 2025-02-27 with reprex v2.1.1
... or a UNC path:
Created on 2025-02-27 with reprex v2.1.1
Because the contents are not extracted,
verify_extracted_package
emits the error"{.path {filename}} is not a valid R package, it is an empty archive."
.Solution
I do not have a ready-made solution, because I believe the error is specific to the compiled code in the
zip
package.Please let me know if you require any clarification! Ordinarily I would create a pull-request to try and remedy the situation, but I don't have any C++ experience.
Thank you very much!
The text was updated successfully, but these errors were encountered: