Bug 123412 - Base: Unwanted disconnection from Firebird data source error message "connection shutdown caused by isc_service_attach"
Summary: Base: Unwanted disconnection from Firebird data source error message "connect...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.2.0.2 rc
Hardware: All macOS (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Firebird-Default
  Show dependency treegraph
 
Reported: 2019-02-12 17:46 UTC by Tim
Modified: 2023-11-06 10:19 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim 2019-02-12 17:46:54 UTC
Description:
After using LibreOffice with Text documents, if I open Base and try to access Tables, this is the message:

firebird_sdbc error:
*connection shutdown
caused by
'isc_service_attach'

Then I just shut down LibreOffice, restart, and it works.

Steps to Reproduce:
1.Work with several LibreOffice Text Documents.
2.Open Base file.
3.Try to open a Table or ejecute Forms...

Actual Results:
Error

Expected Results:
Be able to open tables, forms, queries or reports.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.2.0.3
Build ID: 98c6a8a1c6c7b144ce3cc729e34964b47ce25d62
CPU threads: 2; OS: Mac OS X 10.13.6; UI render: default; VCL: osx; 
Locale: es-ES (es_ES.UTF-8); UI-Language: en-US
Calc: threaded
Comment 1 Alex Thurgood 2019-02-13 09:00:34 UTC
@Tim : we will need more information than what you have given as currently your description is too vague.

1) "Work with several Text documents"

- what kind of work ?

- which kind of documents do you mean exactly (ODT, other file format, CSV,Excel, Calc, RTF) ?

2) "Open Base file."

- which kind of database file (hsqldb embedded, firebird embedded, some other connection to a DB engine, flat file (text) connection) ?

If the problem is caused by a particular Base file, then ideally, a copy of that file should be posted as an attachment here after removing any sensitive data.
Comment 2 Tim 2019-02-13 09:24:18 UTC
(In reply to Alex Thurgood from comment #1)
> @Tim : we will need more information than what you have given as currently
> your description is too vague.
> 
> 1) "Work with several Text documents"
> 
> - what kind of work ?
> 
> - which kind of documents do you mean exactly (ODT, other file format,
> CSV,Excel, Calc, RTF) ?
> 
> 2) "Open Base file."
> 
> - which kind of database file (hsqldb embedded, firebird embedded, some
> other connection to a DB engine, flat file (text) connection) ?
> 
> If the problem is caused by a particular Base file, then ideally, a copy of
> that file should be posted as an attachment here after removing any
> sensitive data.


Thanks!

1)

By "Text documents" I mean .ODT files.

By “work” I mean writing a newsletter, or any other thing, as a new file or editing an existing one.

2)

It happens with all my database files,, and some are hsqldb embedded and others are firebird embedded.

I think it started to happen since I merged some databases from hsqldt embedded to firebird embedded.
Comment 3 Alex Thurgood 2019-02-13 10:24:08 UTC
Unfortunately, no repro for me with :

Version: 6.2.0.3
Build ID: 98c6a8a1c6c7b144ce3cc729e34964b47ce25d62
Threads CPU : 4; OS : Mac OS X 10.14.2; UI Render : par défaut; VCL: osx; 
Locale : fr-FR (fr_FR.UTF-8); Langue IHM : fr-FR
Calc: threaded


1) Opened a first ODT documents - edited some text, saved and closed.

2) Opened StartCenter, chose a different ODT to load and edit, made some changes, saved and closed.

3) Opened an embedded hsqldb ODB file. Cancelled the migration to firebird.

4) Clicked on Tables, double-clicked on several tables, all of them opened without error.


@Vic : I can only assume that the problem reported is somehow linked to your LO user configuration profile, or that there is something more specific in what you are doing that we don't know about.
Comment 4 Alex Thurgood 2019-02-13 10:41:53 UTC
@Tim : the error message you see implies that the connection to the database engine was cut off somehow, but without further investigation, it will be difficult to nail down. A quick search with Google didn't really bring up any relevant results.
Comment 5 Tim 2019-02-13 10:50:23 UTC
(In reply to Alex Thurgood from comment #3)
> Unfortunately, no repro for me with :
> 
> Version: 6.2.0.3
> Build ID: 98c6a8a1c6c7b144ce3cc729e34964b47ce25d62
> Threads CPU : 4; OS : Mac OS X 10.14.2; UI Render : par défaut; VCL: osx; 
> Locale : fr-FR (fr_FR.UTF-8); Langue IHM : fr-FR
> Calc: threaded
> 
> 
> 1) Opened a first ODT documents - edited some text, saved and closed.
> 
> 2) Opened StartCenter, chose a different ODT to load and edit, made some
> changes, saved and closed.
> 
> 3) Opened an embedded hsqldb ODB file. Cancelled the migration to firebird.
> 
> 4) Clicked on Tables, double-clicked on several tables, all of them opened
> without error.
> 
> 
> @Vic : I can only assume that the problem reported is somehow linked to your
> LO user configuration profile, or that there is something more specific in
> what you are doing that we don't know about.


