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

Shared memory area is probably already created by another engine instance in another Windows session, failed to create database #7522

Closed
tomaszdubiel18 opened this issue Mar 29, 2023 · 7 comments · Fixed by #7828

Comments

@tomaszdubiel18
Copy link

Hello. I'm not sure whether this is a bug. If so, please tell me what Im doing wrong. Tried on latest snapshot 3.0.11.33666-0 x64 Windows
gbak.exe -c path_to_gbk path_to_fdb

gbak error Shared memory area is probably already created by another engine instance in another Windows session, failed to create database
It only works when I add localhost: to the fdb path.

@hvlad
Copy link
Member

hvlad commented Mar 29, 2023

It is side effect after fix for #7122, looking for solution.

@tomaszdubiel18
Copy link
Author

tomaszdubiel18 commented Apr 17, 2023

Don't you think that this bug needs more attention? It's one of the basic uses of backing up the database. Every customer backing the databases this way in FB 2.5 the next day he installs Firebird 3.0 finds out (if he is a responsible Firebird admin ;)) that backups stopped being performed, reads this message and it doesnt give gim any idea what it is about.

@mariuz
Copy link
Member

mariuz commented Nov 3, 2023

@hvlad
Copy link
Member

hvlad commented Nov 3, 2023

It produces another error message, as I see in log:

An uncaught exception of type com.sun.star.sdbc.SQLException

  • firebird_sdbc error:
    *Wrong file for memory mapping, see details in firebird.log
    caused by
    'isc_create_database'

Does anybody reads that logs and look into firebird.log for details ?

@th1722
Copy link
Contributor

th1722 commented Nov 6, 2023

It produces another error message, as I see in log:

An uncaught exception of type com.sun.star.sdbc.SQLException

  • firebird_sdbc error:
    *Wrong file for memory mapping, see details in firebird.log
    caused by
    'isc_create_database'

Does anybody reads that logs and look into firebird.log for details ?

  • firebird_sdbc error:
    *Wrong file for memory mapping, see details in firebird.log
    caused by
    'isc_create_database'

Does anybody reads that logs and look into firebird.log for details ?

firebird(make).log
firebird(make_check).log

@hvlad
Copy link
Member

hvlad commented Nov 6, 2023

The second log contains

Wrong file for memory mapping:
expected C:\cygwin64\tmp\lu22164rcgvl.tmp\fb_user_mapping
already mapped C:\cygwin64\tmp\lu18692rcgvk.tmp\fb_user_mapping
Check for presence of another Firebird instance with different lock directory

Looks like someone (build script ?) set FIREBIRD_LOCK=C:\cygwin64\tmp\lu18692rcgvk.tmp and run Firebird server or embedded application,
then it set FIREBIRD_LOCK=C:\cygwin64\tmp\lu22164rcgvl.tmp (different value) and run second Firebird server or embedded application.
Such configuration is wrong and not allowed.
It is impossible to simultaneously run few instances of the Firebird engine using different lock directory.

FIREBIRD_LOCK should be set, if absolutely necessary, for the whole system, not per process or per-user.

hvlad added a commit that referenced this issue Nov 6, 2023
…a is probably already created by another engine instance in another Windows session, failed to create database
@hvlad hvlad linked a pull request Nov 6, 2023 that will close this issue
hvlad added a commit that referenced this issue Nov 7, 2023
* This should fix most often scenarios of bug #7522 : Shared memory area is probably already created by another engine instance in another Windows session, failed to create database

* Typo
@hvlad hvlad self-assigned this Nov 7, 2023
@hvlad hvlad closed this as completed Nov 7, 2023
@mikekaganski
Copy link

Looks like someone (build script ?) set FIREBIRD_LOCK=C:\cygwin64\tmp\lu18692rcgvk.tmp and run Firebird server or embedded application, then it set FIREBIRD_LOCK=C:\cygwin64\tmp\lu22164rcgvl.tmp (different value) and run second Firebird server or embedded application. Such configuration is wrong and not allowed. It is impossible to simultaneously run few instances of the Firebird engine using different lock directory.

FIREBIRD_LOCK should be set, if absolutely necessary, for the whole system, not per process or per-user.

Please see #6937, and our discussion there about the specific use case in LibreOffice, which requires a per-process lock.

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

Successfully merging a pull request may close this issue.

5 participants