Bug 19197 - No obvious indication of "out of sync", wasted time debugging wrong thing
Summary: No obvious indication of "out of sync", wasted time debugging wrong thing
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 critical (vote)
Target Milestone: 2.0 F3   Edit
Assignee: Dejan Glozic CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 19248 19249
Blocks:
  Show dependency tree
 
Reported: 2002-06-04 16:00 EDT by Kevin McGuire CLA
Modified: 2002-06-06 21:33 EDT (History)
0 users

See Also:


Attachments
screen shot showing PDE error (83.38 KB, image/jpeg)
2002-06-04 16:20 EDT, Kevin McGuire CLA
no flags Details
team project set (627 bytes, text/plain)
2002-06-04 23:29 EDT, Kevin McGuire CLA
no flags Details
plugin.xml it didn't like (2.63 KB, text/plain)
2002-06-05 00:01 EDT, Kevin McGuire CLA
no flags Details
resulting mangled .classpath (385 bytes, text/plain)
2002-06-05 00:02 EDT, Kevin McGuire CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin McGuire CLA 2002-06-04 16:00:09 EDT
I just wasted *a lot* of time trying to debug my plugin, only to realize that I 
wasn't running the code I thought I was due to some "out of sync" error on one 
of my plugins.

How I got in this state was approximately:

- had binary projects imported
- checked out projects from CVS overtop
- self hosting debug

I think during checkout one had failed somehow -- I didn't have any classes.  
But I thought since I was actually checking out a branch I had just picked an 
empty one.  So I repeated and got content.  Not sure, that was yesterday.

All the time, it turned out that that project had some PDE "Out of sync" 
error.  After much failed debugging I was finally able to show that my 
plugin.xml wasn't even being used, my old one was still.

Given that, we thought to look in run configuration.

Its completely unacceptable that the user should be able to execute self 
hosting if the code they are looking at in the development environment is 
somehow not the code they are executing (unless they took advanced steps to do 
so).  At least if there is an error that PDE is aware of they should:

1. warn you when launching
2. write something in the .log
Comment 1 Kevin McGuire CLA 2002-06-04 16:20:50 EDT
Created attachment 1238 [details]
screen shot showing PDE error
Comment 2 Kevin McGuire CLA 2002-06-04 16:23:06 EDT
Another issue is that I have no idea how I am supposed to make the 
PluginManager be in sync.  I tried deleting and reloading my project but the 
error remains.
Comment 3 Dejan Glozic CLA 2002-06-04 17:15:34 EDT
PDE has a dual-step update in the model manager: when there is a delta for the 
manifest file, it tries to read it with force==false. If it receives a core 
exception, it reads it with 'force==true' and sets 'outOfSync' bit. This 
indicates that it was able to read the contents but it had to force its way 
while doing that, and you are better off refreshing or otherwise clearing the 
situation.

You said that the checkout failed somehow and you didn't have any classes. 
Before PDE gives you logs or warnings about it, shouldn't import itself warn 
you about the failure? Is it possible that you had out-of-sync resoures that 
caused checkout to fail?

When you have the workspace out-of-sync with the file system, you will get 
funny results because you operate on workspace data but the run-time workbench 
takes information from the file system. This is how you could run different 
things that you think you see in the workspace. 