Yes, and I can do the same! But after some time it happens that then I can't access the Tables within the database! And I have no idea what could make the difference!

I understand that like that it's almost impossible to know why. If a get to find out any other hint I let you know. Thanks.
Comment 6 Tim 2019-02-14 18:19:02 UTC
To reset preferences... I've deleted LibreOffice folder in /Library/Application Support/ and didn't solve the problem.
Comment 7 Tim 2019-02-20 11:28:45 UTC
I've tried it opening LibreOffice in Safe Mode and it happens the same.
Comment 8 Tim 2019-02-25 23:02:11 UTC
Today with firebird embedded database I got the error, but not with an HSQLDB Embedded!
Comment 9 Alex Thurgood 2019-02-26 09:41:58 UTC
According to this page :

https://fossies.org/linux/Firebird/doc/Using_OO_API.html

isc_service_attach is deprecated in FB3 in favour of 
IService* attachServiceManager()

We are still using this call in many of the cxx and cpp files (e.g. burp.cpp, call_service.cpp, Connection.cxx, etc)

@Tamas : thoughts ?
Comment 10 Tim 2019-04-06 17:00:38 UTC
When I restart LibreOffice and open the database file, it seems to work ok until I open some .ODT files and after a while then I can't access the tables within the database. As it's not immediate, I don't know how many .ODT files I have to open or for how long until the error comes up in the database. So what I've seemed to find put is that the database will work well as long as I don't open .ODT files.
Comment 11 Tim 2019-04-16 11:41:04 UTC
Last testing:

- In safe mode it happens the same.

