Project: appceleratorstudio
Issue TISTUD-2644: Node.JS: node module commands in empty /usr/bin/ folders are falsely detected by studio
Node.JS: node module commands in empty /usr/bin/ folders are falsely detected by studio. Manifests as null pointer exception when creating alloy project, etc. Note that npm is usually installed in /usr/local/bin Log: {code} !ENTRY com.aptana.core 1 0 2012-10-24 17:30:12.917\ !MESSAGE (Build 3.0.0.201210220122) [INFO] com.aptana.core/debug/shell Running process:\ Process: "/usr/bin/alloy" "new" "/Users/gtavridis/Documents/Titanium Studio Workspace/testapp5" "default"\ Working directory: null\ Environment: \{ANALYTICS_SOURCE=studio, APTANA_VERSION=3.0.0.1346448223, Apple_PubSub_Socket_Render=/tmp/launch-pwIDrd/Render, Apple_Ubiquity_Message=/tmp/launch-iPVDau/Apple_Ubiquity_Message, COMMAND_MODE=unix2003, DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer, DISPLAY=/tmp/launch-Kdr69A/org.x:0, HOME=/Users/gtavridis, JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home, LANG=en_US.UTF-8, LOGNAME=gtavridis, PATH=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin, PWD=/Applications/Titanium_Studio/TitaniumStudio.app/Contents/MacOS, SHELL=/bin/bash, SHLVL=1, SSH_AUTH_SOCK=/tmp/launch-D3IT5p/Listeners, TMPDIR=/var/folders/6g/7gkd364s4bd3_rq7891qgt000000gp/T/, USER=gtavridis, __CF_USER_TEXT_ENCODING=0x1F6:0:0, com.apple.java.jvmMode=client, com.apple.java.jvmTask=JNI\}\ \ !ENTRY com.aptana.projects 2 0 2012-10-24 17:30:40.252\ !MESSAGE Internal error: \ !STACK 1\ org.eclipse.core.runtime.CoreException: \ com.aptana.projects.wizards.AbstractNewProjectWizard$1$1.run(AbstractNewProjectWizard.java:253)\ org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)\ org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2326)\ com.aptana.projects.wizards.AbstractNewProjectWizard$1.run(AbstractNewProjectWizard.java:304)\ org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)\ Caused by: java.lang.reflect.InvocationTargetException\ com.appcelerator.titanium.ui.wizard.BasicNewTitaniumProjectWizard.createNewProject(BasicNewTitaniumProjectWizard.java:310)\ com.aptana.projects.wizards.AbstractNewProjectWizard$1$1.run(AbstractNewProjectWizard.java:249)\	... 4 more\ Caused by: org.eclipse.core.runtime.CoreException: Cannot run program "/usr/bin/alloy": error=13, Permission denied\ com.appcelerator.titanium.ui.wizard.BasicNewTitaniumProjectWizard.finalizeProjectCreation(BasicNewTitaniumProjectWizard.java:344)\ com.appcelerator.titanium.mobile.ui.wizard.NewMobileProjectWizard.finalizeProjectCreation(NewMobileProjectWizard.java:118)\ com.appcelerator.titanium.ui.wizard.BasicNewTitaniumProjectWizard.createNewProject(BasicNewTitaniumProjectWizard.java:306)\	... 5 more\ Caused by: java.io.IOException: Cannot run program "/usr/bin/alloy": error=13, Permission denied\ java.lang.ProcessBuilder.start(ProcessBuilder.java:460)\ com.aptana.core.util.ProcessUtil.startProcess(ProcessUtil.java:327)\ com.aptana.core.util.ProcessUtil.doRun(ProcessUtil.java:322)\ com.aptana.core.util.ProcessUtil.run(ProcessUtil.java:273)\ com.aptana.core.util.ProcessUtil.run(ProcessUtil.java:235)\ com.aptana.core.util.ProcessUtil.runInBackground(ProcessUtil.java:202)\ com.aptana.core.util.ProcessUtil.runInBackground(ProcessUtil.java:108)\ com.appcelerator.titanium.alloy.internal.ui.AlloyTemplateInstaller$AlloyTemplate.apply(AlloyTemplateInstaller.java:79)\ com.appcelerator.titanium.ui.wizard.BasicNewTitaniumProjectWizard.finalizeProjectCreation(BasicNewTitaniumProjectWizard.java:341)\	... 7 more\ Caused by: java.io.IOException: error=13, Permission denied\ java.lang.UNIXProcess.forkAndExec(Native Method)\ java.lang.UNIXProcess.(UNIXProcess.java:53)\ java.lang.ProcessImpl.start(ProcessImpl.java:91)\ java.lang.ProcessBuilder.start(ProcessBuilder.java:453)\	... 15 more\ !SUBENTRY 1 com.aptana.projects 4 0 2012-10-24 17:30:40.255\ !MESSAGE \ !STACK 0\ java.lang.reflect.InvocationTargetException\ com.appcelerator.titanium.ui.wizard.BasicNewTitaniumProjectWizard.createNewProject(BasicNewTitaniumProjectWizard.java:310)\ com.aptana.projects.wizards.AbstractNewProjectWizard$1$1.run(AbstractNewProjectWizard.java:249)\ org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)\ org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2326)\ com.aptana.projects.wizards.AbstractNewProjectWizard$1.run(AbstractNewProjectWizard.java:304)\ org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)\ Caused by: org.eclipse.core.runtime.CoreException: Cannot run program "/usr/bin/alloy": error=13, Permission denied\ com.appcelerator.titanium.ui.wizard.BasicNewTitaniumProjectWizard.finalizeProjectCreation(BasicNewTitaniumProjectWizard.java:344)\ com.appcelerator.titanium.mobile.ui.wizard.NewMobileProjectWizard.finalizeProjectCreation(NewMobileProjectWizard.java:118)\ com.appcelerator.titanium.ui.wizard.BasicNewTitaniumProjectWizard.createNewProject(BasicNewTitaniumProjectWizard.java:306)\	... 5 more\ Caused by: java.io.IOException: Cannot run program "/usr/bin/alloy": error=13, Permission denied\ java.lang.ProcessBuilder.start(ProcessBuilder.java:460)\ com.aptana.core.util.ProcessUtil.startProcess(ProcessUtil.java:327)\ com.aptana.core.util.ProcessUtil.doRun(ProcessUtil.java:322)\ com.aptana.core.util.ProcessUtil.run(ProcessUtil.java:273)\ com.aptana.core.util.ProcessUtil.run(ProcessUtil.java:235)\ com.aptana.core.util.ProcessUtil.runInBackground(ProcessUtil.java:202)\ com.aptana.core.util.ProcessUtil.runInBackground(ProcessUtil.java:108)\ com.appcelerator.titanium.alloy.internal.ui.AlloyTemplateInstaller$AlloyTemplate.apply(AlloyTemplateInstaller.java:79)\ com.appcelerator.titanium.ui.wizard.BasicNewTitaniumProjectWizard.finalizeProjectCreation(BasicNewTitaniumProjectWizard.java:341)\	... 7 more\ Caused by: java.io.IOException: error=13, Permission denied\ java.lang.UNIXProcess.forkAndExec(Native Method)\ java.lang.UNIXProcess.(UNIXProcess.java:53)\ java.lang.ProcessImpl.start(ProcessImpl.java:91)\ java.lang.ProcessBuilder.start(ProcessBuilder.java:453)\	... 15 more\ Root exception:\ org.eclipse.core.runtime.CoreException: Cannot run program "/usr/bin/alloy": error=13, Permission denied\ com.appcelerator.titanium.ui.wizard.BasicNewTitaniumProjectWizard.finalizeProjectCreation(BasicNewTitaniumProjectWizard.java:344)\ com.appcelerator.titanium.mobile.ui.wizard.NewMobileProjectWizard.finalizeProjectCreation(NewMobileProjectWizard.java:118)\ com.appcelerator.titanium.ui.wizard.BasicNewTitaniumProjectWizard.createNewProject(BasicNewTitaniumProjectWizard.java:306)\ com.aptana.projects.wizards.AbstractNewProjectWizard$1$1.run(AbstractNewProjectWizard.java:249)\ org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)\ org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2326)\ com.aptana.projects.wizards.AbstractNewProjectWizard$1.run(AbstractNewProjectWizard.java:304)\ org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)\ Caused by: java.io.IOException: Cannot run program "/usr/bin/alloy": error=13, Permission denied\ java.lang.ProcessBuilder.start(ProcessBuilder.java:460)\ com.aptana.core.util.ProcessUtil.startProcess(ProcessUtil.java:327)\ com.aptana.core.util.ProcessUtil.doRun(ProcessUtil.java:322)\ com.aptana.core.util.ProcessUtil.run(ProcessUtil.java:273)\ com.aptana.core.util.ProcessUtil.run(ProcessUtil.java:235)\ com.aptana.core.util.ProcessUtil.runInBackground(ProcessUtil.java:202)\ com.aptana.core.util.ProcessUtil.runInBackground(ProcessUtil.java:108)\ com.appcelerator.titanium.alloy.internal.ui.AlloyTemplateInstaller$AlloyTemplate.apply(AlloyTemplateInstaller.java:79)\ com.appcelerator.titanium.ui.wizard.BasicNewTitaniumProjectWizard.finalizeProjectCreation(BasicNewTitaniumProjectWizard.java:341)\	... 7 more\ Caused by: java.io.IOException: error=13, Permission denied\ java.lang.UNIXProcess.forkAndExec(Native Method)\ java.lang.UNIXProcess.(UNIXProcess.java:53)\ java.lang.ProcessImpl.start(ProcessImpl.java:91)\ java.lang.ProcessBuilder.start(ProcessBuilder.java:453)\	... 15 more\ {code} Steps to Reproduce: 1. Create an empty folder in the following locations: "/usr/bin/alloy" "/usr/bin/npm" "/usr/bin/acs" "/usr/bin/titanium" 2. Try to run studio, create these projects, check for titanium updates, or enable the cli. Actual Result: Fail with permission error. Expected Result: Studio should ignore these false files and run existing npm packages.
Story points: 3