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

Failed to open LOCODE db in Windows #999

Closed
cthulhu-rider opened this issue Dec 1, 2021 · 3 comments
Closed

Failed to open LOCODE db in Windows #999

cthulhu-rider opened this issue Dec 1, 2021 · 3 comments
Labels
neofs-ir Inner Ring node application issues windows Windows env issues
Milestone

Comments

@cthulhu-rider
Copy link
Contributor

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]
@cthulhu-rider cthulhu-rider added triage neofs-ir Inner Ring node application issues windows Windows env issues labels Dec 1, 2021
@fyrchik
Copy link
Contributor

fyrchik commented 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
Copy link
Contributor

fyrchik commented Dec 28, 2021

See etcd-io/bbolt#252 for a similar (?) issue.

@roman-khimov
Copy link
Member

Should be fixed by bolt 1.3.7.

@roman-khimov roman-khimov added this to the v0.37.0 milestone Apr 21, 2023
@roman-khimov roman-khimov removed the blocked Can't be done because of something label Apr 21, 2023
roman-khimov added a commit that referenced this issue Jun 5, 2023
Signed-off-by: Roman Khimov <roman@nspcc.ru>
roman-khimov added a commit to nspcc-dev/neo-go that referenced this issue Jun 5, 2023
Refs. nspcc-dev/neofs-node#999, it fixes a number of other Windows-related
issues as well.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
AnnaShaleva pushed a commit to nspcc-dev/neo-go that referenced this issue Aug 1, 2023
Refs. nspcc-dev/neofs-node#999, it fixes a number of other Windows-related
issues as well.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
neofs-ir Inner Ring node application issues windows Windows env issues
Projects
None yet
Development

No branches or pull requests

4 participants