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

When saving: The libary has been modified by another program #4877

Open
1 task done
Tracked by #8750
JoKalliauer opened this issue Apr 9, 2019 · 230 comments · Fixed by #5838, #8239, #9067 or #11282
Open
1 task done
Tracked by #8750

When saving: The libary has been modified by another program #4877

JoKalliauer opened this issue Apr 9, 2019 · 230 comments · Fixed by #5838, #8239, #9067 or #11282
Assignees
Labels
bug Confirmed bugs or reports that are very likely to be bugs export / save
Milestone

Comments

@JoKalliauer
Copy link
Contributor

JoKalliauer commented Apr 9, 2019

Edit:
JabRef 5.0, 5.1, 5.2, 5.4 till current version (Nov2021) is affected.

If you add a comment please add

  • your operating system
  • encoding of the document (e.g. ASCII, ANSI, ISO-8859, UTF-16 , ...)
  • the line-seperators used in the file (lineforward or cariage-return or both or mixed)
  • the settings of Options > Preferences > File
    -- (a) Newline seperator (try LineForward)
    -- (b) Always reformat BIB file on save and export (try disabling)
    -- (c) Autosave local libraries (try disabling)

Original post

JabRef 5.0-dev--snapshot--2019-04-09--master--0dd091f31
Linux 4.15.0-47-generic amd64 
Java 1.8.0_201

Ubuntu 18.04