- This is NEW information: I've discovered that when I open the data base file and can work with it without getting an error message, as long as I don't close it, no error will appear even days after, and no mater what ever writer files I open and close and work on them. But if I close the database file, and open and close and edit writer files, and after that I open the data base then I'll get the error message and can't access the tables within the database.
Comment 12 Julien Nabet 2019-05-15 14:18:59 UTC
(In reply to Alex Thurgood from comment #9)
> According to this page :
> 
> https://fossies.org/linux/Firebird/doc/Using_OO_API.html
> 
> isc_service_attach is deprecated in FB3 in favour of 
> IService* attachServiceManager()
Even if it comes from Firebird, it doesn't seem about Firebird using but about using OO (so also LO) API on Firebird

> 
> We are still using this call in many of the cxx and cpp files (e.g.
> burp.cpp, call_service.cpp, Connection.cxx, etc)
> ...
Opengroking isc_service_attach:
https://opengrok.libreoffice.org/search?project=core&full=isc_service_attach&defs=&refs=&path=&hist=&type=&si=full
where it's used for attachServiceManager

Idem for isc_service_detach, only used for detachServiceManager

Did I miss something?
Comment 13 Julien Nabet 2019-05-15 14:20:40 UTC
Tim: could you give a try to 6.2.3? Indeed, perhaps https://cgit.freedesktop.org/libreoffice/core/commit/?id=6affbd2b57a336749a6a2ab3466a4e652a7ff365 may help?
Comment 14 Tim 2019-05-15 15:58:26 UTC
(In reply to Julien Nabet from comment #13)
> Tim: could you give a try to 6.2.3? Indeed, perhaps
> https://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=6affbd2b57a336749a6a2ab3466a4e652a7ff365 may help?

I'm already using 6.2.3.2
Comment 15 Alex Thurgood 2019-05-16 09:40:22 UTC
(In reply to Julien Nabet from comment #12)

> Opengroking isc_service_attach:
> https://opengrok.libreoffice.org/
> search?project=core&full=isc_service_attach&defs=&refs=&path=&hist=&type=&si=
> full
> where it's used for attachServiceManager
> 
> Idem for isc_service_detach, only used for detachServiceManager
> 
> Did I miss something?

No, that was my bad, those other cpp files came from the fb tarball. Indeed, only Connection.cxx seems to contain calls to isc_service_attach/detach.
Comment 16 Tim 2019-05-16 15:08:40 UTC
What's fanny is that if I start LibreOffice and open a base data file, as long I don't close it, it'll not give the error. I can work around with writer files (open, edit, create new files), and open other base data, and It'll go ok!

The error comes only if I work with Writer files first and after a while I open the data base!
Comment 17 Tim 2019-05-28 09:18:17 UTC
Another observation:

With a new Data Base with embedded firebird I can go to Edit -> Database -> Advanced Settings...

In a migrated Data Base with hsqldb embedded I go to Edit -> Database and then all options are in gray and can't access Advanced Settings...
Comment 18 Xisco Faulí 2019-10-21 12:17:15 UTC
Hello Tim,
Could you please try to reproduce it with the latest version of LibreOffice
from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' if the bug is still present in the latest version.
Comment 19 Tim 2019-10-22 10:26:35 UTC
Thank you Xisco for your interest.
I regularly update LibreOffice and with 6.3.2.1 it's all the same. I have the same bug.
Comment 20 Alex Thurgood 2019-11-29 06:15:26 UTC
(In reply to Tim from comment #19)
> Thank you Xisco for your interest.
> I regularly update LibreOffice and with 6.3.2.1 it's all the same. I have
> the same bug.

@Tim : just a thought, are any of the files stored on a network storage (samba, NAS, etc) or a USB key/drive ?
Comment 21 Tim 2019-12-02 10:18:25 UTC
Yes, I have my files synchronized on a NAS
Comment 22 Alex Thurgood 2019-12-02 11:00:49 UTC
(In reply to Tim from comment #21)
> Yes, I have my files synchronized on a NAS


Thanks.

I would guess that the network connection goes to sleep, and when it gets woken up, the connection to the database file is lost. This might not be a LibreOffice problem after all, but an OS issue, as the NAS or the OS you are running on should not drop the network connection (but probably does for a whole range of reasons, e.g energy saving, processor idling, etc). 

There is no automatic reconnection to an embedded database context. This is a known limitation of using databases within LibreOffice. Some database engines allow you to specify an automatic reconnect in the event of a lost connection. I don't know whether there is anywhere that you can specify such an automatic reconnect or keep-alive instruction with regard to an embedded Firebird database.
Comment 23 Alex Thurgood 2019-12-02 11:30:11 UTC
@Tim : the way to test this is to put the file on the machine you launch LibreOffice from and see whether you still get the error message, or some other kind of issue.

There was a similar bug reported recently, unfortunately can't find it again now.
Comment 24 Tim 2019-12-02 12:13:29 UTC
Thank you very much. The file I have it on the laptop from where I launch libreoffice and the bug doesn’t happen as long I don’t close the file, independently if I disconnect from NAS.
Comment 25 Julien Nabet 2019-12-02 14:43:31 UTC
Alex, I'd put WFM then, what do you think?
Comment 26 Robert Großkopf 2019-12-02 15:31:25 UTC
Could be I haven't seen the information:
Does the buggy behavior happen with registered databases?
Could be a bug together with bug 119610 - registered databases will be opened in Writer when trying to insert cross-references.
Comment 27 Alex Thurgood 2019-12-02 17:01:44 UTC
@Julien : yes, I think so, thanks, setting as such.
Comment 28 Tim 2020-03-28 17:21:01 UTC
(In reply to Robert Großkopf from comment #26)
> Could be I haven't seen the information:
> Does the buggy behavior happen with registered databases?
> Could be a bug together with bug 119610 - registered databases will be
> opened in Writer when trying to insert cross-references.

Yes, with and witout registered databases.
Comment 29 Tim 2020-05-07 12:17:11 UTC
Since last update, with version 6.4.3.2 it's much worse. I close base and soon if I open again the data base the error comes up. Before it would be after a longer time.
Comment 30 Julien Nabet 2020-05-07 12:24:10 UTC
Tim: just for curiosity, did you enable experimental features? (Menu/Tools/Advanced)
Comment 31 Tim 2020-05-07 16:20:33 UTC
(In reply to Julien Nabet from comment #30)
> Tim: just for curiosity, did you enable experimental features?
> (Menu/Tools/Advanced)

Thanks for your interest!

No I haven't. Should I try?
Comment 32 Julien Nabet 2020-05-07 16:52:49 UTC
(In reply to Tim from comment #31)
> (In reply to Julien Nabet from comment #30)
> > Tim: just for curiosity, did you enable experimental features?
> > (Menu/Tools/Advanced)
> 
> Thanks for your interest!
> 
> No I haven't. Should I try?

Yes
Comment 33 Tim 2020-05-08 09:29:13 UTC
(In reply to Julien Nabet from comment #32)
> (In reply to Tim from comment #31)
> > (In reply to Julien Nabet from comment #30)
> > > Tim: just for curiosity, did you enable experimental features?
> > > (Menu/Tools/Advanced)
> > 
> > Thanks for your interest!
> > 
> > No I haven't. Should I try?
> 
> Yes

I've done it and again "connection shutdown". It seemed to last a little bit longer before it happens, allthough this could be also beacuase I turned off "Use Java", as I only need it for Reports.
Comment 34 Julien Nabet 2020-05-08 10:12:22 UTC
Try to enable Java for the test.
I know that Firebird embedded doesn't use Java but perhaps there's a forgotten code related.
Comment 35 Julien Nabet 2020-05-08 10:15:32 UTC
For the record, on pc Debian x86-64 with master sources updated today, I got an embedded Firebird odb with a simple table and a form, I could open both with Java disabled.
Comment 36 Tim 2020-05-08 10:17:05 UTC
(In reply to Julien Nabet from comment #34)
> Try to enable Java for the test.
> I know that Firebird embedded doesn't use Java but perhaps there's a
> forgotten code related.

OK
Comment 37 Tim 2020-05-08 10:18:17 UTC
(In reply to Julien Nabet from comment #35)
> For the record, on pc Debian x86-64 with master sources updated today, I got
> an embedded Firebird odb with a simple table and a form, I could open both
> with Java disabled.

Yes, but not Reports, I think.
Comment 38 Julien Nabet 2020-05-08 10:43:18 UTC
(In reply to Tim from comment #37)
> (In reply to Julien Nabet from comment #35)
> > For the record, on pc Debian x86-64 with master sources updated today, I got
> > an embedded Firebird odb with a simple table and a form, I could open both
> > with Java disabled.
> 
> Yes, but not Reports, I think.

Indeed.

BTW, hsqldb embedded needs Java for everything since it's based on Java.
Comment 39 Tim 2020-05-08 10:48:04 UTC
By the moment it's going. Lets see later on...
Comment 40 Tim 2020-05-08 12:25:53 UTC
(In reply to Tim from comment #39)
> By the moment it's going. Lets see later on...

Sorry... After a while, again the same:

firebird_sdbc error:
*connection shutdown
caused by
'isc_service_attach'
Comment 41 Julien Nabet 2020-05-08 13:16:49 UTC
Do you know how to reproduce this?
Could it be because of a timeout? For example, you begin an action and since it takes time or if you' interrupted by something, connection shuts down.
Comment 42 Tim 2020-05-08 14:52:42 UTC
(In reply to Julien Nabet from comment #41)
> Do you know how to reproduce this?
> Could it be because of a timeout? For example, you begin an action and since
> it takes time or if you' interrupted by something, connection shuts down.

Since it's a problem I have for more than one year!, I should have noticed how and when, but it seems unpredictable.

I use LibreOffice daily, and almost every day I open one of my database, but can't find put when it will crash. I open one data bsae, then close it and after a while, using Writer, I open the database again and it may work ok or it may not. If I open it inmediatley after colsing it will not give the error.
Comment 43 Tim 2020-05-08 16:24:14 UTC
This is the result of observation this evening:

16:54 h.
-Restart LibreOffice
-Open 3 Writer docs.
-Open 1 Spreadsheet.
-Open DataBase --> OK --> Close
-Don't touch LibreOffice files
-Just open one more Writer file

17:37 h.
-Open DataBase --> OK --> Close
-Start writing on a Writer file all ready opened al 16:54 h.

18:19 h.
-Open DataBase --> ERROR
Comment 44 Tim 2020-05-15 10:48:27 UTC
Even for several days, as long as I don't close the database file (I don't turn off my computer), it works ok, no error!
Comment 45 Tim 2020-05-15 10:52:41 UTC
And I can open other data base files and close them, and reopen, as long as I keep one working open.
Comment 46 Julien Nabet 2020-05-15 11:06:42 UTC
can't help here and meanwhile we put back Firebird experimental, too brittle=>uncc myself
Comment 47 Alex Thurgood 2020-09-28 07:59:06 UTC
From the description of the behaviour, this sounds like a connection context switching issue. Open/closing the database repeatedly, over a period of time, in between opening and editing other files, seems to completely dispose of the db conection context. Unfortunately, it might be due to the way the OS does RAM cleanup when a file is closed, and/or the time between closing and reopening the ODB file. 

Clearly this is not ideal, but we need some way to be able to nail down precisely how to reproduce the issue, as otherwise there is no way to move forwards.
Comment 48 Tim 2020-09-28 19:13:12 UTC
(In reply to Alex Thurgood from comment #47)
> From the description of the behaviour, this sounds like a connection context
> switching issue. Open/closing the database repeatedly, over a period of
> time, in between opening and editing other files, seems to completely
> dispose of the db conection context. Unfortunately, it might be due to the
> way the OS does RAM cleanup when a file is closed, and/or the time between
> closing and reopening the ODB file. 
> 
> Clearly this is not ideal, but we need some way to be able to nail down
> precisely how to reproduce the issue, as otherwise there is no way to move
> forwards.

Thanks. What you say makes sense. But the thing is that even watching many times how it happens I cant guess exactly how it could be reproduced. Apparently it happens randomly, but obviously there mus be some steps to follow...

Would it be a good idea to open with OpenOffice to see if its the same, or that may even do it worse?
Comment 49 Xisco Faulí 2021-11-23 11:08:56 UTC
Hello Tim,
Could you please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the latest version.
Comment 50 Tim 2021-11-24 10:36:27 UTC
Thanks Xisco, for keep on caring about this issue.
Yes I always update Libreoffice to the last version, and the bug still happens.
Comment 51 Buovjaga 2023-01-24 16:08:22 UTC
(In reply to Alex Thurgood from comment #9)
> According to this page :
> 
> https://fossies.org/linux/Firebird/doc/Using_OO_API.html
> 
> isc_service_attach is deprecated in FB3 in favour of 
> IService* attachServiceManager()
> 
> We are still using this call in many of the cxx and cpp files (e.g.
> burp.cpp, call_service.cpp, Connection.cxx, etc)

Link is dead, source seems to be https://github.com/FirebirdSQL/firebird/blob/master/doc/Using_OO_API.html
Comment 52 Alex Thurgood 2023-10-13 14:34:22 UTC
Probably the only way to try and find out what is going on would be to have a trace log on the FDB file - but is that even possible in an embedded Firebird context ?

Disposing of the database context during an active LO session with other documents being opened and closed must happen at some time during the lifecycle of the session, otherwise the DB context would remain in RAM all of the time and potentially end up eating all of the resources. That cleanup would presumably be OS-dependent, so another way to find out would be to get LO running under the Instruments.app and see whether there were any sudden drops in RAM usage in the running soffice process.

Unfortunately, running LO in Instruments.app and attempting to work normally with multiple documents is generally excruciatingly slow with anything but an uber-powerful machine.
Comment 53 Tim 2023-10-13 19:43:57 UTC
Thanks for not forgetting!

I have Libreoffice 7.6.2.1 and still happens the same.

Today I tryed to see if I could find out when it happens... What I've seen is that I can add data, modify forms, close and open the data base, open and cloe Writer, etc., and it will go ok. But the bug comes up when I open the data base after some time, may be more than an hour! So it looks like, at least in part, it's a cuestion of time!
Comment 54 Tim 2023-10-13 19:46:39 UTC
And during that hour or more, I've been all the time working on a Writer document, so it didn't sleep nor...
Comment 55 Tim 2023-10-16 17:40:54 UTC
New observation:

The bug happens with any of my several data base, and seems it just seems to happen after a certain amount of time, and has nothing to do with edition or modifying data in the data base. After a day doing no change in the data base it happens. During that time I've been working with Writer, Spreadsheet and Presentation files, but not with daa bases.

Although the data base is on my laptops hard disc, I also have running a Synology Drive, and I've seen that just opening the data base the file appears in the list as reacently modifyed. Perhaps that has something to do with the issue, as the errior message is about connection to the data source?:

The connection to the data source "Miembros_Contactos" could not be established.

firebird_sdbc error:
*connection shutdown
caused by
'isc_service_attach'

Error code: 1
Comment 56 Tim 2023-11-04 20:34:22 UTC
More observation:

I think that as long I do no modification on the data base there is no problem.

When I do any modification, and Synology NAS also updates the file, for some time, I still can close and open the data base without problem. The bug seems to appear misteriously just when more time has gone by.
Comment 57 Tim 2023-11-06 08:56:00 UTC
More observation... I've been making some inputs in a data base, and after two days no error! So that adds mistery as to when and why the bug happens!
Comment 58 Tim 2023-11-06 10:19:55 UTC
And now, after some time, without any input on the data base, I have again the bug! Meanwile what I've been doing is editing a Writer document. Is the only thing I seem to be able to relate.