IntelliJ Delete My Entire Drive !!!!

I'm speechless now.

Got 3 partition, C, D, E.
C:\ - Windows, Program Files, etc
D:\ - CVS Server, Development Files, etc
E:\ - SQL Server, IntelliJ, etc

To cut short, I'm developing a strutsojbejb based web application. So, in IntelliJ, I created 4 modules:
1. Application
2. EJB
3. Struts
4. Webapps

At first, I created a war file for my webapps and ear file for the entire ejb, struts and webapps war.

Then I tried to enable the Web Module exploded directory for my Webapps and I point to my D:\
When I rebuild my project, the exploded files were copied to my D:\ but later ALL MY FILES were deleted! Only files, all my folder remains !

This is really pain in the ass!!!

0
Avatar
Permanently deleted user

On Sun, 06 Mar 2005 05:52:04 +0300, Eddie Yan wrote:

Then I tried to enable the Web Module exploded directory for my Webapps
and I point to my D:\ When I rebuild my project, the exploded files were


Oh man that really stinks, but I couldn't help but laugh, even thou its no
laughing matter :(

From memory IDEA will delete the contents of the exploded directory before
exploding. Much the same as it has an option to clear the build directory
before building ( ensuring a clean build ).

Why on earth did you choose d:\ the exploded DIRECTORY for the app in
the first place? If thats the root of your cvs and source files, it seems
mighty silly to use the root of it for something like this.

Interesting that the folders remain thou...

0
Avatar
Permanently deleted user

Ouch. Sorry.

I did a little research and I found some code words to define what
happened. Nothing personal, we have all done something that wasn't too
bright with hind sight. At least you can have a drink and laugh at it.

I once deleted production data containing billing information for about
2K patients and payroll information for about 300 medical therapists in
the middle of the work day. Damn, why didn't I begin a transaction?

PEBCAK <http://www.webopedia.com/TERM/P/PEBCAK.html>

ID10T <http://www.computerhope.com/jargon/i/id10t.htm>


Norris Shelton
Sun Certified Java Programmer



Eddie Yan wrote:

>I'm speechless now.
>
>Got 3 partition, C, D, E.
>C:\ - Windows, Program Files, etc
>D:\ - CVS Server, Development Files, etc
>E:\ - SQL Server, IntelliJ, etc
>
>To cut short, I'm developing a strutsojbejb based web application. So, in IntelliJ, I created 4 modules:
>1. Application
>2. EJB
>3. Struts
>4. Webapps
>
>At first, I created a war file for my webapps and ear file for the entire ejb, struts and webapps war.
>
>Then I tried to enable the Web Module exploded directory for my Webapps and I point to my D:\
>When I rebuild my project, the exploded files were copied to my D:\ but later ALL MY FILES were deleted! Only files, all my folder remains !
>
>This is really pain in the ass!!!
>
>

>

0
Avatar
Permanently deleted user

My sincere condolences; something similar once happened to me when I used eclipse (one of the reasons I prefer IDEA).

Nevertheless, it did remind me of what I consider the funniest anecdote I ever came across (I would have submitted this long ago to "computer stupidities" at http://www.rinkworks.com/stupid/ but they have unfortunately stopped accepting submissions). So, I'll just post it here for your enjoyment:

I used to work for a company developing enterprise catalog management software. At one time a new prospect customer required support for a somewhat unusual combination of OS, database and app server (I don't recall all details) which we boldly claimed to support (with maybe a little too little testing).
Then after a few days of successful operation, the installation they were running suddenly disappeared from the file system completely; the VM kept running for a few seconds before choking on countless exceptions. So, we did a reinstall, started the system again and waited until the same thing happened again a few days later.
Of course the prospect was not too happy and we promised him to treat this with top priority, and all our engineers looked at it for many hours. Then finally we found out what it was: A colleague of mine had put a bit of code into a class that essentially looked like this:

A clear case for good exception handling.

Regards,
Jens

P.S.: The customer (or actually my employer) was lucky they weren't running the standard version which had an embedded database because that was also stored below the root dir!

0
Avatar
Permanently deleted user

Yeah.. it stinks bad! You are right, all my cvs root is there. I know I should have point it to another box, but just too lazy to migrate all my projects there!

still able to recover 90% of my deleted files through some UnDelete software. That's real good news to me already.

It's my dumb to explode to d drive, but the software shouldn't have deleted ALL my files!!! My folders remains, only all files inside those folders(& subfolders) got deleted!

It's about 17Gb of my data!

0
Avatar
Permanently deleted user

Hmm,
so what would be an algorithm for us to know you configured something the
other way you actually like to? Something like "You're about to delete more
than 50% of the files on your computer. Are you sure?" Sorry for my sarcasm
here but that would tricky indeed to understand something wrong is gonna
happen. Any ideas?

-


Maxim Shafirov
http://www.jetbrains.com
"Develop with pleasure!"

Yeah.. it stinks bad! You are right, all my cvs root is there. I know
I should have point it to another box, but just too lazy to migrate
all my projects there!

still able to recover 90% of my deleted files through some UnDelete
software. That's real good news to me already.

It's my dumb to explode to d drive, but the software shouldn't have
deleted ALL my files!!! My folders remains, only all files inside
those folders(& subfolders) got deleted!

It's about 17Gb of my data!




0
Avatar
Permanently deleted user

Would it be useful and easy enough to check when the user first points to a root directory and warn?

Jon

0
Avatar
Permanently deleted user

Check for what? Drive root? Program Files folder? /etc/bin? c:\windows\system32?
C:\Program Files\Adobe\Photoshop? I could come up with zillion variants of
unwanted and probably harmful setups. There's quite interesting idea though
(by Rob Harwood) to check exploded directory setup for emptyness. That could
probably become annoying for those who doing setup IDEA project over existing
one.

-


Maxim Shafirov
http://www.jetbrains.com
"Develop with pleasure!"

Would it be useful and easy enough to check when the user first points
to a root directory and warn?

Jon




0
Avatar
Permanently deleted user

On Mon, 07 Mar 2005 18:33:44 +0300, Jon Steelman wrote:

Would it be useful and easy enough to check when the user first points to
a root directory and warn?


Define root thou. You might have accidentally chosen d:\cvs instead, and
blamo....

0
Avatar
Permanently deleted user

I was just suggesting drive root. Rob's non-emptiness is a good test and you could add a checkbox to the warning dialog for the user not to be bothered again by the warning.

0
Avatar
Permanently deleted user

>you could add a checkbox to the warning dialog for the user not to be bothered again by the warning.

For safety, I'd make this "don't bother me again with this warning for this directory", rather than a blanket "don't bother me again with this warning. More coding, but that's why they pay you guys the big bucks.

Note that this can also happen if someone were to set their output directories to something horrible on a non-web project, and then does Rebuild Project.

--Dave Griffith

0
Avatar
Permanently deleted user

No matter which directory or root drive a user defined, the software shouldn't traverse to others directory and deleted ALL other files that are not even java, jar, war, jsp, etc!

The software might run some post processes to deleted unwanted files after exploding to a directory/drive, but should only limited to files related to the explode process. If there is no way to detect which files to delete, just output the explode file to a temp directory, move it to the target directory/drive and delete the temp directory. Just my 2 cents.

Why on the holy green earth that IntelliJ do that? I mean deleting files that are not related to the project? It's just not right!

Say, if you are creating a new Word file in MSWord and you save to root drive, once you save the file, all your other files will be deleted without a warning whatsoever. Bill says: the user shouldn't save to the root drive!

Is this a known bugs? Or would IntelliJ classified this as a bug? Is there a proper forums/channels to report this bug.

0

There must definitely be a warning before doing any kind of "clean" stuff.

I know the first thing *NIX users do is to setup this alias on 'rm' like 'rm -i', so they don't accidentaly delete files without warning.

PS: The same *NIX users also have aliases like 'rm -rf' so they yank those darn folders in one shot ;)

0

Do you have local versioning turned on?

Even so, I don't think it would be working for output folders :(

I've accidentaly deleted files with IDEA but was able to recover by using local VCS.

0

Dumping the Exploded dir to a temp folder or Local VCS on them is not a bad idea. But I wonder how long would it take for IDEA to VCS the root drive like C:\

0
Avatar
Permanently deleted user

I would not treat this as an bug. You just used an strange configuration
and ideally IDEA had placed an warning.

Is this a known bugs? Or would IntelliJ classified this as a bug? Is there a proper forums/channels to report this bug.

0
Avatar
Permanently deleted user

What about checking if one of the source directories is an sub-directory
of the exploded/classfiles directory?

Maxim Shafirov schrieb:

with zillion variants of unwanted and probably harmful setups. There's
quite interesting idea though (by Rob Harwood) to check exploded
directory setup for emptyness. That could probably become annoying for

0
Avatar
Permanently deleted user

it's not strange though.. say if I output to another directory(not empty) like d:\cvs, all files inside that directory will be deleted as well.

We shouldn't output to those directory, but still the software have no rights to delete other files. The behaviour is wrong. At least there should be a warning message.

0
Avatar
Permanently deleted user

Maxim Shafirov wrote:

Hmm, so what would be an algorithm for us to know you configured
something the other way you actually like to? Something like "You're
about to delete more than 50% of the files on your computer. Are you
sure?" Sorry for my sarcasm here but that would tricky indeed to
understand something wrong is gonna happen. Any ideas?


I submitted a Jira issue that there should be a warning if the user
selects an exploded folder with existing content.

--
Rob Harwood
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Avatar
Permanently deleted user

Eddie Yan wrote:

Is there a proper forums/channels to report this bug.


The place to report and discuss specific bugs is
http://www.jetbrains.net/jira/ under project IDEA: Feedback.

This newsgroup is a good place to discuss bugs/problems in general. So
yes, this is the proper place to discuss in general, but also a bug
report would have been appropriate too. I added one already for this
issue (with my own suggestions) at
http://www.jetbrains.net/jira/browse/IDEA-783.

--
Rob Harwood
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Avatar
Permanently deleted user

Eddie Yan wrote:

it's not strange though.. say if I output to another directory(not empty) like d:\cvs, all files inside that directory will be deleted as well.

We shouldn't output to those directory, but still the software have no rights to delete other files. The behaviour is wrong. At least there should be a warning message.


The strangeness is that you set a webapp exploded directory to some dir
that already contains important info. That means Tomcat, or whatever
server, will be able to access your entire drive. That's not typically
how you use an exploded dir. The exploded dir is like a 'build' dir that
you might make using Ant. When you do an 'ant clean', you usually expect
it to delete your build dir. That's what's happening with the exploded
dir. IDEA is 'cleaning' the dir so that it contains only those files
specified by the Web Module that you've configured.

I agree that there should be a warning of some sort before deleting (or
before configuring).

--
Rob Harwood
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Avatar
Permanently deleted user

That would be a very good move.


0
Avatar
Permanently deleted user

Plain and simple: any software (unless it is a format
command) MUST NOT delete files which was not created by it.

When files are generated/copied to the exploded directory,
the directories' and files' names must be collected and
stored by IDEA (including names, dates, sizes and a
checksum; checksum generation should be able to be turned
off). Later it can delete ONLY THESE files. Check the
uninstall programs, they do not delete files that were
created by the software which they delete.

If IDEA for some reason lost track of the files, it MUST NOT
delete them!

"Maxim Shafirov" <max@jetbrains.com> wrote in message
news:c8a8a1bf5d748c6f15aaaf747a5@news.jetbrains.com...

Hmm,
so what would be an algorithm for us to know you

configured something the

other way you actually like to? Something like "You're

about to delete more

than 50% of the files on your computer. Are you sure?"

Sorry for my sarcasm

here but that would tricky indeed to understand something

wrong is gonna

happen. Any ideas?



0
Avatar
Permanently deleted user

This IS a bug. Well, not even a bug, just a lack of
precaution feature: here, have your nuclear powerplant and
you can pull up the rods anytime you want. Caboom.

"Sven Steiniger" <sven.steiniger@gmx.de> wrote in message
news:d0jojo$nca$1@is.intellij.net...

I would not treat this as an bug. You just used an strange

configuration

and ideally IDEA had placed an warning.

>

Is this a known bugs? Or would IntelliJ classified

this as a bug? Is there a proper forums/channels to report
this bug.


0
Avatar
Permanently deleted user

You just plain and simply wrong Michael. Well at least to the conclusions
you make.

How about these sample workflows:
1. One starts with an existing project creating IDEA modules and project
over files that were already on disk when the IDEA project have been created.
Then one tries to use CVS integration to synchronize with source repository.
Ooops, files deleted in the repository aren't deleted from the local disk.
Is that good? Is that what you expect from the software to do?

Well, while sample 1 is not more than just funny thing the second one is
exactly to the case
2. Part of the build process is performed with Ant task which is being run
before compilation. This task generates some class files directly to the
build (or exploded) directory. One then switches this task off. Voi la, generated
class files stall forever in the build directory.

Finally, IDEA is not an "unistaller" software. It is actually yeah a bit
more complex stuff designed for more experienced audience than regular PC
user, isn't it?
Did you checked out IDEA behavior against other IDEs or similar software?
Doesn't 'clean build' command perform a clean build usually?

-


Maxim Shafirov
http://www.jetbrains.com
"Develop with pleasure!"

Plain and simple: any software (unless it is a format command) MUST
NOT delete files which was not created by it.

When files are generated/copied to the exploded directory, the
directories' and files' names must be collected and stored by IDEA
(including names, dates, sizes and a checksum; checksum generation
should be able to be turned off). Later it can delete ONLY THESE
files. Check the uninstall programs, they do not delete files that
were created by the software which they delete.

If IDEA for some reason lost track of the files, it MUST NOT delete
them!

"Maxim Shafirov" <max@jetbrains.com> wrote in message
news:c8a8a1bf5d748c6f15aaaf747a5@news.jetbrains.com...

>> Hmm,
>> so what would be an algorithm for us to know you

configured something the

>> other way you actually like to? Something like "You're
>>

about to delete more

>> than 50% of the files on your computer. Are you sure?"
>>

Sorry for my sarcasm

>> here but that would tricky indeed to understand something
>>

wrong is gonna

>> happen. Any ideas?
>>



0
Avatar
Permanently deleted user

How about these sample workflows:
1. One starts with an existing project creating IDEA

modules and project

over files that were already on disk when the IDEA project

have been created.

Then one tries to use CVS integration to synchronize with

source repository.

Ooops, files deleted in the repository aren't deleted from

the local disk.

Is that good? Is that what you expect from the software to

do?

I haven't worked much with CVS, (I work with StarTeam) but
if it cannot provide the information that these files
existed in the version control system before, then this is a
bad system. If it can provide this information, then
existing files and deleted files can be matched and more
concise decision can be made on FILE BY FILE basis. Not
plainly deleting everything in the directory and under it.

Well, while sample 1 is not more than just funny thing the

second one is

exactly to the case
2. Part of the build process is performed with Ant task

which is being run

before compilation. This task generates some class files

directly to the

build (or exploded) directory. One then switches this task

off. Voi la, generated

class files stall forever in the build directory.


First off, Ant is a different build system. When you guys
were asked to base IDEA projects on Ant scripts, you
(JetBrains developers) responded that it would not be
feasible. So, no one expects you to be responsible for
whatever Ant script can create or delete.

Second, Ant script is a fancy batch file, and batch file is
a set of OS commands, and OS commands can delete files,
right. So OS commands and batch scripts are used by
experienced users who KNOW EXACTLY what they do. And they
know that if they delete something then there is no one else
to blame but them. After all, they wrote that delete command
themselves, explicitly.

Automated build performed by IDE (any IDE) is a different
thing. IDE is responsible for its actions and should not
delete anything unless a user runs an explicit rmdir /S
command. Users may be stupid or drunk or distracted or just
learning the build process, they must be helped. Build
process means compiling known java files into known class
files and creating jar, war and whatever other files. You
know exactly which files were created, so please delete only
them. If I switched some Ant task off, this is entirely not
your business! Maybe I wanted to leave these classes there,
and to recompile only other files.

Finally, IDEA is not an "unistaller" software. It is

actually yeah a bit

more complex stuff designed for more experienced audience

than regular PC

user, isn't it?


This is the lame excuse. Chernobyl power station was made
for experienced users too. And so was Bhopal chemical plant.
And so was Titanic. The more automatization and more
concentration of command, the more the price of error.


0
Avatar
Permanently deleted user

Thank you for your reply Maxim.

I have to agree with Michael on this. The CVS integration, app server integration, refactoring, build, and some much more integration is one of the reason we use IDEA.

A single user interface that we do not need to mess around with the build directory, classpath, library, etc.
I issue a command to explode my project to a directory/drive and how IntelliJ do the logic to explode it is beyond my control.

Any experienced user will not care how the exploding is being done as long as they got the exploded directory. Now that we got the exploded directory with all our files within the same directory/drive got deleted.

It's not "Develop with pleasure" anymore.

0
Avatar
Permanently deleted user


I know it's not right to explode to some important directory. It's just an example, the real development environment might be more complex.

There should be warning even before letting user configuring that option and additional warning before deleting since IntelliJ is using Ant tool that will wipe out all files when rebuilding project.

0
Avatar
Permanently deleted user

+When files are generated/copied to the exploded directory,
the directories' and files' names must be collected and
stored by IDEA (including names, dates, sizes and a
checksum; checksum generation should be able to be turned
off). Later it can delete ONLY THESE files. Check the
uninstall programs, they do not delete files that were
created by the software which they delete.+

I'd be very worried as to how much time would be added to tehe build process, if IDEA had to comprehensively log every file that it copied over. Ignoring the fact that some projects can run into tens of thousands of class files, there are also graphic files, XML files, properties files ....

And of course I have run across a lot of projects that add extra files to the exploded directory whilst the application is running. Since IDEA didn't create these files, then any attempt to clean the directory will fail.

0
Avatar
Permanently deleted user

I'm still a little confused as to why anyone would do _anything _in their root directory, let along build project files.

But I was thinking a while ago, that perhaps it would tidy things up nicely, if the actual build process was integrated into the project structure a little better.

You have this great system in Paths, for setting up different content areas.

For example:

Excluded sources
Sources
Test Sources

Is there something that can be added here to get around this poblem?

I'm thinking that the directory for building the projct could be placed here. It's not a foolproof solution, but since the developer has to manually add a content root before he can add a build directory, he'd have to work rather hard to screw himself up.



0
Avatar
Permanently deleted user

Why on the holy green earth that IntelliJ do that? I mean deleting files that are not related to the project? It's just not right!

That's odd, bcause I'm still sitting here thinking:

"Why on the holy green earth would anyone set their build directory to the root?"

This kind of mistake could easily happen in any build system. ANT will allow you to delete your entire hard drive, if you decide to build the project at the root.

I can write a batch file that will delete my entire hard drive, if I make the mistake of running it at the root.

As I've pointed out, some projects may add files to the exploded directory when the app is running; that means that IDEA will be unable to clean the directory. I'm not sure how typical this is, but I'm sure it occurs a lot more often than folk setting up their entire hard drive, as a temporary folder.

I certainly wouldn't want the build process to be slowed down, by logging every single file that gets added to the exploded directory, so the only thing they could do is put up a warning on the dialog.
Perhaps a reminder that the whole directory and subdirectories will be wiped out. I don't think anything more than this would be needed.

At some point developers have to take responsibility for their own carelessness; I think we have reached this point.



0

请先登录再写评论。