Steps to reproduce the behavior: (same as #4810 )

  1. open .bib-file
  2. press "ctrl" & "s"
  3. Repeat step 2 till Bug appears.
  4. The message "The library has been modified by another program" appears
  5. DO NOT accept the changes, otherwise all entries will be doubled (click dismiss)
    Screenshot from 2019-04-09 16-57-25
    Screenshot from 2019-04-09 16-57-34
Log File
Opening: /home/jkalliau/Desktop/Jabrefissue/LargeFile.bib
Can only load style files: Preview
Vorschaustil geändert zu: Vorschau
Speichere Bibliothek...
Opening: /tmp/jabref2591679195168273738.bib
Opening: /home/jkalliau/Desktop/Jabrefissue/LargeFile.bib
Bibliothek gespeichert '/home/jkalliau/Desktop/Jabrefissue/LargeFile.bib'.
Terminal
16:45:54.405 [JavaFX Application Thread] INFO  org.jabref.logic.importer.OpenDatabase - Opening: /home/jkalliau/Desktop/Jabrefissue/LargeFile.bib
16:45:54.963 [JavaFX Application Thread] ERROR org.jabref.logic.citationstyle.CitationStyle - Can only load style files: Preview
16:45:55.220 [JavaFX Application Thread] INFO  org.jabref.gui.FXDialogService - Vorschaustil geändert zu: Vorschau
16:46:06.495 [JavaFX Application Thread] INFO  org.jabref.gui.FXDialogService - Speichere Bibliothek...
16:46:06.524 [pool-3-thread-2] INFO  org.jabref.logic.importer.OpenDatabase - Opening: /tmp/jabref2591679195168273738.bib
16:46:06.526 [pool-3-thread-2] INFO  org.jabref.logic.importer.OpenDatabase - Opening: /home/jkalliau/Desktop/Jabrefissue/LargeFile.bib
16:46:06.530 [JavaFX Application Thread] INFO  org.jabref.gui.FXDialogService - Bibliothek gespeichert '/home/jkalliau/Desktop/Jabrefissue/LargeFile.bib'.
16:53:39.039 [JavaFX Application Thread] INFO  org.jabref.gui.FXDialogService - In die Zwischenablage kopiert
@bernhard-kleine
Copy link

This is most interesting since you work with Linux. Obviously the error is indepent of the operation system.

@wujastyk
Copy link

Me too. :-(

@wujastyk
Copy link

Could this be something to do with Dropbox? I guess the Dropbox application (nemo-dropbox in Linux Mint) runs some kind of file-checking background task, and maybe JabRef is sensing that?

Is anyone who sees this "library modified" popup behaviour not run Dropbox?

@JoKalliauer
Copy link
Contributor Author

@wujastyk : I storred it locally on the desktop, therefore it is not reletated to any sync-program.
Please also read @bernhard-kleine : comment: #4810 (comment)

@wujastyk
Copy link

wujastyk commented May 12, 2019 via email

@sfo
Copy link
Contributor

sfo commented Jun 11, 2019

I can confirm this issue. It appears for files outside Dropbox, as well as for files within Dropbox and paused synchronization.

For me, it is independent from timing. I have the files on SSD. After editing, no matter how long, I save the file and the message appears.


JabRef 5.0-dev--snapshot--2019-06-10--master--eb42850f7
Linux 4.4.0-150-generic amd64
Java 1.8.0_212
Ubuntu 16.04

@JoKalliauer
Copy link
Contributor Author

@sfo: How large is your libary? (filesize/entries)

@wujastyk
Copy link

wujastyk commented Jun 12, 2019 via email

@sfo
Copy link
Contributor

sfo commented Jun 13, 2019

@JoKalliauer here is a minimum working example:

% Encoding: UTF-8

@Article{,
}

@Comment{jabref-meta: databaseType:biblatex;}

@gitcanzo
Copy link

gitcanzo commented Sep 5, 2019

Same issue here (also using Jabref 5.0-dev). The message appears every time I save my library (even if no changes have been made). I do not have a big library, just about 100 entries. If I save the changes, all my entries are duplicated. My bib file is on a cloud folder (MEGA cloud, although that does not seem to be the issue). I am running Ubuntu Mate 19.04

@Siedlerchr
Copy link
Member

Please check if you any save actions (library properties) or autosave enabled (preferences)

@gitcanzo
Copy link

gitcanzo commented Sep 5, 2019

Please check if you any save actions (library properties) or autosave enabled (preferences)

Both save actions and autosave are disabled. The issue persists

@AEgit
Copy link

AEgit commented Sep 8, 2019

JabRef 5.0-dev
Linux 5.0.0-27-generic amd64
Java 1.8.0_222

Can confirm this issue using the minimum example provided here (#4877 (comment)) by @sfo

"Save actions" are NOT enabled. "Autosave" is also NOT enabled.

Since the minimum example contains just one entry and I have stored the database on a fast M.2 SSD, this issue does not seem to be related to the size of the database or slow hardware.

@AEgit
Copy link

AEgit commented Sep 12, 2019

JabRef 5.0-dev
Linux 5.0.0-27-generic amd64
Java 11.0.4

Can confirm that this is still an issue with the current --edge snap version using Java 11 (I am just reporting this in case someone thought the switch to Java 11 had solved the problem). The minimum working example of @sfo (#4877 (comment)) is enough to be able to trigger this problematic behaviour.

@koppor
Copy link
Member

koppor commented Oct 20, 2019

Refs #5085

@koppor koppor self-assigned this Oct 20, 2019
@Krzmbrzl
Copy link

JabRef 5.0.0-dev--2019-10-25----681d6aa6f
Linux 5.0.0-32-generic amd64 
Java 12.0.2

I can also confirm the bug. Happens every time to me though. If I can help by providing more information, just state what you'd need :)

@koppor
Copy link
Member

koppor commented Oct 27, 2019

@Krzmbrzl Thank you for the feedback and offer. I have a long-termin solution in my mind (see #5257 (comment)), but currently did not find the time to do it.

@tobiasdiez
Copy link
Member

@Krzmbrzl you have coding experience, right? This bug is a bit hard to fix for us since non of the core developers can reproduce it. So it would be nice if you could try to debug it and find the origin of the problem (and in the best case also provide a solution).

@Krzmbrzl
Copy link

I do. However I am very busy atm and I'm afraid won't find the time necessary to do so properly... Plus I think I can't even set it up on my machine as I don't have JDK 12 available on my system

@tobiasdiez
Copy link
Member

Sure, no problem. In case you find bit of time, you find everything that you need to setup the build locally here: https://github.com/JabRef/jabref/wiki/Guidelines-for-setting-up-a-local-workspace

@reox
Copy link
Contributor

reox commented Oct 28, 2019

I have this issue too:

JabRef 5.0.0-dev--2019-10-25----b8d00f2bd
Linux 5.2.0-3-amd64 amd64 
Java 12.0.2

unfortunately I dont see any log output, as the debian package from the snapshots does not ship with log4j:

ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...

I suspected that maybe the noatime flag on my filesystem might causing this, but I verified on another filesystem with relatime that I get this message too.

@JoKalliauer
Copy link
Contributor Author

@Krzmbrzl you have coding experience, right? This bug is a bit hard to fix for us since non of the core developers can reproduce it. So it would be nice if you could try to debug it and find the origin of the problem (and in the best case also provide a solution).

As a provisional workaround you can just add a button in the preferences to dissable the changes-feature.

@koppor
Copy link
Member

koppor commented Oct 28, 2019

Related:

00:03:19.723 [pool-9-thread-1] ERROR org.jabref.logic.autosaveandbackup.BackupManager - Error while saving to fileC:\TEMP\del.me.bib.sav
java.nio.file.FileSystemException: C:\TEMP\del.me.bib.sav -> C:\TEMP\del.me.bib.sav.bak: Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird.

We should remove the sav and bak feature. This is so 2000. I forced to keep it in 2015, but I regret it now. Version control and backup feature are now common things.

Maybe, if we just remove bak and sav (and directly save to bib), all these change detection issues could be resolved.

@wujastyk
Copy link

JabRef 5.14--2024-05-20--18c3a55
Linux 6.5.0-35-generic amd64
Java 21.0.2
JavaFX 22.0.1+7

Screenshot from 2024-05-20 09-16-32

This message is popping up all the time with the current test JR version (and versions for the last week or two). I've tried switching on and off the backup/autosave/autoreformat settings in different combinations, with no improvement. The message pops up multiple time even while editing a single entry. I have to hit "dismiss" to move on.

@koppor
Copy link
Member

koppor commented May 21, 2024

@wujastyk What is the result of "Review changes"?

@koppor koppor reopened this May 21, 2024
@wujastyk
Copy link

wujastyk commented May 22, 2024

@wujastyk What is the result of "Review changes"?

JabRef 5.14--2024-05-17--b12f65c
Linux 6.5.0-35-generic amd64
Java 21.0.2
JavaFX 22.0.1+7

I started a new book entry. The message popped up, and I looked at "review changes":

image

As you see, the JabRef version has the citation key and the citationkey field.

Here's another:

image

@reox
Copy link
Contributor

reox commented May 27, 2024

I saw this again several times now with

JabRef 5.13--2024-04-01--6bdcf63
Windows 11 10.0 amd64 
Java 21.0.2 
JavaFX 22+30

But I cannot even recognize anything that has changed:
image

Did I overlooked something or are these exactly the same contents?

@Siedlerchr
Copy link
Member

This could be some whitespace/line ending stuff e..g \r\n vs \n

@wujastyk
Copy link

JabRef 5.14--2024-05-27--e1da33d
Linux 6.5.0-35-generic amd64
Java 21.0.2
JavaFX 22.0.1+7

I'm sorry to shout, but this is driving me mad. I get this popup every time I edit an entry. When I choose "merge" to see what's going on, I frequently get something like this:

image

or - very often - no difference at all between the two merge columns.

It's not an issue of line-endings. All my files are thoroughly unix (and I've double checked).

@Siedlerchr Siedlerchr modified the milestones: 5.13, 5.14 May 28, 2024
@Siedlerchr Siedlerchr moved this from Done to High priority in Prioritization May 28, 2024
@wujastyk
Copy link

wujastyk commented Jun 3, 2024

JabRef 5.14--2024-06-03--67f74a3
Linux 6.5.0-35-generic amd64
Java 21.0.2
JavaFX 22.0.1+7

Every time I save a new entry, I get the "modified by another program" popup. When I look at "merge" I see that it's always (almost always?) the field with the attached file that is causing the error message. I cannot see any difference in the field contents, but perhaps this is a clue to the issue?

image

@koppor
Copy link
Member

koppor commented Jun 3, 2024

Sorry to hear. It seems, we need a "trial and error" now. We are creating a debug version at #11355. -- The log of JabRef should show "Differences detected" if differences have been detected. Maybe, these can be used to check the cause. Could you please download the binary from there and report the output?

@koppor
Copy link
Member

koppor commented Jun 3, 2024

But I cannot even recognize anything that has changed:

@reox Could you please click on "Merge entries"? That dialog has a visual indicator what's changed. See screenshot of #4877 (comment).

@wujastyk
Copy link

wujastyk commented Jun 3, 2024

I fetched 11355:
JabRef 5.14-PullRequest11355.166--2024-06-03--d97c29b
Linux 6.5.0-35-generic amd64
Java 21.0.2
JavaFX 22.0.1+7

I didn't get the popup just adding a new entry without an attached file. But when I added the file, I got the popup.

Screenshot from 2024-06-03 16-18-21

Screenshot from 2024-06-03 16-18-33

And here's the log:

jabref.log

@Siedlerchr
Copy link
Member

Thanks for the info. I put both into a test to see the visual differences and checked it with a hex editor, turns out it's an additional space before the word Contestation.
If you switch to "highlight characters" it will also highlight the position.

grafik

How did you add the file?

  1. Automatic download?
  2. Manual via + sign in general tab or Drag and drop?
  3. What is your citation key pattern?

@wujastyk
Copy link

wujastyk commented Jun 4, 2024

JabRef 5.14-PullRequest11355.166--2024-06-03--d97c29b
Linux 6.5.0-35-generic amd64
Java 21.0.2
JavaFX 22.0.1+7

Now I have a situation where the popup happens every time I save, even when there are no changes at all, even when I'm not editing the entry that pops up.

jabref-2024-06-04_12.48.19.mp4

@wujastyk
Copy link

wujastyk commented Jun 5, 2024

How did you add the file?

1. Automatic download?

2. Manual via + sign in general tab or Drag and drop?

3. What is your citation key pattern?

Great catch!

I added the file from my disk using the General tab and hitting the little + sign in the "file" field. Your no. 2 above. Not drag and drop.

My citation key pattern is [auth4:lower]-[year] (and I remove "-" from the "remove the following characters" group.

I have
image

@wujastyk
Copy link

wujastyk commented Jun 7, 2024

JabRef 5.14--2024-05-29--6a63990
Linux 6.5.0-35-generic amd64
Java 21.0.2
JavaFX 22.0.1+7

This was an odd case. I deleted a short dummy entry "fo", and then got a popup saying that the library had been modified by another program. There was no attached PDF and the entry was very simple (a glossary entry for bib2gls). So it looked like I deleted the entry and then another program (?) added it again. I pressed "accept" and indeed the "fo" entry was back in the database. I deleted it a second time and then it stayed gone and there was no popup.

image

@Siedlerchr
Copy link
Member

You are using dropbox, right?

@wujastyk
Copy link

wujastyk commented Jun 7, 2024 via email

@koppor
Copy link
Member

koppor commented Jun 12, 2024

Also happens when assigning a paper to a group

image

@koppor koppor mentioned this issue Jun 14, 2024
6 tasks
@koppor
Copy link
Member

koppor commented Jun 14, 2024

@wujastyk could you try #11282?

Update: Autosave does not yet work for the fix, so no need to try.

@wujastyk
Copy link

Oh, I already did. The old issue did not appear, but there was a new glitch. Adding a PDF and saving: the link to the PDF stopped working.

jabref02-2024-06-15_17.46.42.mp4

@koppor
Copy link
Member

koppor commented Jun 16, 2024

@wujastyk Thank you for testing! It were the two spaces in the file name. JabRef shrinks them to one; which is OK for text fields, but not for file paths 😅

I fixed it just now. Build should be available in 15 minutes.

@github-project-automation github-project-automation bot moved this from High priority to Done in Prioritization Jun 17, 2024
@wujastyk
Copy link

JabRef 5.16--2024-08-13--70495a2
Linux 6.8.0-40-generic amd64
Java 21.0.2
JavaFX 22.0.2+4

"autosave local libraries" turned off.

  1. start a new entry
  2. type some data
  3. wait a bit while doing something else
  4. error message "the library has been modified by another program" pops up.

The merge screen shows that the "in jabref" data is ahead of the "on disk" data. And JabRef is

  1. not saving immediately,
  2. then reading the disk data and comparing with the in-memory data and
  3. then throwing the warning.

I think that step 2 is premature. And JabRef thinks that the data I've typed since the last save is modification "by another program".

image

@koppor koppor reopened this Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment