unable to checkout from launchpad

Bug #1304441 reported by Matthias Ronge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Plugin for Eclipse
Fix Released
Medium
Piotr Piastucki

Bug Description

File → Import → Project From Bazaar → Next

Repository Location: https://launchpad.net/ughlib
(Branch Type is ‘Branch’)
Click “Next”, then “Finish”

Console:
> XmlRpcClient Executing: branch https://launchpad.net/ughlib file:///c:/Users/MATTHI~1.AD-/AppData/Local/Temp/bzreclipse8605154786431671382.tmp
>
> Branched 552 revisions.
Folder C:\Users\Matthias_Ronge.AD-ZEUTSCHEL\AppData\Local\Temp\bzreclipse8605154786431671382.tmp is present and contains data.

None of the options given in the “Select a wizard to use” dialog works:

Option 1 “Import existing projects”: Folder gets removed from Temp, no message in the user interface (returns to “Advanced options for creating project from Bazaar repository” dialog)

In Eclipse .log file:
!ENTRY org.vcs.bazaar.eclipse.ui 4 0 2014-04-08 15:23:38.677
!MESSAGE
!STACK 0
java.lang.NullPointerException
 at org.vcs.bazaar.eclipse.core.utils.ResourceUtil.findProjects(ResourceUtil.java:265)
 at org.vcs.bazaar.eclipse.ui.operations.CreateBazaarProjectOperation.createProjects(CreateBazaarProjectOperation.java:96)
 at org.vcs.bazaar.eclipse.ui.operations.CreateBazaarProjectOperation.run(CreateBazaarProjectOperation.java:81)
 at org.eclipse.team.internal.ui.actions.ProgressDialogRunnableContext$3.run(ProgressDialogRunnableContext.java:100)
 at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
 at org.eclipse.team.internal.ui.actions.ProgressDialogRunnableContext$2.run(ProgressDialogRunnableContext.java:97)
 at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

Option 2 “Use create new projects wizard”: Folder gets removed from Temp, the desired type of project gets created and opened but contains no data; no message in the user interface (returns to “Advanced options for creating project from Bazaar repository“ dialog). No message in Eclipse .log file.

Option 3 “Import as general project”: Folder gets removed from Temp, an empty project gets created and opened but contains no data; no message in the user interface (returns to “Advanced options for creating project from Bazaar repository“ dialog)

In Eclipse .log file:
!ENTRY org.vcs.bazaar.eclipse.ui 4 0 2014-04-08 15:27:15.526
!MESSAGE
!STACK 0
java.lang.IllegalArgumentException:
 at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
 at org.eclipse.core.runtime.Assert.isLegal(Assert.java:47)
 at org.eclipse.core.runtime.Status.setPlugin(Status.java:237)
 at org.eclipse.core.runtime.Status.<init>(Status.java:129)
 at org.vcs.bazaar.eclipse.core.repository.BazaarTeamProvider.configureProject(BazaarTeamProvider.java:64)
 at org.eclipse.team.core.RepositoryProvider.configure(RepositoryProvider.java:334)
 at org.eclipse.team.core.RepositoryProvider.map(RepositoryProvider.java:129)
 at org.vcs.bazaar.eclipse.core.repository.BazaarTeamProvider.registerProject(BazaarTeamProvider.java:46)
 at org.vcs.bazaar.eclipse.core.repository.BazaarTeamProviderType.registerProject(BazaarTeamProviderType.java:52)
 at org.vcs.bazaar.eclipse.ui.operations.CreateBazaarProjectOperation.createProject(CreateBazaarProjectOperation.java:144)
 at org.vcs.bazaar.eclipse.ui.operations.CreateBazaarProjectOperation.createProjects(CreateBazaarProjectOperation.java:105)
 at org.vcs.bazaar.eclipse.ui.operations.CreateBazaarProjectOperation.run(CreateBazaarProjectOperation.java:81)
 at org.eclipse.team.internal.ui.actions.ProgressDialogRunnableContext$3.run(ProgressDialogRunnableContext.java:100)
 at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
 at org.eclipse.team.internal.ui.actions.ProgressDialogRunnableContext$2.run(ProgressDialogRunnableContext.java:97)
 at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

Revision history for this message
Piotr Piastucki (piastucki) wrote :

Please use a path to the repository as mentioned at https://code.launchpad.net/ughlib:
lp:ughlib

https://launchpad.net/ughlib does NOT point to a valid bzr repo.

Revision history for this message
Matthias Ronge (matthias-ronge) wrote :

I tried these three variants, but none of them does even perform a download:

lp:ughlib

Error → Verbindung geschlossen: Unexpected end of message. Please check connectivity and permissions, and report a bug if problems persist.

