Community
Participate
Working Groups
It happens frequently in UI tests running with tycho 0.19.0 !ENTRY org.eclipse.core.jobs 4 2 2014-02-04 12:27:42.785 !MESSAGE An internal error occurred during: "Periodic workspace save.". !STACK 0 java.lang.NumberFormatException: null at java.lang.Integer.parseInt(Integer.java:454) at java.lang.Integer.<init>(Integer.java:677) at org.eclipse.core.internal.resources.SaveManager.validateMasterTableBeforeSave(SaveManager.java:1561) at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1229) at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1221) at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1198) at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1110) at org.eclipse.core.internal.resources.DelayedSnapshotJob.run(DelayedSnapshotJob.java:51) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53) !ENTRY org.eclipse.core.jobs 4 2 2014-02-04 12:47:42.986 !MESSAGE An internal error occurred during: "Periodic workspace save.". !STACK 0 java.lang.NumberFormatException: null at java.lang.Integer.parseInt(Integer.java:454) at java.lang.Integer.<init>(Integer.java:677) at org.eclipse.core.internal.resources.SaveManager.validateMasterTableBeforeSave(SaveManager.java:1561) at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1229) at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1221) at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1198) at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1110) at org.eclipse.core.internal.resources.DelayedSnapshotJob.run(DelayedSnapshotJob.java:51) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Thank you for this bug report. This is very interesting, especially that there is a dedicated check that should prevent from the NPE. Do you have any steps that can lead to this exception? What JVM do you use?
And also, what is the version of org.eclipse.core.resources plugin that you use?
I am running UI tests in tycho using Oracle Java java version "1.7.0_51" Java(TM) SE Runtime Environment (build 1.7.0_51-b13) Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode) and resources bundle is org.eclipse.core.resources-3.9.0.v20140109-1640.jar I have no steps, I wish I would. It looks like race condition and something clears masterTable.
Thanks! As far as I can see, there is no tag equivalent to 3.9.0.v20140109-1640 in our public git repository, so could you please double-check what the content of line 1561 of SaveManager.java is?
private void validateMasterTableBeforeSave(java.io.File target) throws IOException { if (target.exists()) { MasterTable previousMasterTable = new MasterTable(); SafeChunkyInputStream input = new SafeChunkyInputStream(target); try { previousMasterTable.load(input); String stringValue = previousMasterTable.getProperty(ROOT_SEQUENCE_NUMBER_KEY); // if there was a full save, then there must be a non-null entry for root if (stringValue != null) { int valueInFile = new Integer(stringValue).intValue(); 1561 -> int valueInMemory = new Integer(masterTable.getProperty(ROOT_SEQUENCE_NUMBER_KEY)).intValue(); // new master table must provide greater or equal sequence number for root // throw exception if new value is lower than previous one - we cannot allow to desynchronize master table on disk String message = "Cannot set lower sequence number for root (previous: " + valueInFile + ", new: " + valueInMemory + "). Location: " + target.getAbsolutePath(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ Assert.isLegal(valueInMemory >= valueInFile, message); } } finally { input.close(); } } }
ups, sorry it is not looking really good, do you see this "1561 ->"?
(In reply to Denis Golovin from comment #6) > ups, sorry it is not looking really good, do you see this "1561 ->"? Yes, it points at the line with "int valueInMemory = ...". Thanks a lot! This is a timing issue that I have been chasing for a long time now. Thanks to your bug report, we now know that long standing issues like bug 149121 were caused by multiple master tables being used at the same time. Fix for bug 415014 replaced multiple master tables with just one master table, but timing issue is still there which is confirmed by this bug. Whenever you see this problem again, please zip the workspace that is affected and attach it to this bug. What I'm looking for is whether there are any files in .metadata folder with the .bak extension that could be involved.
one more note, it happens to me usually in debug sessions when main UI thread is suspended many times during tests execution.
(In reply to Denis Golovin from comment #8) > one more note, it happens to me usually in debug sessions when main UI > thread is suspended many times during tests execution. That's valuable information. Suspending a thread should not interfere with periodic workspace save, so if it does, then it's another confirmation we have a bug. Where do you take these UI tests from? If these are some UI tests from another eclipse.org project, please let me know and I will set up local environment to run them locally hoping I will be able to reproduce it. If not, maybe you can attach a test case that usually shows this bug? Any hint that can help me to reproduce it will be great.
Latest test log is available through https://hudson.jboss.org/hudson/view/JBossTools/view/JBossTools_Master/job/jbosstools-javaee_master/lastSuccessfulBuild/artifact/sources/jsf/tests/org.jboss.tools.jsf.ui.test/target/work/data/.metadata/.log/*view*/, but it doesn't have this problem and most likely never had, because it is always running none stop. I really can see it only locally. I'll try do remote debugging for my local build to see if I can catch it.
CQ:WIND00-WB4-2543 We have also seen this message in Eclipse 4.3.1 , but during normal user interatction - no automation job as reported by Denis. I guess that having this appear as part of automation too is good since it provides a somewhat reproducable case.
(In reply to Martin Oberhuber from comment #11) > We have also seen this message in Eclipse 4.3.1 , but during normal user > interatction - no automation job as reported by Denis. I guess that having > this appear as part of automation too is good since it provides a somewhat > reproducable case. It's strange you see this in 4.3.1, because the change that, as far as I know, could cause this was pushed for 4.4 M2 as a fix for bug 415014. Can you please attach full stack trace, so that I can see exact line numbers where the exception occurs?
Created attachment 240843 [details] Zipped Logs Zipped Logs attached. The "configuration" file in the logs clearly identifies Eclipse as version 4.3.1, as far as I can tell. The reported exception is this: !ENTRY org.eclipse.core.jobs 4 2 2014-01-24 15:15:39.915 !MESSAGE An internal error occurred during: "Periodic workspace save.". !STACK 0 java.lang.NumberFormatException: null at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.<init>(Unknown Source) at org.eclipse.core.internal.resources.SaveManager.validateMasterTableBeforeSave(SaveManager.java:1560) at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1228) at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1220) at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1197) at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1109) at org.eclipse.core.internal.resources.DelayedSnapshotJob.run(DelayedSnapshotJob.java:51) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Unfortunately, we still don't know why in the new master table there is no value for ROOT_SEQUENCE_NUMBER_KEY. From logs attached in comment 13 we know that it happens also on Windows.
We have not been able to reproduce this. Removing target milestone because there is nothing more we can do right now. Please speak up with if you can still reproduce this problem in Eclipse 4.4.2 or later and please provide steps how to reproduce it.
I can reproduce this error in Eclipse 4.4.0 like this: workspace on a removable drive eclipse on a windows notebook. with opened workspace put notebook into suspended mode remove drive power up notebook, doing nothing in the workspace re-plug removable drive. Drive letter is the same as before -> everything works in Eclipse, except that I get the error periodically until Eclipse is restarted !ENTRY org.eclipse.core.jobs 4 2 2015-06-03 08:05:03.388 !MESSAGE An internal error occurred during: "Periodic workspace save.". !STACK 0 java.lang.NumberFormatException: null at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.<init>(Unknown Source) at org.eclipse.core.internal.resources.SaveManager.validateMasterTableBeforeSave(SaveManager.java:1562) at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1229) at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1221) at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1198) at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1110) at org.eclipse.core.internal.resources.DelayedSnapshotJob.run(DelayedSnapshotJob.java:51) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Ping, since the last comment has a reproducable case could this be investigated ?
(In reply to Martin Oberhuber from comment #17) > Ping, since the last comment has a reproducable case could this be > investigated ? Were you able to reproduce the problem using these steps?
I have this problem too with Eclipse Luna (4.4.0) on Ubuntu 14.04 java 1.7.0_101 It happens if the workspace is under AFS and my AFS token expires. Getting new tokens doesn't make the problem go away. I suspect that a periodic save attempted while I didn't have write access to the workspace messes things up, and then later attempts fail with the NumberFormatException. NB: It might be better if Eclipse didn't try to periodically save the workspace when nothing has changed since the last save.
(In reply to John Boyland from comment #19) > I have this problem too with Eclipse Luna (4.4.0) on Ubuntu 14.04 java > 1.7.0_101 > It happens if the workspace is under AFS and my AFS token expires. Getting > new tokens doesn't make the problem go away. I suspect that a periodic save > attempted while I didn't have write access to the workspace messes things > up, and then later attempts fail with the NumberFormatException. > > NB: It might be better if Eclipse didn't try to periodically save the > workspace when nothing has changed since the last save. Can you please clarify what is AFS?
(In reply to Szymon Ptaszkiewicz from comment #20) > (In reply to John Boyland from comment #19) > > I have this problem too with Eclipse Luna (4.4.0) on Ubuntu 14.04 java > > 1.7.0_101 > > It happens if the workspace is under AFS and my AFS token expires. Getting > > new tokens doesn't make the problem go away. I suspect that a periodic save > > attempted while I didn't have write access to the workspace messes things > > up, and then later attempts fail with the NumberFormatException. > > > > NB: It might be better if Eclipse didn't try to periodically save the > > workspace when nothing has changed since the last save. > > Can you please clarify what is AFS? A distributed file system. Somewhat like drop box. See openafs.org
I am receiving this with the latest version of eclipse. Is there any workaround I can try? java.lang.NumberFormatException: null at java.lang.Integer.parseInt(Integer.java:542) at java.lang.Integer.parseInt(Integer.java:615) at org.eclipse.core.internal.resources.SaveManager.validateMasterTableBeforeSave(SaveManager.java:1617) at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1285) at org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager.java:1277) at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1254) at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1165) at org.eclipse.core.internal.resources.DelayedSnapshotJob.run(DelayedSnapshotJob.java:52) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56) eclipse.buildId=4.7.2.M20171130-0510 java.version=1.8.0_131 java.vendor=Oracle Corporation BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US Framework arguments: -refresh Command-line arguments: -os linux -ws gtk -arch x86_64 -data ~/eclipse-workspaces/app.main -refresh
(In reply to Eric Perret from comment #22) > I am receiving this with the latest version of eclipse. Is there any > workaround I can try? > > java.lang.NumberFormatException: null > at java.lang.Integer.parseInt(Integer.java:542) > at java.lang.Integer.parseInt(Integer.java:615) > at > org.eclipse.core.internal.resources.SaveManager. > validateMasterTableBeforeSave(SaveManager.java:1617) > at > org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager. > java:1285) > at > org.eclipse.core.internal.resources.SaveManager.saveMasterTable(SaveManager. > java:1277) > at > org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1254) > at > org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1165) > at > org.eclipse.core.internal.resources.DelayedSnapshotJob. > run(DelayedSnapshotJob.java:52) > at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56) > > eclipse.buildId=4.7.2.M20171130-0510 > java.version=1.8.0_131 > java.vendor=Oracle Corporation > BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US > Framework arguments: -refresh > Command-line arguments: -os linux -ws gtk -arch x86_64 -data > ~/eclipse-workspaces/app.main -refresh This is using Ubuntu 16.04 LTS and I have full hard drive encryption enabled.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.