reth: Error: 12
Describe the bug
Reth built correctly in the system, I’m using ARM based OrangePi 5 with a 2TB NVMe disk.
When trying to run the node it errors with the cryptic Error: 12
When looking to the said line, it looks like it’s unable to open the db. Maybe it’s something obvious I’m not doing correctly but I tried several things, including replacing/upgrading the db source files and rebuilding with the same result.
It works well on MacOS ARM M1
Steps to reproduce
- run the node
reth node --chain goerli
Node logs
2023-04-12T14:54:04.346135Z INFO reth 0.1.0 starting
2023-04-12T14:54:04.349436Z INFO Configuration loaded path=/home/vcastellm/.config/reth/goerli/reth.toml
2023-04-12T14:54:04.349562Z INFO Opening database path=/home/vcastellm/.local/share/reth/goerli/db
Error: 12
Location:
/home/vcastellm/reth/crates/staged-sync/src/utils/init.rs:15:14 vcastellm@orangepi5:~$ reth node --chain goerli
2023-04-12T14:54:04.346135Z INFO reth 0.1.0 starting
2023-04-12T14:54:04.349436Z INFO Configuration loaded path=/home/vcastellm/.config/reth/goerli/reth.toml
2023-04-12T14:54:04.349562Z INFO Opening database path=/home/vcastellm/.local/share/reth/goerli/db
Error: 12
Location:
/home/vcastellm/reth/crates/staged-sync/src/utils/init.rs:15:14
### Platform(s)
Linux (ARM)
### What version/commit are you on?
ca28b37a742ccad0c387e69121ffb842190151fa
### Code of Conduct
- [X] I agree to follow the Code of Conduct
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 24 (12 by maintainers)
Thanks a lot for tracking down this bug and working on that doc (https://github.com/paradigmxyz/reth/blob/v0.1.0-alpha.10/book/installation/build-for-arm-devices.md). For what it’s worth, I did also get the issue with the official Orange Pi Ubuntu image, but not with thirdparty Ubuntu one from https://github.com/Joshua-Riek/ubuntu-rockchip. To be more precise, I’m now using the
ubuntu-22.04.3-preinstalled-desktop-arm64-orangepi-5-plus.img.xzimage from https://github.com/Joshua-Riek/ubuntu-rockchip/releases/tag/v1.27 And the official image with the issue wasOrangepi5plus_1.0.6_ubuntu_jammy_desktop_gnome_linux5.10.110.7zfrom https://drive.google.com/drive/folders/1wOmKUla8CwUPTfxvfCGutj8lbMZFtFCm@vcastellm Not at all, it just involves building a new Armbian image (if you’re using an SD card on the Orange Pi, the flash part will be automatically made by the build framework). Then, the default binary from the releases will work.
@gakonst Can I take the task about writing the new subsection in the documentation ? I already have most of the content from my article, I just need to make it more “formal”.
@0xpanoramix amazing. we can maybe add a subsection on https://paradigmxyz.github.io/reth/installation/installation.html?
“Building for ARM”?
https://github.com/paradigmxyz/reth/tree/main/book/installation
Looking at the above doc again, it looks like AArch64 does actually support 4-level paging, so I checked out the board you are using to see if it is restricted to 3 levels, but it seems like there isn’t a reason it should be - the OrangePi 5 uses a Rockchip RK3588S, which according to their datasheet is based on ARMv8-A. ARMv8-A should support 4 level paging.
I wonder if it is due to the distros used/the config used to build the kernel?
The upper bound of
sizeinGeometrygoverns how big the database can get. It also defines the linear address space reservation in each process that opens the database.Changing the upper bound is costly according to MDBX docs, so a reasonably large value had to be chosen. Since we are at 2tb, the assumption here was that we would probably grow to 3tb “relatively soon”, so 4tb was chosen.
If the size is set to only 342gb, then reth cannot store more than 342gb of data. This is not sufficient to sync.
As far as I can tell, x86_64 has a 48-bit address space that is divided in half, which means that user-space and kernel each have 128TB of address space.
On AArch64 however, it seems that the address space is only 512GB for user space and 256TB for the kernel.
In the linked document above, it seems that some newer version of ARM has support for Large Virtual Address space, but it requires running with a 64KB page size. I am not sure how (or if) you can enable this.
looks like this hasn’t been touched in a while, so now is a good time to “reevaluate” the todo, not exactly sure what the
sizefield refers to but if this is the expected size of the db, then 4tb is way too highhmm,
mind playing around with the geometry settings here?
https://github.com/paradigmxyz/reth/blob/703f0fdf8904dfb789019deeeddc57813cc8ec90/crates/storage/db/src/implementation/mdbx/mod.rs#L64-L69
Thanks @Rjected can you point me to the PR with the change to data dirs?
I rechecked and it looks a bit different, Error: 12 can be a Mem allocation error, I’m puzzled now.