-
Notifications
You must be signed in to change notification settings - Fork 2
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
"Cannot import files outside of module root directory" #485
Comments
I find it suspicious that |
Could be! But I don't think so necessarily https://stackoverflow.com/questions/21194530/what-does-mean-when-prepended-to-a-file-path |
Great find! Another interesting fact: The module toot directory contains I suspect Deno uses a process for converting paths to strings on Windows that is different from Zinnia's. @juliangruber What is the impact of this issue? How many users are affected? |
I think this may be fixed by filecoin-station/core#345. Let's see if the problem persists after people update their Station versions to apply that patch. |
yeah! I'm releasing the changes atm, to validate this |
Released in https://github.com/filecoin-station/desktop/releases/tag/v1.3.8, asked user for confirmation |
Let's reopen if the issue comes back |
This issue came back. This time it was also captured with Spark. The paths all look correct. I assume this is a cross platform path handling issue.
I formatted the logs for better readability.
|
I cannot reproduce this on my Windows 11 Pro laptop |
I have asked the issue reporter for additional details on their setup. This bug is preventing them from using Zinnia. |
Can you create a user on your Windows laptop with a long username and/or a username containing non-ASCII characters? Would that reproduce the problem?
Yeah, I am thinking the same. Windows have several different ways how to encode filesystem paths. Preserving backwards compatibility all the way back to MS-DOS and 8.3 filename format comes with costs. |
From the original error reporting I can tell that the username in question consists of
😱 |
@juliangruber what's the severity/priority of this issue? Should we prioritise it for the next milestone? |
We have only heard about this from one user. They are not able to participate at all because of this. We don't know how many blocked users we aren't aware of. I propose we as a team discuss the severity of this issue. |
It happened again, see filecoin-station/desktop#1639
|
I don't know, it was installed in the default routes, the real route is this "C:\Users", could you tell me where that route is saved? Maybe I can change it and it can be fixed |
I I have uninstalled Filecoin station New log: |
Zinniad logs from the log file attached in the comment above:
Additional material I found on the internet: https://fleexlab.blogspot.com/2016/07/what-are-those-backslash-double.html
https://users.rust-lang.org/t/understanding-windows-paths/58583/2
https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file |
I improved the log messages for this error to include additional information, I hope it will help us to understand better the problem and how to fix it. Can you please upgrade your Station Desktop to the latest versions (1.9.0) and send us the new error messages from the module log file? |
New log ver 1.9.0 |
Thank you, @nekros05. The logs confirmed my suspicion. The Windows path created from the URL of the imported module starts with |
Could you please install v2.0.1 and upload the new module logs? I reworked the module sandboxing in Zinnia. Either the problem will go away, or else I should hopefully get enough the information to fix it. |
@bajtos same error. New log: |
Cross-posting the relevant part from the module log:
@nekros05 can you please try the following steps?
@juliangruber It looks like the main module file ( https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-
Do you have any idea why that could happen? |
Hi @bajtos , it is already working, but now there is a new problem, the window goes blank after 2-3 seconds of opening it. Version 2.0.2 |
Please open a new GitHub issue for that in the Station Desktop repo: |
The issue is still happening, see https://space-meridian.sentry.io/issues/5258168696/
|
Sentry Issue: STATION-CORE-AK4 |
https://discord.com/channels/1267475749615698061/1267506556216414293/1291127136358502470
|
I have a suspicion that this error happens when the file to be imported can't be found. Can we stat it first? |
Yeah, that seems to be what the error message is telling us.
I propose a different change since this operation usually succeeds + learning that the file does not exist does not help us that much: When we cannot canonicalize the module path, we can walk the directory tree from the file up to the root until we find a directory that exists. Then, we print the full path of that directory. WDYT? |
Sgtm to dig deeper into this error only once it happened. I would still like to stat it first, so that we have certainty that that is the issue (and not eg that it's not readable or there was a read error etc). Afterwards good idea to find the next parent path that exists, and report that. |
Had probably something similar happen to me today after restarting the machine. Tried reinstalling the station, but that didn't help. |
@zipiju thank you for the comment, it's helpful! It's great to have a workaround we can offer users to fix the problem manually. I'll add it to the issue description. |
Cross-posting from the Slack discussion in https://space-meridian.slack.com/archives/C03S6LXSRB8/p1728493053534679
The user sent me a ZIP archive with files in Station's CACHE_DIR. There is a nested folder structure, but all folders are empty. |
@juliangruber could this be a bug in the if (entry.type === 'file' || entry.type === 'raw') {
await mkdir(outDir, { recursive: true })
// `{ strip: 1 }` tells tar to remove the top-level directory (e.g. `mod-peer-checker-v1.0.0`)
await pipeline(
/** @type {any} */(entry.content()),
/** @type {any} */(tar.x({ strip: 1, C: outDir }))
)
} |
It could be! It could also be an issue with w3s. The I wonder if we can use a simpler approach. We don't need compression, but we do need the bundling into a single tar file - unless we individually download a list of files instead. We could also add more debugging 🤔 Currently the Looking at the tar api docs https://www.npmjs.com/package/tar:
While this would help with visibility, it will also let it crash on recoverable errors, that could be wine.
Push these onto an array, submit to Sentry
Push these onto an array, submit to Sentry in case files are missing |
* module: add report tar debug information filecoin-station/zinnia#485 (comment) * clean up * explicit
I am closing this issue as fixed. If the problem resurfaces again in the future, let's open a new issue in https://github.com/filecoin-station/core |
Hi all, I'm the one who mentioned the install was on a different drive from my boot drive. I missed the note about the manual fix and just had station shut off for the past week or so. Upon a reboot (not the first since the problem arose, I swear!) today, the problem resolved without my intervention. Don't know if the AppData folders were erased after a certain amount of time or some other thing, but I thought I'd mention it for the record. |
WORKAROUND TO FIX THE ISSUE MANUALLY
AppData\Local\Temp\Filecoin Station Desktop\sources\spark
)This error was submitted by a user in https://filecoinproject.slack.com/archives/C03S6LXSRB8/p1707311859950409:
This is the first time I've seen that error, other installations are looking fine.
Some suspicions:
Zinnia source of error:
zinnia/runtime/module_loader.rs
Line 99 in ca764ff
Mentioned Voyager file: https://github.com/filecoin-station/voyager/blob/4f4410c36df95774e6f52cabf717c322e27e6693/main.js
The text was updated successfully, but these errors were encountered: