From: Jiří Č. <ji...@ci...> - 2017-12-07 14:23:48
|
Hi *, I'm getting, for quite some time, "Database is probably already opened by another engine instance in another Windows session" on servers (2x 2.5.7, 1x 3.0.3 (although it's less common here)). The problem is, that the database is only accessed via TCP/IP from local webserver(s). The only unusual thing about the servers is the "sharding" - there's about 200 DBs on each and the connections are often very short (few seconds tops) to all databases. Is there a way I can figure out what's going on? -- Mgr. Jiří Činčura https://www.tabsoverspaces.com/ |
From: Vlad K. <hv...@us...> - 2017-12-07 14:33:37
|
07.12.2017 16:23, Jiří Činčura wrote: > Hi *, > > I'm getting, for quite some time, "Database is probably already opened > by another engine instance in another Windows session" on servers (2x > 2.5.7, 1x 3.0.3 (although it's less common here)). The problem is, that > the database is only accessed via TCP/IP from local webserver(s). The > only unusual thing about the servers is the "sharding" - there's about > 200 DBs on each and the connections are often very short (few seconds > tops) to all databases. Is there a way I can figure out what's going on? This message come from XNET listeners which can't create named object in shared memory. You may ignore it if you don't use XNET at given Firebird instance. Or, you may disable XNET: add switch -i to the command line of firebird executable. Also, you may set IPCName setting in firebird.conf to the different values at every firebird instance (client should have same setting to be able to connect). Regards, Vlad |
From: Jiří Č. <ji...@ci...> - 2017-12-07 14:48:21
|
> This message come from XNET listeners which can't create named object > in > shared memory. You may ignore it if you don't use XNET at given Firebird > instance. Or, you may disable XNET: add switch -i to the command line of Thanks. I'll add that. Maybe there's some bad application there. This will clearly show it. > firebird executable. Also, you may set IPCName setting in firebird.conf > to > the different values at every firebird instance (client should have same > setting to be able to connect). There's only one instance on the each server. -- Mgr. Jiří Činčura https://www.tabsoverspaces.com/ |
From: Jiří Č. <ji...@ci...> - 2017-12-07 15:16:27
|
Nope. Still happening. Even with `-i`. -- Mgr. Jiří Činčura https://www.tabsoverspaces.com/ |
From: Vlad K. <hv...@us...> - 2017-12-07 15:35:54
|
07.12.2017 17:16, Jiří Činčura wrote: > Nope. Still happening. Even with `-i`. Hmm... i was not attentive enough, error is about database not about listener. It means that one engine instance is already open database and another instance going to open it too and both instances runs in different windows sessions. For example, one instance run in user session (for ex. embedded connection) and second instance run as a service. Regards, Vlad |
From: Molnár A. <am...@mv...> - 2017-12-08 07:28:59
|
This might be a GC/sweep issue http://tracker.firebirdsql.org/browse/CORE-4751 http://tracker.firebirdsql.org/browse/CORE-4745 On 2017.12.07 16:35, Vlad Khorsun via Firebird-devel wrote: > 07.12.2017 17:16, Jiří Činčura wrote: >> Nope. Still happening. Even with `-i`. > > Hmm... i was not attentive enough, error is about database not about > listener. > > It means that one engine instance is already open database and > another instance > going to open it too and both instances runs in different windows > sessions. > > For example, one instance run in user session (for ex. embedded > connection) > and second instance run as a service. > > Regards, > Vlad > > ------------------------------------------------------------------------------ > > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > Firebird-Devel mailing list, web interface at > https://lists.sourceforge.net/lists/listinfo/firebird-devel |
From: Jiří Č. <ji...@ci...> - 2017-12-07 17:15:38
|
> For example, one instance run in user session (for ex. embedded > connection) > and second instance run as a service. That was original idea for hunting - disabling that somehow and then waiting where something breaks. I'm at least blindly trying to find some application doing this. Also sometimes the error pops up from "on connect" or "on begin transaction" trigger, not when attaching. Right now for example: At trigger 'DBCONNECT' line: 6, col: 3 ---> Database is probably already opened by another engine instance in another Windows session This trigger is only accessing MON$ATTACHMENTS. -- Mgr. Jiří Činčura https://www.tabsoverspaces.com/ |
From: Vlad K. <hv...@us...> - 2017-12-07 17:57:51
|
07.12.2017 19:15, Jiří Činčura wrote: >> For example, one instance run in user session (for ex. embedded >> connection) >> and second instance run as a service. > > That was original idea for hunting - disabling that somehow and then > waiting where something breaks. I'm at least blindly trying to find some > application doing this. You may detect embedded connection in ON CONNECT trigger using RDB$GET_CONTEXT('SYSTEM', 'NETWORK_PROTOCOL') it returns NULL for embedded connection. > Also sometimes the error pops up from "on connect" or "on begin > transaction" trigger, not when attaching. Right now for example: > At trigger 'DBCONNECT' line: 6, col: 3 ---> Database is probably already > opened by another engine instance in another Windows session > This trigger is only accessing MON$ATTACHMENTS. This is very strange. Does it put corresponding message into firebird.log ? If yes - how exactly it looks ? Regards, Vlad |
From: Jiří Č. <ji...@ci...> - 2017-12-07 18:02:26
|
> This is very strange. Does it put corresponding message into > firebird.log ? > If yes - how exactly it looks ? Cannot initialize the shared memory region Database is probably already opened by another engine instance in another Windows session -- Mgr. Jiří Činčura https://www.tabsoverspaces.com/ |
From: Vlad K. <hv...@us...> - 2017-12-07 22:46:56
|
07.12.2017 20:02, Jiří Činčura wrote: >> This is very strange. Does it put corresponding message into >> firebird.log ? >> If yes - how exactly it looks ? > > Cannot initialize the shared memory region > Database is probably already opened by another engine instance > in another Windows session > I.e. it is failed to initialize shared memory for monitoring snapshot. I can't explain how it is possible to initialize lock manager shared memory first and then fail to initialize shared memory for monitoring snapshot. Need more time to investigate it. Regards, Vlad |
From: Jiří Č. <ji...@ci...> - 2017-12-17 15:34:00
|
> I.e. it is failed to initialize shared memory for monitoring snapshot. > I can't explain how it is possible to initialize lock manager shared > memory > first and then fail to initialize shared memory for monitoring snapshot. > Need more time to investigate it. Any progress on this? -- Mgr. Jiří Činčura https://www.tabsoverspaces.com/ |
From: Vlad K. <hv...@us...> - 2017-12-18 10:34:09
|
17.12.2017 17:33, Jiří Činčura wrote: >> I.e. it is failed to initialize shared memory for monitoring snapshot. >> I can't explain how it is possible to initialize lock manager shared >> memory >> first and then fail to initialize shared memory for monitoring snapshot. >> Need more time to investigate it. > > Any progress on this? Yes. I can explain how it happens but it will not solve your issue, unfortunately. In short: it could happen if Firebird service opens database and initialize lock manager, then embedded process opens same database and initialize monitoring snapshot. Then, when Firebird service need to open montoring shapshot's shared memory, it fails, because mapped file object already created in another (isolated) windows session. I already explained this issue in this list: look for then message "SeCreateGlobalObjects, Vista's UAC and Firebird" at 7 Aug 2009. That message at the very end contains recommendations what to do in cases like yours: ---------- If some application using embedded engine needs to work with the same database from different users sessions (for ex. at terminal server) we could recommend following : a) users from the Administrators group must run such application with elevated privileges b) standard users could be granted SeCreateGlobalObjects privilege directly or by including them into special users group which have this privilege granted. ---------- Hope it helps, Vlad |
From: Jiří Č. <ji...@ci...> - 2017-12-18 12:26:23
|
Right now I isolated the databases, so only apps from the same session (0) are accessing the database and always via TCP/IP. I'm afraid it's something else. -- Mgr. Jiří Činčura https://www.tabsoverspaces.com/ |
From: Vlad K. <hv...@us...> - 2017-12-20 09:06:17
|
18.12.2017 14:26, Jiří Činčura wrote: > Right now I isolated the databases, so only apps from the same session > (0) are accessing the database and always via TCP/IP. I'm afraid it's > something else. I found one change in v3 not backported into v2.5 which could be related to this issue. Could you check if it is still happens with v3 after you isolated the databases (what do you mean by this, btw) ? Regards, Vlad |
From: Jiří Č. <ji...@ci...> - 2017-12-20 09:16:08
|
> v3 after you isolated the databases (what do you mean by this, btw) ? I'm keeping eye on v3. For sure it's not often. But I think I saw it even on 3 before. Will wait a week or so to see whether it happens or not. Isolated: I went through all apps and made sure these are using network connection and to be extra sure, all apps are now running in session 0. -- Mgr. Jiří Činčura https://www.tabsoverspaces.com/ |
From: Vlad K. <hv...@us...> - 2017-12-20 09:22:17
|
20.12.2017 11:16, Jiří Činčura wrote: >> v3 after you isolated the databases (what do you mean by this, btw) ? > > I'm keeping eye on v3. For sure it's not often. But I think I saw it even on 3 before. Will wait a week or so to see whether it happens or not. > > Isolated: I went through all apps and made sure these are using network connection and to be extra sure, all apps are now running in session 0. > I can make build of v2.5 with that patch from v3 for you, if you wish. Regards, Vlad |
From: Jiří Č. <ji...@ci...> - 2017-12-20 09:23:24
|
> I can make build of v2.5 with that patch from v3 for you, if you wish. That would help. Because on 2.5 it's happening daily even hourly. -- Mgr. Jiří Činčura https://www.tabsoverspaces.com/ |
From: Jiří Č. <ji...@ci...> - 2017-12-26 09:45:47
|
Looks like the issue is not happening in nightly 3.0.3 (about two weeks old). -- Mgr. Jiří Činčura https://www.tabsoverspaces.com/ |
From: Vlad K. <hv...@us...> - 2017-12-26 14:48:39
|
26.12.2017 11:45, Jiří Činčura wrote: > Looks like the issue is not happening in nightly 3.0.3 (about two weeks old). Good to know, thanks. Meanwile, i'm trying to reproduce it on v2.5.8 using test case from CORE-4680. No luck so far. Regards, Vlad |
From: Vlad K. <hv...@us...> - 2017-12-26 22:38:39
|
26.12.2017 16:48, Vlad Khorsun via Firebird-devel wrote: > 26.12.2017 11:45, Jiří Činčura wrote: >> Looks like the issue is not happening in nightly 3.0.3 (about two weeks old). > > Good to know, thanks. Meanwile, i'm trying to reproduce it on v2.5.8 using test > case from CORE-4680. No luck so far. Found another issue with events (could be related with your case) and patch also was not backported into v2.5. Could you try next snapshot build of v2.5.8 ? Regards, Vlad |
From: Vlad K. <hv...@us...> - 2018-01-19 10:22:36
|
27.12.2017 0:38, Vlad Khorsun via Firebird-devel wrote: > 26.12.2017 16:48, Vlad Khorsun via Firebird-devel wrote: >> 26.12.2017 11:45, Jiří Činčura wrote: >>> Looks like the issue is not happening in nightly 3.0.3 (about two weeks old). >> >> Good to know, thanks. Meanwile, i'm trying to reproduce it on v2.5.8 using test >> case from CORE-4680. No luck so far. > > Found another issue with events (could be related with your case) and patch also > was not backported into v2.5. Could you try next snapshot build of v2.5.8 ? Any news ? Regards, Vlad |
From: Jiří Č. <ji...@ci...> - 2018-01-21 05:42:55
|
Not yet. The 2.5.8 update on servers is still on my todo. Also I had to add some retry logic for this error, so now it's harder to spot it, unless is occurs multiple times (which it often does not, hence the retry usually helps). -- Mgr. Jiří Činčura https://www.tabsoverspaces.com/ On Fri, Jan 19, 2018, at 11:22, Vlad Khorsun via Firebird-devel wrote: > 27.12.2017 0:38, Vlad Khorsun via Firebird-devel wrote: > > 26.12.2017 16:48, Vlad Khorsun via Firebird-devel wrote: > >> 26.12.2017 11:45, Jiří Činčura wrote: > >>> Looks like the issue is not happening in nightly 3.0.3 (about two weeks old). > >> > >> Good to know, thanks. Meanwile, i'm trying to reproduce it on v2.5.8 using test > >> case from CORE-4680. No luck so far. > > > > Found another issue with events (could be related with your case) and patch also > > was not backported into v2.5. Could you try next snapshot build of v2.5.8 ? > > Any news ? > > Regards, > Vlad > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > Firebird-Devel mailing list, web interface at > https://lists.sourceforge.net/lists/listinfo/firebird-devel |
From: Jiří Č. <ji...@ci...> - 2018-01-28 08:44:39
|
Sadly it has happened again few hours ago. 2.5.8 x64, running on Windows Server. -- Mgr. Jiří Činčura https://www.tabsoverspaces.com/ |
From: Vlad K. <hv...@us...> - 2018-01-29 09:58:09
|
28.01.2018 10:44, Jiří Činčura wrote: > Sadly it has happened again few hours ago. 2.5.8 x64, running on Windows Server. Sad. I'll backport shared memory initialization from v3 Regards, Vlad |