Bug 189656

Summary: Home dir deletion
Product: platform Reporter: psyray
Component: Launchers&CLIAssignee: Jesse Glick <jglick>
Status: VERIFIED FIXED QA Contact: issues <issues.netbeans.org>
Priority: P1 CC: dlipin, jglick, jtulach
Version: 6.x   
Target Milestone: 6.x   
Hardware: PC   
OS: Linux   
Whiteboard: 69patch2-verified
Issue Type: DEFECT Exception Report:
Bug Depends on:    
Bug Blocks: 145936    
Attachments: Content of /var/log/messages.log
Netbeans conf file
.nbi logfile

Description psyray 2010-08-18 21:01:48 UTC
Created attachment 101505 [details]
Content of /var/log/messages.log

Hi

Netbeans delete my entire home directory on install.

I'm really angry against your program. I tried to install and it has deleted ALL MY PERSONAL DATA except few read only directories.

I didn't know what happened but i'm sure it's your program.

Could you explain me what happened and why are you implementing a rm -rf like command in your installer and why don't you prompt user, with path to delete, before permit a command like this ?

You could find attached the message.log that i find in my /var/log directory. Inside you could find many "Failed to delete" message. I think it's due to the directories with read only permissions.

I can't find the $HOME\.netbeans\$release_num\var\log\message.log because of the deletion.

I try to recover my data with extundelete, but as your installer deletes 160Go of datas, the recovery was not really succesfull.

Thanks for your response and correct your program quickly.
Comment 1 psyray 2010-08-18 21:10:19 UTC
I can see in the messages.log that :
Home Directory = /root 

I didn't launch the installer with the sudo command or with root access.
So why my home dir was set to root ?

My os is ubuntu 10.04
Comment 2 dlipin 2010-08-18 21:59:31 UTC
How have you installed NetBeans?
As the shell installer from http://netbeans.org/downloads/ ?
Or via Ubuntu packages (apt-get, or Synaptic, or similar) ?
Or something else?
Or is this issue about the installer created via "Build Installer" menu item in the IDE?

Please attach /opt/netbeans-6.9/etc/netbeans.conf. I expect the following option there:
netbeans_default_userdir="${HOME}"
If so have you modified that file by yourself?

