Issue Details (XML | Word | Printable)

Key: CORE-4639
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Dmitry Yemanov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Linux server may reject connections with a transliteration error

Created: 16/Dec/14 10:19 AM   Updated: 26/Mar/18 02:49 PM
Component/s: Engine
Affects Version/s: 3.0 Alpha 1, 3.0 Alpha 2, 3.0 Beta 1
Fix Version/s: 3.0 Beta 2

File Attachments: 1. File 20180316 user1ok reboot user1error user2ok.pcapng (74 kB)

Environment: Any Linux build

QA Status: Deferred
Test Details: TODO: make test after confirmation from Alex that CORE-4760 is finally fixed.
Test Specifics: Platform (Windows/Linux) specific


 Description  « Hide
Example of failure:

SQL> connect 192.168.1.105:employee user sysdba password 123;
Statement failed, SQLSTATE = 08001
Invalid connection string
-Cannot transliterate character between character sets
-Invalid or incomplete multibyte or wide character

It happens when a connection is being established from a client host with non-ASCII (e.g. Cyrillic) name or with non-ASCII OS user name. This could be quite common in the Windows world.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Ehmmm added a comment - 16/Mar/18 04:18 PM
I'm afraid that something like this still occurs.

On Debian Stretch I have Firebird 3.0.4.32931 with some DB (in codepage win1250 but I think it isn't relevant).
It is not actually server but more likely client but capable enough to run Firebird, Apache/PHP, etc...
On Windows 7 I have FlameRobin 0.9.3 and two Windows users, one with diacritics "testěščřžýáíé" and one good old ascii "xj7".
(User in DB is "mmuser02".)

If I start FlameRobbin as the first user (testěščřžýáíé) and try to connect to DB then I get the mentioned error (Invalid or incomplete multibyte or wide character).
If I start FlameRobin as the second user (xj7) then I connect successfully.

And the most weird thing is that if I restart firebird on server (/etc/init.d/firebird restart) then I can connect even with the Windows user with diacritics.
Until I reboot the whole server. Then again I can't connect with the diacritics user. (?!)

I will try to attach Wireshark capture of the three connection tests:
[1] Firebird service was restarted and testěščřžýáíé can connect.
[2] Whole server was rebooted and test... can't connect.
[3] Immediately after this the second windows user (xj7) can connect.

Ehmmm added a comment - 16/Mar/18 04:21 PM
Capture of tcp port 3050 communication.
Server is 192.168.253.1, Flamerobin is 10.149.81.6.
Three tcp connections.
Between the first and the second connection the whole server was rebooted.

Ehmmm added a comment - 16/Mar/18 04:23 PM
And I forgot to mention that on couple other servers (with bit older Debian Stretch and bit older Firebird snapshot version) I don't have these problems.
But because after "/etc/init.d/firebird restart" everything works well then I'm worried that the trick is somewhere else.

Ehmmm added a comment - 26/Mar/18 02:49 PM
I'll answer to myself.
It doesn't seem to be a bug in Firebird.
This discussion gave me a clue: http://tracker.firebirdsql.org/browse/CORE-5775
I dumped locale from /etc/init.d/firebird and during the first start after reboot the LC_* variables are empty (more precisely there was "POSIX" in some of them). (?!)
I don't know why and I admit that this wasn't very clean installation of Debian (Jessie upgraded to Stretch, systemd downgraded to sysvinit).
So I added two lines:

export LC_ALL="en_US.UTF-8"
export LANGUAGE="en_US:en"

somewhere on top into /etc/init.d/firebird and it seems to work OK.