Bug 196035 - [dstore] error logged when user cannot create folder/File under root
Summary: [dstore] error logged when user cannot create folder/File under root
Status: CLOSED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P5 trivial (vote)
Target Milestone: 2.0.1   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on: 196317
Blocks:
  Show dependency tree
 
Reported: 2007-07-10 13:50 EDT by Rupen Mardirossian CLA
Modified: 2007-08-08 11:19 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rupen Mardirossian CLA 2007-07-10 13:50:04 EDT
To reproduce, 

1)create a linux-dstore connection
2)right click on root, New-->Folder
3)enter in folder name and press Finish

you get an error shown to the user in red font : "Creation of the folder failed"

along with this error log entry that is not required and should not be logged im presuming:

!ENTRY org.eclipse.rse.ui 4 0 2007-07-10 13:47:49.490
!MESSAGE SystemNewFolderWizard:
!STACK 0
org.eclipse.rse.services.clientserver.messages.SystemMessageException: Creation of the folder failed
	at org.eclipse.rse.internal.services.dstore.files.DStoreFileService.createFolder(DStoreFileService.java:910)
	at org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem.createFolder(FileServiceSubSystem.java:563)
	at org.eclipse.rse.internal.files.ui.wizards.SystemNewFolderWizard.performFinish(SystemNewFolderWizard.java:162)
	at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:742)
	at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:373)
	at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:616)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
	at org.eclipse.jface.window.Window.open(Window.java:796)
	at org.eclipse.rse.ui.actions.SystemBaseDialogAction.run(SystemBaseDialogAction.java:299)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:545)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:402)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1144)


-----------Enter bugs above this line-----------
TM 2.0.0.1 Testing
installation : eclipse-SDK-3.3M7 
RSE install  : RSE-SDK-2.0.0.1
java.runtime : Sun 1.5.0_06-b05
os.name:     : Windows XP 5.1, Service Pack 2
------------------------------------------------
systemtype   : Linux - dstore
------------------------------------------------
Comment 1 David McKnight CLA 2007-07-11 10:50:18 EDT
If you connect to the host as "root", then this does not fail.  You're not able to create folders or files under / because you don't have authority to do that.  Is the reported problem that the error logging is unneeded?
Comment 2 Rupen Mardirossian CLA 2007-07-11 11:00:31 EDT
I was assuming that logging is uneeded due to the user being informed of the error in the view.  Is this correct?
Comment 3 David McKnight CLA 2007-07-11 13:10:42 EDT
Well, the logging probably isn't needed and this log doesn't occur for ftp and ssh.   FTP and SSH throw RemoteFileSecurityExceptions which wrapper the service-layer exception.  Dstore doesn't throw service-layer exceptions so we have to generate an exception - in this case we use SystemMessageException.  The wizard takes any SystemMessageException it catches and logs them, which is why we see the log for dstore but not for the other services.  The SystemMessageException is necessary but I can stick that in a RemoteFileSecurityException to make this consistent with the other services.
Comment 4 David McKnight CLA 2007-07-11 13:14:44 EDT
I've committed the change to wrapper with the security exception (for the sake of consistency).
Comment 5 Martin Oberhuber CLA 2007-07-12 07:04:37 EDT
Do we really need to log any SystemMessageException we get, especially in wizards and dialogs? - We have bug #142184 open for a very similar issue. 

At this point I'd like to understand why SystemMessageException is logged to the error log even if it's already being shown to the user by means of a dialog.
Comment 6 David McKnight CLA 2007-07-12 08:28:37 EDT
(In reply to comment #5)
> Do we really need to log any SystemMessageException we get, especially in
> wizards and dialogs? - We have bug #142184 open for a very similar issue. 
> 

I don't see the need to log this.

> At this point I'd like to understand why SystemMessageException is logged to
> the error log even if it's already being shown to the user by means of a
> dialog.
> 

I don't know why it is logged.  I'd guess the logging is there to handle unexpected situations.
Comment 7 Martin Oberhuber CLA 2007-07-12 09:33:29 EDT
(In reply to comment #6)
> I don't know why it is logged.  I'd guess the logging is there to handle
> unexpected situations.

I'm a big friend of logging stuff in order to ease problem determination; just tell a customer "send us the logs" and you'll know what went wrong.

But I think that such kind of Logs should be hidden from the user. Having stuff in the "PDE Errorlog" View aka Eclipse Log often disturbs users and makes them lose confidence in the product, since they think something went wrong.

But in fact, SystemMessageException is typically used to give feedback about the normal outcome of an operation e.g. could not rename a file because it was read only. This is not an unexpected situation and should thus not be logged to the Errorlog. Same for feedback about invalid user input.

Isn't there a special RSE Log which is typically not visible to the user and configurable via the Preferences? If we think we must log SystemMessageException (which I personally do NOT think we should) we could perhaps log it there. And organize the Log as a bounded buffer so it doesn't grow to the 100 Megabyte Range.

Thoughts?

Comment 8 David McKnight CLA 2007-07-12 09:41:37 EDT
If we look at the code in SystemNewFolderWizard, the non-SystemMEssageExceptions are logged via SystemBasePlugin.logDebugMessage().  I suppose it would make sense to do the same for the SystemMessageExceptions.

		
Comment 9 Martin Oberhuber CLA 2007-07-12 10:17:06 EDT
This sounds like a good idea, but I'm afraid that messages logged with logDebugMessage() will never actually be logged because the logging level Logger.DEBUG cannot be set any more in the UI (Only levels ERROR, WARNING and INFO are now available).

Dave D made this change because with level DEBUG it was not possible to use RSE any more since it became too slow.

Again, the question is what do we log and where? - I filed bug #196317 (assigned to Dave D) to continue this discussion. When that one is fixed, wrappering the SystemMessageException should be revisited.
Comment 10 Rupen Mardirossian CLA 2007-07-26 14:31:47 EDT
I see that this bug has been resolved/fixed although there is still a log appearing as initially stated when I opened the bug... getting lost in all the comment I don't know if that is the behaviour that was decided on.  I guess what im asking is if it is ok to close this bug?
Comment 11 Martin Oberhuber CLA 2007-07-27 13:34:35 EDT
If you still see the original issue (something logged to the PDE Errorlog although a message is already shown to the user), then this is not fixed --> REOPENING.

I think this should probably be marked as a duplicate of bug 196317, asking that SystemMessageException should not be logged to the PDE Errorlog but somewhere else instead.
Comment 12 David McKnight CLA 2007-07-30 16:23:23 EDT
Rupen, I tried this but I'm not seeing the error logged.  Could you list the steps you took to reproduce this?
Comment 13 Rupen Mardirossian CLA 2007-08-08 11:18:53 EDT
The logging is no longer present.  I will close the bug.  I apologize for any confusion.

Thank you,
Rupen
Comment 14 Rupen Mardirossian CLA 2007-08-08 11:19:35 EDT
closing.