Failed to open LOCODE db in Windows #372

Closed
opened 2025-12-28 17:19:15 +00:00 by sami · 3 comments
Owner

Originally created by @cthulhu-rider on GitHub (Dec 1, 2021).

I attempted to run inner ring node on windows.

Current Behavior

Run fails with error

could not open BoltDB: CreateFileMapping: Not enough memory resources are available to process this command.

Possible solutions

There is an assumption that the size of the db affects. The solution can lie either in the OS settings or in the parameters for opening the database.

Your Environment

  • Version used: v0.26.1
  • Server setup and configuration: default
  • Operating System and version (uname -a): Microsoft Windows [Version 10.0.22000.318]
Originally created by @cthulhu-rider on GitHub (Dec 1, 2021). I attempted to run inner ring node on windows. ## Current Behavior Run fails with error ``` could not open BoltDB: CreateFileMapping: Not enough memory resources are available to process this command. ``` ## Possible solutions There is an assumption that the size of the db affects. The solution can lie either in the OS settings or in the parameters for opening the database. ## Your Environment <!-- Include as many relevant details about the environment you experienced the bug in --> * Version used: [v0.26.1](https://github.com/nspcc-dev/neofs-node/releases/tag/v0.26.1) * Server setup and configuration: `default` * Operating System and version (`uname -a`): `Microsoft Windows [Version 10.0.22000.318]`
sami 2025-12-28 17:19:15 +00:00
Author
Owner

@fyrchik commented on GitHub (Dec 27, 2021):

I think the problem lies here https://github.com/etcd-io/bbolt/blob/master/bolt_windows.go#L73
Mapping size calculated by bolt can be bigger than file size (rounding up to the nearest power of 2 is performed). While linux allows such things, windows tries to expand the file if it's size is less then the size of the mapping https://docs.microsoft.com/en-us/windows/win32/memory/creating-a-file-mapping-object . We get an error because PAGE_READONLY flag is provided and file is NOT truncated to the needed size 6 lines earlier if ReadOnly: true is provided in bolt options.

Besides fixing things in bolt (providing 0 instead of size fixed this particular case but could introduce some bugs) we can:

  1. (preferred) Explicitly truncate file-size before opening it with bolt as readonly.
  2. Open file without readonly flag.

I also think that LOCODE_DB file created with neofs-cli and published in our repo could do such thing automatically.

@fyrchik commented on GitHub (Dec 27, 2021): I think the problem lies here https://github.com/etcd-io/bbolt/blob/master/bolt_windows.go#L73 Mapping size calculated by bolt can be bigger than file size (rounding up to the nearest power of 2 is performed). While linux allows such things, windows tries to expand the file if it's size is less then the size of the mapping https://docs.microsoft.com/en-us/windows/win32/memory/creating-a-file-mapping-object . We get an error because PAGE_READONLY flag is provided and file is NOT truncated to the needed size 6 lines earlier if `ReadOnly: true` is provided in bolt options. Besides fixing things in bolt (providing 0 instead of size fixed this particular case but could introduce some bugs) we can: 1. (preferred) Explicitly truncate file-size before opening it with bolt as `readonly`. 2. Open file without `readonly` flag. I also think that `LOCODE_DB` file created with `neofs-cli` and published in our repo could do such thing automatically.
Author
Owner

@fyrchik commented on GitHub (Dec 28, 2021):

See https://github.com/etcd-io/bbolt/issues/252 for a similar (?) issue.

@fyrchik commented on GitHub (Dec 28, 2021): See https://github.com/etcd-io/bbolt/issues/252 for a similar (?) issue.
Author
Owner

@roman-khimov commented on GitHub (Apr 21, 2023):

Should be fixed by bolt 1.3.7.

@roman-khimov commented on GitHub (Apr 21, 2023): Should be fixed by bolt 1.3.7.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-node#372
No description provided.