Please attach ~/.nbi/log/* files (zipped) if available. Or, since you installed as root, /root/.nbi/log/*.

Anyway, o.n.core.startup.Main should be careful with userdir and not do things like
deleteRec(new File(CLIOptions.getUserDir()))
which is happening now at line 274. Reassigning.
Comment 3 dlipin 2010-08-18 22:07:01 UTC
I see that NB was installed at /opt/netbeans-6.9 which usually happens when you run installer under root user, or sudo, or whoever with uid (effective) equals to 0.

BTW, normal user don't have access to /opt at all.

So it is hard to believe in "I didn't launch the installer with the sudo command or with root access."
Comment 4 Jesse Glick 2010-08-18 22:43:33 UTC
The first question, as Dmitry asked, is how the NB user dir came to be set to $HOME in the first place:

  User Directory          = /home/raynald

Could simply back out the fix of bug #145936 to prevent this kind of catastrophe.
Comment 5 psyray 2010-08-19 08:49:32 UTC
Created attachment 101517 [details]
Netbeans conf file
Comment 6 dlipin 2010-08-19 09:37:13 UTC
psyray,
Your conf file seems to be correct.
Did you by chance used "su", "su -", or "sudo" command to run NetBeans IDE?
Comment 7 psyray 2010-08-19 09:40:51 UTC
Hi thanks for quick reply.

I install Netbeans first via Ubuntu packages but it was the 6.8 version so i uninstall it and reinstall Netbeans by launching the 6.9.1 shell installer downloaded from http://netbeans.org/downloads/.

After install the conf file was modified by myself but only to uncomment and modify the netbeans_jdkhome because netbeans won't launch and gave me an error like "can't find jdk home".
The netbeans_default_userdir seems to be correct.

For this :
"So it is hard to believe in "I didn't launch the installer with the sudo
command or with root access.""
I'm not cheating you. If i said that, it's the truth.

FYI, I have an 40Gb SSD drive on my laptop which running OS and i made symbolic link to it for few apps and settings (firefox profile, evolution data...) to speed up things. I decide to put all this stuff in opt dir (which was on a separate partition than root), so i give access to my user to /opt to prevent launching apps with root access or sudo command.

The logfile seems to be an after disaster logfile. You can find it attached.

Maybe my two installs get Netbeans 6.9.1 installation confused or few configuration files remains. I don't know.

Anyway as you said :
"o.n.core.startup.Main should be careful with userdir and not do things
like deleteRec(new File(CLIOptions.getUserDir())) which is happening now at line 274."

It's not time to tell if i was wrong or you was wrong, maybe twice.
Maybe or surely I did some mistakes, but an installer should NEVER DELETE USER DATA AUTOMATICALLY. 
ALWAYS PROMPT USER WITH DETAILED POPUP WITH BIG EXCLAMATION MARK OF WHAT TO DELETE, SIZE OF DELETION AND CONFIRM USER.

I lost few data, but I have recent backup files for all my work. I maybe lost few personal videos, few mp3 or movies.
I'm surely have to do few work twice but not from scratch. So my anger is moderate.

Thanks for your response
Comment 8 psyray 2010-08-19 09:42:45 UTC
Created attachment 101519 [details]
.nbi logfile
Comment 9 psyray 2010-08-19 09:48:59 UTC
No i didn't use su or sudo command to launch Netbeans. As i told you i give right to my user to the opt dir.

The nbi logfile was found in my home dir but the time doesn't correspond, i can't understand why. I can't remember if i try to launch the installer after disaster. Maybe i did, and the previous logfile was deleted.
Comment 10 dlipin 2010-08-19 10:21:41 UTC
> Maybe or surely I did some mistakes, but an installer should NEVER DELETE USER
DATA AUTOMATICALLY. 

From the original messages.log I see that the IDE deletes the files, not the installer. Anyway I share you concerns and anger; neither IDE nor installer nor any other program should behave in such a way.

I'm not saying that you did a mistake at some step. No, absolutely now. I'm just trying to figure out how (under which circumstances) that could happen to take such cases into account and prevent such disasters in the future.


psyray, BTW, next to the messages.log file that you attached at the beginning, could be messages.log.1 and messages.log.2 be stored. If this is the case could you please attach those files as well?

Thanks for all your support.
Dmitry
Comment 11 psyray 2010-08-19 11:06:39 UTC
I have only the messages.log
messages.log.1 is empty and there is no other messages.log.x

I searched any information that could be useful for you, but i can't find anymore.
Comment 12 Jaroslav Tulach 2010-08-19 12:07:34 UTC
Back out or refine fix for bug 145936.
Comment 13 Jesse Glick 2010-08-19 14:04:34 UTC
(In reply to comment #6)
> Your conf file seems to be correct.

Indeed, this has

netbeans_default_userdir="${HOME}/.netbeans/6.9"

as expected. Perhaps this was not the conf file you actually used when you launched NB? Or perhaps you passed '--userdir ~' or something? I still have no clue how this happened.

Anyway, can be more careful about deleting only things we expect to be there and with safe-looking names: core-main #2087e0d84e9d
Comment 14 Quality Engineering 2010-08-20 03:11:32 UTC
Integrated into 'main-golden', will be available in build *201008200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/2087e0d84e9d
User: Jesse Glick <jglick@netbeans.org>
Log: #189656: delete skeletal userdir carefully in case it was not empty to begin with.
Comment 15 dlipin 2010-08-31 14:17:58 UTC
Wrong userdir/currentdir detection were probably caused by the Issue #189105.
Comment 16 Jesse Glick 2010-09-20 20:35:51 UTC
(In reply to comment #15)
> Wrong userdir/currentdir detection were probably caused by the Issue #189105.

But the fix for that only applied to Platform apps, not the NB IDE.
Comment 17 Petr Suchomel 2010-10-18 09:29:52 UTC
Backported into release692 http://hg.netbeans.org/releases/rev/b68a1589276f
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo