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

Firebird handles ':' characters in mount table entries invalid [CORE4624] #4939

Closed
firebird-automations opened this issue Nov 24, 2014 · 13 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Michał Ziemski (r_o_o_k)

Attachments:
firebird-docker.patch

Votes: 1

When running under docker Firebird won't start.

As far as I was able to debug the issue the reason is as follows:

Under Docker the mount table looks somewhat like follows:
/dev/mapper/docker-9:1-3063-cf43ec04ee218f73bcc6e0b31f04c73a7c2df8b838a4a391b3b70462d58345e0 on / type ext4 (rw,relatime,discard,stripe=16,data=ordered)

It contains a colon character ':' which is handled specially somewhere in src/jrd/isc_file.cpp
As a result only the former part "/dev/mapper/docker-9" gets prepended to the file name in
the call to isc_expand_filename with expand_mounts = true

Commits: 5b567f2 1bfe2d7 FirebirdSQL/fbt-repository@33f8a4b FirebirdSQL/fbt-repository@5d673c3

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Michał Ziemski (r_o_o_k)

I've found a workaround to acrually run fb inside a docker container.
The trick is not to have any databases (including security2.fdb on the main mount point.

Start a docker container with some volume mounted.
Inside the container copy security2.fdb to the mounted volume and replace the original
security2.fdb with a link to the file on the mounted volume.

Now firebird will now start without problems.

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

Michal,

It seems this was an issue related to your setup/configuration within docker container, not a Firebird issue. Correct?

@firebird-automations
Copy link
Collaborator Author

Commented by: Michał Ziemski (r_o_o_k)

Actually it seems to be a problem with firebird failing to interpret the colon character in the
device name. As far as I understand the code in src/jrd/isc_file.cpp firebird is checking
the type of device (disk, nfs, etc) the database is on. It does so heuristicly by looking for ':' and '/' characters.
The device name provided by docker (as far as I understand what's going on - this is my first time using gdb in 10 years or so) is not being interpreted correctly.

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Michal, you are absolutely right - it's a bug in a code that does not expect ':' in file name.

@firebird-automations
Copy link
Collaborator Author

Commented by: Marcus Brinkmann (m.brinkmann)

This is a work-around.for CORE4624, a bug in firebird where it interprets a /dev/mapper/ filename with a colon as an NFS volume. This happens in Docker on Fedora 21.

@firebird-automations
Copy link
Collaborator Author

Modified by: Marcus Brinkmann (m.brinkmann)

Attachment: firebird-docker.patch [ 12665 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Fix required modification of OS-dependent code.
I want results of at least MAC build before backporting it to 2.5.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

Version: 3.0 Beta 1 [ 10332 ]

Fix Version: 3.0 Beta 2 [ 10586 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

summary: Firebird won't start under Docker => Firebird handles ':' characters in mount table entries invalid

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.5.4 [ 10585 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Cannot be tested

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

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