https://code.launchpad.net/ughlib: lp:ughlib/

Error → Kein Zweig: »https://code.launchpad.net/ughlib: lp:ughlib/«.

https://code.launchpad.net/ughlib:lp:ughlib

Error → Kein Zweig: »https://code.launchpad.net/ughlib:lp:ughlib/«.

As I mentioned, downloading the code to the temporary directory *does* work with the configuration I initially described. The problem is that it doesn’t make it to an Eclipse project, none of the three options works correctly.

The only thing that catched my eye was the folder name, with the home directory in 8+3 style ("MATTHI~1.AD-" instead of "Matthias_Ronge.AD-ZEUTSCHEL") whilst the directory to be created (“bzreclipse….tmp”) not in 8+3 style. But usually Windows does handle this correctly, so I don’t think it has to do with it.

Revision history for this message
Matthias Ronge (matthias-ronge) wrote :

Its clear that option 1 cannot work because there is no Eclipse project in the repository. However, when recursively searching the sub directories

[ResourceUtil:265] for (File dir : dirs) {

propably throws a NullPointerException if dirs is of length 0. Just a guess. Should be caught and show a sensible error message, probably show the dialog to choose the three options again without having to download the repo again.

Option 2 + 3, no clue.

Revision history for this message
Matthias Ronge (matthias-ronge) wrote :

Option 3: The error occurs in a catch block, so the exception which is the cause of the problem is hidden to me. Perhaps the second argument of the Status constructor (String pluginId) must not be ""?

Can you pass the exception? I.e.,
throw new CoreException(new Status(IStatus.ERROR, ID, "", e));

Revision history for this message
Piotr Piastucki (piastucki) wrote :

I meant lp:ughlib. Just lp:ughlib.

But since you managed to checkout the source code to the temp folder it does not really matter what URL you use as long as it works.

The plugins offer you an option to import existing projects as there is actually a .project file in /ugh/old folder. Otherwise the option would be disabled.

The import works correctly on my Linux machine, the project gets created with all the source code inside.

java.lang.NullPointerException at org.vcs.bazaar.eclipse.core.utils.ResourceUtil.findProjects(ResourceUtil.java:265) means that the referenced path does not exist or does not denote a folder or there is an I/O error.

There must be something wrong with the temp path under Windows in your case.
The temp folder is first renamed/moved to the target location in the workspace and then scanned for the projects and this is when the NPE is thrown.
The target location is shown in the wizard in "Location for Eclipse Project" field. It is automatically updated when you type in the project name. Would you please check if this path is correct?

Revision history for this message
Matthias Ronge (matthias-ronge) wrote :

The path is correct. In case of option 3, an empty project does get created there, just the downloaded content never arrives.

Btw, my workspace location is D:\Eclipse_WS. Why isn’t the download performed to, e.g., D:\Eclipse_WS\.metadata\.plugins\org.vcs.bazaar.eclipse.core.repository\tmp but to another mount point (with less space) and then requires to copy everything form one partition to another? And: Where is that temp path defined? Can I change it?

Revision history for this message
Matthias Ronge (matthias-ronge) wrote :

As https://stackoverflow.com/questions/300559#answer-300562 states, java.io.File.renameTo() “generally works only on the same file system volume. I think of this as the equivalent to a "mv" command. Use it if you can, but for general copy and move support, you'll need to have a fallback.”

I would like to suggest to use \.metadata\.plugins\org.vcs.bazaar.eclipse\tmp for downloading or to back the move operation with org.apache.commons.io.FileUtils.copyDirectory(File, File, boolean)

Revision history for this message
Piotr Piastucki (piastucki) wrote :

I believe you can change the path of the temp folder in Windows by setting an environment variable (TEMP).
You are right, the issue is most likely caused by 2 different file systems. I think we should both use .metadata folder to store the temporary data and provide fallback in case renameTo fails. Thanks for investigating an providing the info!

Changed in bzr-eclipse:
milestone: none → 1.4.1
assignee: nobody → Piotr Piastucki (piastucki)
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Piotr Piastucki (piastucki) wrote :

I hope the issue is fixed now. Please check the latest nightly build available at:
http://bzreclipse.org/jenkins/job/bzr-eclipse/lastSuccessfulBuild/artifact/org.vcs.bazaar.eclipse.site/target/site/

Changed in bzr-eclipse:
status: Triaged → Fix Committed
Revision history for this message
Matthias Ronge (matthias-ronge) wrote :

Please excuse my late reply: It works! :)
Thank you a lot for the quick solution.

Revision history for this message
Piotr Piastucki (piastucki) wrote :

Thanks for the info!

Changed in bzr-eclipse:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.