Skip to content

Error: nippy jar error: 拒绝访问。 (os error 5) #9747

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

Closed
1 task done
MiraWells opened this issue Jul 23, 2024 · 10 comments · Fixed by #10672
Closed
1 task done

Error: nippy jar error: 拒绝访问。 (os error 5) #9747

MiraWells opened this issue Jul 23, 2024 · 10 comments · Fixed by #10672
Labels
A-static-files Related to static files C-bug An unexpected or incorrect behavior

Comments

@MiraWells
Copy link

MiraWells commented Jul 23, 2024

Describe the bug

Error: nippy jar error: 拒绝访问。 (os error 5)
企业微信截图_17217764668619

Steps to reproduce

1 run reth on windows 2 see the bug
企业微信截图_17217764668619

Node logs

2024-07-23T23:12:53.971245Z  INFO reth::cli: Initialized tracing, debug log directory: C:\Users\10200\AppData\Local\reth\logs\mainnet
2024-07-23T23:12:53.974415Z  INFO reth::cli: Starting reth version="1.0.3 (6ce7c9e3)"
2024-07-23T23:12:54.175145Z  INFO reth::cli: Opening database path=".\\db"
2024-07-23T23:12:54.196656Z DEBUG storage::db::mdbx: Commit total_duration=309.9µs commit_latency=Some(CommitLatency(MDBX_commit_latency { preparation: 0, gc_wallclock: 1, audit: 0, write: 7, sync: 9, ending: 0, whole: 19, gc_cputime: 0, gc_prof: MDBX_commit_latency__bindgen_ty_1 { wloops: 1, coalescences: 0, wipes: 0, flushes: 0, kicks: 0, work_counter: 2, work_rtime_monotonic: 0, work_xtime_cpu: 0, work_rsteps: 0, work_xpages: 0, work_majflt: 2, self_counter: 3, self_rtime_monotonic: 0, self_xtime_cpu: 0, self_rsteps: 0, self_xpages: 0, self_majflt: 1 } })) is_read_only=false
2024-07-23T23:12:54.203920Z  INFO reth::cli: Configuration loaded path=".\\reth.toml"
2024-07-23T23:12:54.210639Z  INFO reth::cli: Verifying storage consistency.
2024-07-23T23:12:54.218487Z ERROR reth::cli: shutting down due to error

Platform(s)

Windows (x86)

What version/commit are you on?

reth Version: 1.0.3
Commit SHA: 6ce7c9e
Build Timestamp: 2024-07-23T23:07:46.325152100Z
Build Features: jemalloc
Build Profile: debug

What database version are you on?

2024-07-23T23:20:16.474702Z INFO Initialized tracing, debug log directory: C:\Users\10200\AppData\Local\reth\logs\mainnet
Current database version: 2
Local database version: 2

Which chain / network are you on?

mainnet

What type of node are you running?

Archive (default)

What prune config do you use, if any?

[stages.prune]
commit_threshold = 1000000

If you've built Reth from source, provide the full command you used

cargo build

Code of Conduct

  • I agree to follow the Code of Conduct
### Tasks
@MiraWells MiraWells added C-bug An unexpected or incorrect behavior S-needs-triage This issue needs to be labelled labels Jul 23, 2024
@onbjerg
Copy link
Collaborator

onbjerg commented Jul 24, 2024

This is an access denied error, please check that the user running the node has R/W access to your node's data directory.

@onbjerg onbjerg added A-static-files Related to static files and removed S-needs-triage This issue needs to be labelled labels Jul 24, 2024
@MiraWells
Copy link
Author

I am double checked that the user running the node has R/W access to your node's data directory.

@MiraWells
Copy link
Author

I confirm that there are no issues with read and write permissions. If you have Windows, you can run it and see what problem I'm referring to.

@saguillo2000
Copy link

I'm facing the same issue: Error: nippy jar error: Acceso denegado. (os error 5). This is with the tutorial hello_world of exex

@saguillo2000
Copy link

@lucyzhang314 I solved it by running reth in WSL (Ubuntu 20.04), seems that for windows it's not fully prepared

@saguillo2000
Copy link

@kaxxa123
Copy link
Contributor

kaxxa123 commented Aug 22, 2024

I ran into this problem and troubleshooted it.

The bug is caused by this line of code in ./crates/storage/nippy-jar/src/lib.rs:
OpenOptions::new().read(true).open(parent)?.sync_all()?;

This is trying to open a directory. However on Windows this only works for files.
The directory path it tries to open, in my case was:
D:\reth_data\dev\static_files

Fixed this by filtering out the code in case of Windows:
#[cfg(not(windows))]

This is what the complete fixed code looks like:

// fsync() dir if platform is not windows
#[cfg(not(windows))]
if let Some(parent) = tmp_path.parent() {
      OpenOptions::new().read(true).open(parent)?.sync_all()?;            
}

And of course the use clause...

#[cfg(not(windows))]
use std::fs::OpenOptions;

With this change the node is starting just fine.

Should I create a PR?
I am new to Reth.

@kaxxa123
Copy link
Contributor

Actually here is the correct solution after checking how to do sync_all() on Windows...

Modify ./crates/storage/nippy-jar/src/lib.rs:

Add:

#[cfg(windows)]
use std::os::windows::prelude::OpenOptionsExt;

Replace:

OpenOptions::new().read(true).open(parent)?.sync_all()?;

...with

            #[cfg(windows)]
            OpenOptions::new()
            .read(true)
            .write(true)
            .custom_flags(0x02000000)   // FILE_FLAG_BACKUP_SEMANTICS
            .open(parent)?
            .sync_all()?;

            #[cfg(not(windows))]
            OpenOptions::new()
            .read(true)
            .open(parent)?
            .sync_all()?;

@mattsse
Copy link
Collaborator

mattsse commented Sep 2, 2024

that makes sense
do you want to submit a pr for this @kaxxa123 ?

@kaxxa123
Copy link
Contributor

kaxxa123 commented Sep 2, 2024

yes assign to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-static-files Related to static files C-bug An unexpected or incorrect behavior
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants