This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 229047 - Project disappears on NetBeans restart
Summary: Project disappears on NetBeans restart
Status: RESOLVED INVALID
Alias: None
Product: web
Classification: Unclassified
Component: HTML Project (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-26 06:31 UTC by hon2a
Modified: 2014-07-09 01:54 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
log from before (all projects opened correctly) (21.66 KB, text/plain)
2013-05-02 05:57 UTC, hon2a
Details
log from after (one project disappeared) (21.66 KB, text/plain)
2013-05-02 05:57 UTC, hon2a
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hon2a 2013-04-26 06:31:37 UTC
Overview:

I work on 3 HTML5 projects. Sometimes (often but not always) when I open NetBeans the last 2 of them are simply gone (from the Projects pane) and I'm unable to "re-open" them by finding their project directory. I'm forced to create new projects "from existing sources" every time this happens.

Steps to reproduce:

1) Create a few [HTML5] projects.
2) Close NetBeans and after some time open them again. (I haven't been able to find any correlation to anything else I'm doing.)

Actual results:

Some of the projects are no longer to be found in the Projects pane. In my case, only the first project is still there. I cannot re-open the projects by finding and selecting their project folder.

Expected results:

I'd expect to find all previously open projects in the Projects pane.

Build and platform:

Product Version: NetBeans IDE 7.3 (Build 201302132200)
Java: 1.7.0_10; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_10-b18
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)

---

This has made the IDE pretty much useless for me, as I have to re-create my workspace most times I open it. Thanks in advance for any help.
Comment 1 Marian Mirilovic 2013-04-26 07:29:34 UTC
Could you please be so kind and attach messages.log file of the IDE instance that didn't open existing projects as well as the one running before ? .. and reopen this issue ? Thanks in advance
Comment 2 hon2a 2013-04-26 08:29:55 UTC
Ok, I will do that next time I reproduce the bug.
Comment 3 David Konecny 2013-04-28 22:15:54 UTC
(In reply to comment #0)
> This has made the IDE pretty much useless for me, as I have to re-create my
> workspace most times I open it.

What do you mean by "recreating workspace"? Do you mean you have to "reopen project"? Or are you saying that whole project folder disappeared?

NetBeans allows to create a project anywhere on your disk and all what NetBeans keeps is a link to that project folder. Upon restart the IDE tries to locate these folders and reopen projects. If project folder was removed or moved somewhere else then IDE cannot reopen it.
Comment 4 hon2a 2013-04-29 06:47:28 UTC
No, I don't mean that the folders with source files get removed.

What I mean is that the projects disappear from NetBeans. To get my work going, I need to re-create each project as a "new project from existing sources" and set all the properties I've customized in the past.
Comment 5 hon2a 2013-04-29 06:49:17 UTC
(Un)fortunately, I've been unable to replicate the bug since posting it. As soon as I do, I'll attach the message logs as asked.
Comment 6 David Konecny 2013-04-29 20:04:05 UTC
(In reply to comment #4)
> No, I don't mean that the folders with source files get removed.
> 
> What I mean is that the projects disappear from NetBeans. To get my work going,
> I need to re-create each project as a "new project from existing sources" and
> set all the properties I've customized in the past.

This still does not make any sense to me. When you use "New HTML5 Application from Existing Sources" wizard what values do you use for "Site Root" and "Project Directory"? The folder you set in "Project Directory" - does it get removed? Because if it does not then IDE should be always able to reopen it. Ideally the layout of you projects should be like:

/some/local/folders/here-is-VCS-root/here-is-NB-project-folder/here-is-Site-Root
Comment 7 hon2a 2013-04-29 21:18:39 UTC
My "Site Root" and "Project Directory" are the same folder. I always select the the root folder of my local Git repository as the "Site Root" (since it contains all of my source files) and the "Project Directory" gets filled with the same path by default. So both paths point to the same location:

/some/local/folders/repository-root-AKA-Site-Root-AKA-Project-Folder

The 'nbproject' folder gets created as a subfolder of my repository root and I have it added to .gitignore . Does that clarify things up a bit or not?
Comment 8 David Konecny 2013-04-29 22:58:05 UTC
Yes, it's starting to make sense. The NetBeans IDE needs nbproject folder as that's where all project metadata are stored. I'm guessing that in your case you must have removed the nbproject folder (perhaps indirectly via some git clean command??) and that caused IDE to not be able to reopen the project.

You have few options. You could define NetBeans project folder outside of your Site Root but then it still will not be version controlled which IMO is a bad idea. The best would be to move your site root one folder down and allow your project root to keep other stuff like for example nbproject folder. In long term you will definitely appreciate this setup as it allows you to store other things directly in the root of your git checkout, eg. misc shell/builds scripts, folder with JavaScript unit tests, etc.
Comment 9 hon2a 2013-04-30 06:15:58 UTC
The thing is, I didn't remove the 'nbproject' folder (not even accidentally). Whenever the bug occured, I checked that the 'nbproject' folder still exists (and it did, every time) and tried to "open project" by selecting the checkout root or the 'nbproject' folder itself. Unfortulately, neither worked.

Anyway, thanks for the project layout suggestion, I might try that if the problem persists.
Comment 10 hon2a 2013-05-02 05:57:35 UTC
Created attachment 134020 [details]
log from before (all projects opened correctly)
Comment 11 hon2a 2013-05-02 05:57:56 UTC
Created attachment 134021 [details]
log from after (one project disappeared)
Comment 12 hon2a 2013-05-02 06:18:15 UTC
Thanks for the help, now I feel like a dunce for taking your time. I finally caught the problem at the source - the 'nbproject' folder gets devoured each time I do a 'git stash save' and it doesn't come back on 'git stash pop' (will have to look into how exactly is that a correct behavior). To make it more interesting, the 'nbproject' folder gets recreated on exiting NetBeans, but just with the 'private' subfolder and its contents. Files 'project.properties' and 'project.xml' do not get recreated.

I changed the bug status to RESOLVED/INVALID, hope that's correct.
Comment 13 David Konecny 2013-05-02 06:35:08 UTC
Thanks. I think the .gitignore is what's causing it. And it is sort of make sense - ignore list contains files which should be *ignored* in a sense that they are disposable. Like .class files for example.
Comment 14 hon2a 2013-05-02 06:47:09 UTC
It'd make more sense to me for the 'git stash save' to ignore the .gitignore files, but I guess there's some explanation, as there always is with the many Git quirks :)
Comment 15 kingpoop 2014-02-01 16:59:07 UTC
THIS ISSUE IS NOT RESOLVED.

I JUST INSTALLED NETBEANS 7.2 32 BIT VERSION AND WHEN NETBEANS STARTS MY PROJECT LIST APPEARS FOR A MOMENT WHILE STARTING AND THEN DISAPPEARS.

LUCKILY, I BACKED UP MY ORIGINAL CACHE AND USERDIR BEFORE UPGRADING.
D:\devenv\netbeans-7.2\bin\netbeans.exe --cachedir s:\nbcache --userdir s:\nbuserdir

I DELETED THE CACHE DIR AND RESTORED FROM BACKUP.  SAME ISSUE.

I DELETED THE USERDIR AND RESTORED FROM BACKUP. FIXED THE PROBLEM.

CONCLUSION: SOMETHING IS FUCKED UP ON THE USERDIR AND YOUR DEV TEAM MISSED IT DURING REGRESSION TESTING.  THIS TOOK TWO DAYS TO FIGURE OUT AND NOW I'M BEHIND SCHEDULE ROLLING OUT A REST SERVICE.  I HAVE USED NETBEANS FOR YEARS NOW AND I AM NOTICING MORE AND MORE THAT THE PRODUCT IS LOSING IS QUALITY CONTROL JUST LIKE MICROSOFT.  YOU GUYS BETTER LOCK SHIT DOWN AND MAKE DAMN SURE IT WORKS RIGHT THE FIRST TIME FOR ALL PLATFORMS OTHERWISE YOU'RE GONNA LOSE PEOPLE IN DROVES AND THEY'LL MIGRATE TO ECLIPSE.  I AM NOT SHITTING YOU, I AM AN INDEPENDENT SOFTWARE DEVELOPER OF 30+ YEARS AND I HAVE SEEN THIS HAPPEN BEFORE.  LOCK DOWN THOSE FUCKING PLUGINS AND DON'T LET THEM INTO YOUR PRODUCT UNLESS THEY CAN PROVE THEY ACTUALLY WORK W/OUT BLOWING AWAY YOUR RELEASE.  I KNOW FOR A FACT THAT THE FOLLOWING PLUGIN CAUSED THE ISSUE:

Version: 1.1.0 Source: Plugin Portal  
Plugin Description
Additional Java hints for NetBeans IDE
Comment 16 David Konecny 2014-07-09 01:54:52 UTC
kingpoop, your problem must have a different cause as this issue was conclusively closed as GIT configuration sideeffect. Please file a new report with some info on how to reproduce. Thx.