Out-of-sync resources are a grey area in Eclipse. Editors and other tools sort 
of tolerate them, but you can get into many funny situations if you do not fix 
them quickly. I don't know how to handle this particular problem, except maybe 
add the warning on launching you mentioned.
Comment 4 Kevin McGuire CLA 2002-06-04 17:48:30 EDT
Unfortunately I can't add more details to how I might've gotten into the 
situation.  I am not sure if the steps I mentioned were at all related (I had 
to be somewhere at a certain time and couldn't investigate).

That aside, the bigger issue is that I wasn't warned I was in this state.
Comment 5 Kevin McGuire CLA 2002-06-04 18:00:01 EDT
- I took a new workspace
- loaded in my source projects
- loaded in remaining binary (by having the wizard select all projects then 
inverted selection).

I am still getting the warning in the launcher
Comment 6 Dejan Glozic CLA 2002-06-04 18:38:56 EDT
Maybe there is something wrong with your source projects. I did the same today 
with my source project and I don't see the errors. Could you send me the list 
of project to try it out on my end?
Comment 7 Dejan Glozic CLA 2002-06-04 18:44:55 EDT
F3 candidate.
Comment 8 Kevin McGuire CLA 2002-06-04 23:28:18 EDT
Import the attached Team project set, then add everything else from F2.  Should 
work if you get at it soon (before the contents of those streams change).
Comment 9 Kevin McGuire CLA 2002-06-04 23:29:25 EDT
Created attachment 1247 [details]
team project set
Comment 10 Kevin McGuire CLA 2002-06-05 00:01:28 EDT
Well this just gets stranger as you go.  Apparently my plugin.xml has errors - 
when I try to switch to any view other than the source xml one I get:

  Title: Plugin Manifest Editor
  Message: The source page has errors. Other pages cannot be used until these 
errors are corrected.

I have no error tasks, so I have no idea where the error is that its 
complaining about (another bug).

The file you want is revision 1.16.4.2 of 
org.eclipse.team.cvs.core/plugin.xml.  I mention this in case I commit a 
corrected plugin.xml to the branch.

Taking out what I assume are the offending lines 
(	<!-- *************** Repository Provider **************** -->

	<extension point="org.eclipse.team.core.repository">
		<repository
			id="org.eclipse.team.cvs.core.cvsnature"
		
	class="org.eclipse.team.internal.ccvs.core.CVSTeamProvider"/>
	</extension>
)

results in over 1600 build errors because the .classpath gets regenerated 
wrong.  The lines above that were removed have no relationship to 
the .classpath contents.

Reconstructing the file by taking one that worked, and adding those lines in, 
gets me going.  I will attach my current plugin.xml and resulting bogus 
generated .classpath.

I was however able to get 1.16 of plugin.xml (where I started from), reapply 
the changes, and get it to not have an error anymore.  But I had to let PDE 
regen my plugin.xml the way *it* wants it.  The change was:

		<repository
			id="org.eclipse.team.cvs.core.cvsnature"
		
	class="org.eclipse.team.internal.ccvs.core.CVSTeamProvider"/>

became
      <repository
            class="org.eclipse.team.internal.ccvs.core.CVSTeamProvider"
            id="org.eclipse.team.cvs.core.cvsnature">
      </repository>

Note the change from "/>" to "</repository>".
Comment 11 Kevin McGuire CLA 2002-06-05 00:01:58 EDT
Created attachment 1248 [details]
plugin.xml it didn't like
Comment 12 Kevin McGuire CLA 2002-06-05 00:02:39 EDT
Created attachment 1249 [details]
resulting mangled .classpath
Comment 13 Dejan Glozic CLA 2002-06-06 21:33:31 EDT
This report flags several problems:

1) Screen shot reveals NL substitution error (should be "(out of sync)"). Fixed.
2) Lack of error reporting: partially caused by the project not having PDE 
nature.
3) Lack of error reporting on launch. PDE is now warning the user that some 
plug-ins are out of sync or otherwise broken (which is often the case when 
model (re)load fails due to syntax errors in the manifest).

PDE already handles error reporting using the builder. Builder or not, 
the launcher is now warning about 'broken' plug-ins. In addition, if you
somehow go past the dialog or launch from the shortcut, you will get 
an error dialog listing you the plug-ins that have errors. The dialog will 
allow you to continue launch but warn you that run-time workbench will
most likely disable these plug-ins on startup.

Launcher has also been fixed to tolerate broken plug-ins and try to create
the plug-in path file with them. 

I think that this is the best we can do for 2.0.