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

"Cannot import files outside of module root directory" with voyager #485

Open
juliangruber opened this issue Feb 7, 2024 · 14 comments
Open
Assignees
Labels
bug 🐛 Something isn't working

Comments

@juliangruber
Copy link
Member

juliangruber commented Feb 7, 2024

This error was submitted by a user in https://filecoinproject.slack.com/archives/C03S6LXSRB8/p1707311859950409:

[2024-02-07T13:25:54Z ERROR zinniad] Cannot import files outside of module root directory \\?\C:\Users\Administrator\AppData\Local\Temp\Filecoin Station Desktop\sources\voyager. file:///C:/Users/ADMINI~1/AppData/Local/Temp/Filecoin%20Station%20Desktop/sources/voyager/main.js

{"type":"activity:info","module":"Zinnia","message":"Voyager exited with code: 1"}

This is the first time I've seen that error, other installations are looking fine.

Some suspicions:

  • Could this be a filesystem case sensitive problem?
  • Is this another error masking as this one?

Zinnia source of error:

format!("Cannot import files outside of module root directory {}. ", module_root.unwrap().display())

Mentioned Voyager file: https://github.com/filecoin-station/voyager/blob/4f4410c36df95774e6f52cabf717c322e27e6693/main.js

@bajtos
Copy link
Member

bajtos commented Feb 7, 2024

I find it suspicious that module_root starts with \\?. It looks like some kind of a path to a network-shared drive.

@juliangruber
Copy link
Member Author

@bajtos
Copy link
Member

bajtos commented Feb 8, 2024

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 Administrator among the directory names, while the module URL contains AMINI~1.

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?

@bajtos
Copy link
Member

bajtos commented Feb 8, 2024

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.

@juliangruber
Copy link
Member Author

yeah! I'm releasing the changes atm, to validate this

@juliangruber
Copy link
Member Author

Released in https://github.com/filecoin-station/desktop/releases/tag/v1.3.8, asked user for confirmation

@juliangruber
Copy link
Member Author

Let's reopen if the issue comes back

@juliangruber
Copy link
Member Author

juliangruber commented Feb 22, 2024

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.

[2024-02-21T18:21:47Z INFO zinniad] Starting zinniad with config CliArgs { wallet_address: "", state_root: "C:\Users\\AppData\Local\Filecoin Station Desktop\modules\zinnia", cache_root: "C:\Users\\AppData\Local\Temp\Filecoin Station Desktop\modules\zinnia", files: ["spark\main.js"] }

[2024-02-21T18:21:47Z INFO lassie] Starting Lassie Daemon
[2024-02-21T18:21:47Z INFO lassie] Lassie Daemon is listening on port 64945
{"type":"activity:info","module":"spark","message":"Spark started"}

[2024-02-21T18:21:47Z INFO zinniad] Starting module file:///C:/Users//AppData/Local/Temp/Filecoin%20Station%20Desktop/sources/spark/main.js

[2024-02-21T18:21:48Z ERROR zinniad] Cannot import files outside of module root directory \?\C:\Users<REDACTED>\AppData\Local\Temp\Filecoin Station Desktop\sources\spark. file:///C:/Users//AppData/Local/Temp/Filecoin%20Station%20Desktop/sources/spark/main.js

{"type":"activity:info","module":"Zinnia","message":"Spark exited with code: 1"}
{"type":"activity:error","module":"Zinnia","message":"Zinnia crashed"}
Zinnia closed all stdio with codes 1, 1

I formatted the logs for better readability.

Suspicious: Zinnia is seeing relative paths as args files: ["spark\\main.js"], but then printing absolute paths when starting Starting module file:///C:/Users/<REDACTED>/AppData/Local/Temp/Filecoin%20Station%20Desktop/sources/spark/main.js That's not it. The same output can be seen on macOS, where this works

@juliangruber juliangruber reopened this Feb 22, 2024
@juliangruber
Copy link
Member Author

I cannot reproduce this on my Windows 11 Pro laptop

@juliangruber
Copy link
Member Author

I have asked the issue reporter for additional details on their setup. This bug is preventing them from using Zinnia.

@bajtos
Copy link
Member

bajtos commented Feb 22, 2024

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?

I assume this is a cross platform path handling issue.

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.

@juliangruber
Copy link
Member Author

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?

From the original error reporting I can tell that the username in question consists of [a-z]{5}, so that seems not to be it.

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.

😱

@bajtos bajtos added the bug 🐛 Something isn't working label Feb 27, 2024
@bajtos
Copy link
Member

bajtos commented Feb 27, 2024

@juliangruber what's the severity/priority of this issue? Should we prioritise it for the next milestone?

@juliangruber
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants