Issue Details (XML | Word | Printable)

Key: CORE-4395
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Volker Rehn
Votes: 0
Watchers: 4
Operations

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

execute statement on external doesn't find Firebird 2.5 database

Created: 20/Apr/14 12:35 AM   Updated: 23/Sep/15 11:22 AM
Component/s: Engine
Affects Version/s: 3.0 Alpha 2
Fix Version/s: 3.0 Beta 1

Environment:
Win7 64, Firebird 2.5.2 port 3050, Firebird 3 alpha2 port 3053, both running as services. Firebird 3 firebird.conf modified: AuthServer = Legacy_Auth, AuthClient = Legacy_Auth, UserManager = Legacy_UserManager, CryptPlugin = or CryptPlugin = Arc4, WireCrypt = Disabled

QA Status: Not enough information
Test Details: 2 dimitr (?): is it possible to do on test host ? (I mean: when some test is running on FB 3.0 - does any FB 2.5 instance is active at the same time ? what's its port number ?)


 Description  « Hide
Trying to access a 2.5 database through a remote execute statetement, Firebird 3 doesn't find the database, neither aliased nor with the full file name. Test case: Set up two Firebird servers 2.5.2 port 3050 and Firebird 3 alpha2 on a different port, then run this query from a Firebird 3 database: The 2.5 employee database is there and is aliased in 2.5 aliases.conf, no problem connecting to it using any tool. Execute block below runs without a problem from another database of the 2.5 server.

EXECUTE BLOCK
RETURNS (
  LOCATION VARCHAR(15)
)
AS
declare sql varchar(100);
begin
  sql = 'select location from department';
  for execute statement :sql
  on external 'localhost/3050:employee'
  as user 'sysdba' password 'masterke'
  into :location
  do
    suspend;
end;

gives

Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements.Execute statement error at attach :
335544344 : I/O error during "CreateFile (open)" operation for file "localhost/3050:employee"
335544734 : Error while trying to open file
3 : Das System kann den angegebenen Pfad nicht finden. (system can't find given path, vr)
Data source : Firebird::localhost/3050:employee.

exchanging alias for full file name
on external 'localhost/3050:C:\Program Files (x86)\Firebird\Firebird_2_5\examples\empbuild\employee.fdb'
results in

Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements.Execute statement error at attach :
335544344 : I/O error during "CreateFile (open)" operation for file "localhost/3050:C:\Program Files (x86)\Firebird\Firebird_2_5\examples\empbuild\employee.fdb"
335544734 : Error while trying to open file
123 : Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch. (wrong syntax for file name, directory name or drive, vr)
Data source : Firebird::localhost/3050:C:\Program Files (x86)\Firebird\Firebird_2_5\examples\empbuild\employee.fdb.

Best regards, Volker

 All   Comments   Change History   Subversion Commits      Sort Order: Descending order - Click to sort in ascending order
Alexander Peshkov added a comment - 28/Apr/14 12:56 PM
The reason of a bug was not loaded bultin plugins due to wrong choice of point where they are initialized. Currently that call is moved to first invocation of getPlugins(), which leaves no chance for such errors in the future. Difference between linux vs. windows was due to different platform-specific initialization code.

Vlad Khorsun added a comment - 26/Apr/14 04:12 PM
Reproduced and investigated.

Vlad Khorsun added a comment - 25/Apr/14 11:25 AM
Volker,
i already planned to look at it, don't worry :)

Volker Rehn added a comment - 24/Apr/14 02:00 PM
Alex, thanks for the detailed response. I have tried everything I could think of - without success. Even registered FB3 with Windows Firewall although it is a local process. Maybe it is something silly I overlooked. We have some leads so far:

- FB3 can't resolve the network connection to FB2.5, instead it tries to open the connect string as a file
- FB3 *can* connect to FB2.5 if the SP is run from within isql (I have put the exec block code into a SP to make testing easier)
- only seems to occur on windows

I am using the 32Bit-Versions of FB2.5 and FB3 on a 64Bit Win7 machine, so that legacy clients can use fbclient. FB2.5 uses the standard port 3050, FB3 is on 3053

Yes please ask Vlad to try it on windows. When the remote execute statement was first introduced in FB2.5, I was in touch with Vlad and we did thorough testing.
@Vlad: you are always welcome to email me directly for details. Once this is resolved, we can come back here with results, so the ticket is not cluttered with intermediate steps.

Alexander Peshkov added a comment - 24/Apr/14 09:30 AM
> I succeeded doing external statement from 2.5 to 3, but not from 3 to 2.5. I need to copy your setup in detail.

In firebird 3 I was using default firebird.conf & databases.conf - no changes at all. Or firebird.conf, modified exactly according to your initial description.
In 2.5 the only change was prot number - 3060, required to run both servers on same machine.

> What was your setup? Did you test on Windows?

That's probably the main difference. I have only Linux. But it should make absolutely no difference on what OS does remote EXECUTE STATEMENT run.

> Use the default firebird.conf for Firebird 3 or where did you change it?

Tried both...

> Both Firebirds on the same machine?

yes

> Running as services?

that's Linux...

> Does it matter which fbclient is used for attachment to Firebird 3?

yes, in some aspects
if non-fb3 client is used, you can't use default firebird.conf - it will not work
but I have no idea how can it affect what happens later when connection to 2.5 is tried

> Can you attach to Firebird 3 employee with Flamerobin with no changes to firebird.conf?

Yes, certainly - provided I use it with fb3 client.

**********************

Looks like no matter of how strange it looks that the problem is another OS. From initial messages I see that FB3 server failed to establish network connection to FB2.5 and made attempt to open file containing host name which certainly failed.
If you try once more and have no success I will ask Vlad to try to reproduce your problem in windows.

Volker Rehn added a comment - 23/Apr/14 04:12 PM
No luck here. I succeeded doing external statement from 2.5 to 3, but not from 3 to 2.5. I need to copy your setup in detail.
What was your setup? Did you test on Windows? Use the default firebird.conf for Firebird 3 or where did you change it? Both Firebirds on the same machine? Running as services? Does it matter which fbclient is used for attachment to Firebird 3? Can you attach to Firebird 3 employee with Flamerobin with no changes to firebird.conf?

Alexander Peshkov added a comment - 23/Apr/14 12:09 PM
I've tried using flamerobin with both 2.5 and 3.0 clients. Certainly client does not affect how does server talk to another server, i.e. everything works for me.

Volker Rehn added a comment - 23/Apr/14 11:34 AM
Ok. The execute block runs fine from within isql.
But if the "hosting" database is connected using Flamerobin or php, it fails, with the error msg above. The remote execute statement depends on how the "hosting" database was connected, it seems to inherit something it cannot use here. From Firebird 3's perspective, these are all legacy clients, maybe that's a lead.

Alexander Peshkov added a comment - 23/Apr/14 05:24 AM
Sooner of all due to ODS change (ODS may get changed at any moment before beta release). Recreate your database and try again.

Volker Rehn added a comment - 22/Apr/14 03:38 PM
Worse. With build 31074 I can't even connect to a ODS12 database using Flamerobin, which worked before with build 30809 alpha2. I get unknown isc error 335545049 and 335545081. I can retreive the server info, but not much more.

Alexander Peshkov added a comment - 21/Apr/14 09:08 AM
Can you try with fresh snapshot? Currently in trunk external statement successfully connects to 2.5 server. Moreover, you may use default firebird.conf for it (certainly with one provided by you it works too). I've tried on linux but I do not think there is something OS-dependent here.