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

Unable to create object-mappings if Non-ascii characters present in the path on windows #743

Closed
ozgunozerk opened this issue Aug 5, 2022 · 3 comments

Comments

@ozgunozerk
Copy link
Contributor

ozgunozerk commented Aug 5, 2022

We had identified this bug on the desktop app, here is the issue: autonomys/subspace-desktop#240

While debugging today, it seemed to me, the error is originating from rocksDB database's specific open/create functions.
So I tried to reproduce the bug on the monorepo side, to see if this issue is specific to desktop app or not.

Unfortunately, the issue is not specific to desktop.

Desktop app log
2022-08-05T13:36:41.180445Z  INFO subspace_desktop::farmer: Opening object mapping
2022-08-05T13:36:41.182203Z ERROR subspace_desktop::farmer: farm function failed to start, with error: DB error: IO error: No such file or directory: Failed to create a directory: C:\Users\ozgun\озгунозерк\object-mappings: The system cannot find the 
path specified.
CLI log
C:\Users\ozgun\Downloads>subspace-farmer-windows-x86_64-gemini-1b-2022-jun-18.exe --base-path C:\Users\ozgun\озгунозерк farm --reward-address **** --plot-size 1GB
2022-08-05T14:22:19.454137Z  INFO subspace_farmer::commands::farm: Connecting to node at ws://127.0.0.1:9944
2022-08-05T14:22:19.455977Z  INFO jsonrpsee_client_transport::ws: Connection established to target: Target { sockaddrs: [], host: "127.0.0.1", host_header: "127.0.0.1:9944", _mode: Plain, path_and_query: "/" }
2022-08-05T14:22:19.456584Z  INFO jsonrpsee_client_transport::ws: Connection established to target: Target { sockaddrs: [], host: "127.0.0.1", host_header: "127.0.0.1:9944", _mode: Plain, path_and_query: "/" }
2022-08-05T14:22:19.467965Z  INFO subspace_farmer::commands::farm: Opening object mapping
Error: DB error: IO error: No such file or directory: Failed to create a directory: C:\Users\ozgun\озгунозерк\object-mappings: The system cannot find the path specified.
@ozgunozerk
Copy link
Contributor Author

We tried with @i1i1 to inspect the directory that has non-ascii characters with std::fs::read_dir()

pub(crate) async fn farming(path: String, reward_address: String, plot_size: u64) -> bool {
    println!("farming is called in the backend, with path: {}", path);
    for entry in std::fs::read_dir(path.clone()).unwrap() {
        let dir = entry.unwrap();
        println!("printing the entry: {:?}", dir.path());
    }
farming is called in the backend, with path: C:\Users\ozgun\озгунозерк
printing the entry: "C:\\Users\\ozgun\\озгунозерк\\chains"
printing the entry: "C:\\Users\\ozgun\\озгунозерк\\object-mappings"
2022-08-05T14:05:33.233192Z  INFO subspace_desktop::farmer: Connecting to node at ws://127.0.0.1:9947
2022-08-05T14:05:33.234245Z  INFO jsonrpsee_ws_server::server: Accepting new connection, 2/100

so everything seems ok on standard rust side

@nazar-pc
Copy link
Member

nazar-pc commented Aug 5, 2022

Hm... Windows is a weird OS, I believe it still doesn't use utf-8. I recall it used CP1251 for Cyrillic in the past, maybe still is. Likely an issue of RocksDB library, not the app more broadly.

Someone needs to report this to RocksDB instead (well, search if it is already reported and if not then report to Rust version).

Also is it an issue with ParityDB? If not then this will be a low priority and may become obsolete sooner than fixed.

@nazar-pc nazar-pc changed the title unable to create object-mappings if Non-ascii characters present in the path on windows Unable to create object-mappings if Non-ascii characters present in the path on windows Aug 8, 2022
@ozgunozerk
Copy link
Contributor Author

ozgunozerk commented Aug 10, 2022

Opened the issue on upstream: rust-rocksdb/rust-rocksdb#674

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants