Menu

#40 Unable to use Ubuntu AMI due to non-root user and SCP

open
nobody
5
2014-12-19
2010-05-13
D C
No

I have been trying to get an Ubuntu AMI image working to no avail. It keeps failing when I try to publish my server config from within Eclipse. After some digging, I believe this is because the call to scp to copy the files is assuming ROOT user. The AMI image does not accept this as a default user; which should be 'ubuntu' (i.e. ubuntu@publicdns

NOTE: I've created the /env directory with a sym link to my jdk and tomcat 6.0.16. This is all correct AFAICT

OS: Windows XP
EC2 AMI: Ubuntu 32bit 9.10 from alestic.com

Here is the output from running eclipse with -debug -consolelog:
<snip>
Start VM: -Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-XX:MaxPermSize=256m
-Djava.class.path=C:\Documents and Settings\Daniel\eclipse_3.5.2\plugins/org.ecl
ipse.equinox.launcher_1.0.201.R35x_v20090715.jar
-os win32
-ws win32
-arch x86
-showsplash C:\Documents and Settings\Daniel\eclipse_3.5.2\\plugins\org.eclipse.
platform_3.3.202.v201002111343\splash.bmp
-launcher C:\Documents and Settings\Daniel\eclipse_3.5.2\eclipse.exe
-name Eclipse
--launcher.library C:\Documents and Settings\Daniel\eclipse_3.5.2\plugins/org.ec
lipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519\eclipse_1206.dll
-startup C:\Documents and Settings\Daniel\eclipse_3.5.2\plugins/org.eclipse.equi
nox.launcher_1.0.201.R35x_v20090715.jar
-product org.eclipse.epp.package.jee.product
-debug
-consoleLog
-vm C:\Program Files\Java\jre6\bin\client\jvm.dll
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-XX:MaxPermSize=256m
-Djava.class.path=C:\Documents and Settings\Daniel\eclipse_3.5.2\plugins/org.ecl
ipse.equinox.launcher_1.0.201.R35x_v20090715.jar
Install location:
file:/c:/Documents and Settings/Daniel/eclipse_3.5.2/
Configuration file:
file:/c:/Documents and Settings/Daniel/eclipse_3.5.2/configuration/config.in
i loaded
Configuration location:
file:/c:/Documents and Settings/Daniel/eclipse_3.5.2/configuration/
Framework located:
file:/c:/Documents and Settings/Daniel/eclipse_3.5.2/plugins/org.eclipse.osg
i_3.5.2.R35x_v20100126.jar
Loading extension: reference:file:javax.transaction_1.1.1.v201002111330.jar
eclipse.properties not found
Loading extension: reference:file:org.eclipse.persistence.jpa.equinox.weaving_1.
1.3.v20091002-r5404.jar
eclipse.properties not found
Framework classpath:
file:/c:/Documents and Settings/Daniel/eclipse_3.5.2/plugins/org.eclipse.osg
i_3.5.2.R35x_v20100126.jar
file:/c:/Documents and Settings/Daniel/eclipse_3.5.2/plugins/
file:/c:/Documents and Settings/Daniel/eclipse_3.5.2/plugins/javax.transacti
on_1.1.1.v201002111330.jar
file:/c:/Documents and Settings/Daniel/eclipse_3.5.2/plugins/org.eclipse.per
sistence.jpa.equinox.weaving_1.1.3.v20091002-r5404.jar
Splash location:
C:\Documents and Settings\Daniel\eclipse_3.5.2\\plugins\org.eclipse.platform
_3.3.202.v201002111343\splash.bmp
Debug options:
file:/C:/Documents and Settings/Daniel/eclipse_3.5.2/.options not found
Time to load bundles: 15
!SESSION 2010-05-12 21:31:15.218 -----------------------------------------------

eclipse.buildId=unknown
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.
package.jee.product -debug -consoleLog

!ENTRY org.eclipse.equinox.p2.repository 4 0 2010-05-12 21:31:16.125
!MESSAGE ProvisioningEventBus could not be obtained. Metadata caches may not be
cleaned up properly.
Starting application: 938
Application Started: 46438
May 12, 2010 9:33:45 PM com.amazonaws.ec2.cluster.Cluster launchServiceContainerInstances
INFO: Launching 1 service container instances
May 12, 2010 9:33:45 PM com.amazonaws.eclipse.ec2.Ec2InstanceLauncher startInstances
INFO: Requested to start 1 new instances.
May 12, 2010 9:34:07 PM com.amazonaws.ec2.cluster.Cluster launchServiceContainerInstances
INFO: Successfully started 1 instance(s).
May 12, 2010 9:34:07 PM com.amazonaws.eclipse.ec2.RemoteCommandUtils copyRemoteFile
INFO: Copying file C:\DOCUME~1\Daniel\LOCALS~1\Temp\ec2archive3491319647547856934.zip to ec2-75-101-215-218.compute-1.amazonaws.com:/tmp/ec2archive3491319647547856934.zip
com.jcraft.jsch.JSchException: java.net.ConnectException: Connection refused: connect
at com.jcraft.jsch.Util.createSocket(Util.java:386)
at com.jcraft.jsch.Session.connect(Session.java:182)
at com.jcraft.jsch.Session.connect(Session.java:150)
at com.amazonaws.eclipse.ec2.RemoteCommandUtils.createSshSession(RemoteCommandUtils.java:467)
at com.amazonaws.eclipse.ec2.RemoteCommandUtils.copyRemoteFileWithoutRetrying(RemoteCommandUtils.java:336)
at com.amazonaws.eclipse.ec2.RemoteCommandUtils.copyRemoteFile(RemoteCommandUtils.java:121)
at com.amazonaws.eclipse.wtp.tomcat.Ec2TomcatServer.publishServerConfiguration(Ec2TomcatServer.java:170)
at com.amazonaws.ec2.cluster.Cluster.publishServerConfiguration(Cluster.java:367)
at com.amazonaws.eclipse.wtp.ElasticClusterBehavior.publishServer(ElasticClusterBehavior.java:536)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:866)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:708)
at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:2731)
at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:278)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
May 12, 2010 9:34:31 PM com.amazonaws.eclipse.ec2.RemoteCommandUtils copyRemoteFile
INFO: Copying file C:\DOCUME~1\Daniel\LOCALS~1\Temp\ec2archive3491319647547856934.zip to ec2-75-101-215-218.compute-1.amazonaws.com:/tmp/ec2archive3491319647547856934.zip
May 12, 2010 9:34:38 PM com.amazonaws.eclipse.ec2.RemoteCommandUtils copyRemoteFile
INFO: Copying file C:\DOCUME~1\Daniel\LOCALS~1\Temp\ec2archive3491319647547856934.zip to ec2-75-101-215-218.compute-1.amazonaws.com:/tmp/ec2archive3491319647547856934.zip
May 12, 2010 9:34:44 PM com.amazonaws.eclipse.ec2.RemoteCommandUtils copyRemoteFile
INFO: Copying file C:\DOCUME~1\Daniel\LOCALS~1\Temp\ec2archive3491319647547856934.zip to ec2-75-101-215-218.compute-1.amazonaws.com:/tmp/ec2archive3491319647547856934.zip
May 12, 2010 9:34:47 PM com.amazonaws.eclipse.wtp.DebugConnectionManager connect
SEVERE: Unable to connect debugger: Failed to connect to remote VM. Connection refused.
org.eclipse.core.runtime.CoreException: Failed to connect to remote VM. Connection refused.
at org.eclipse.jdt.internal.launching.SocketAttachConnector.abort(SocketAttachConnector.java:94)
at org.eclipse.jdt.internal.launching.SocketAttachConnector.connect(SocketAttachConnector.java:150)
at com.amazonaws.eclipse.wtp.DebugConnectionManager.connect(DebugConnectionManager.java:88)
at com.amazonaws.eclipse.wtp.ElasticClusterBehavior.publishFinish(ElasticClusterBehavior.java:180)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:887)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:708)
at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:2731)
at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:278)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at org.eclipse.jdi.internal.connect.SocketTransportService$2.run(SocketTransportService.java:136)
at java.lang.Thread.run(Unknown Source)

!ENTRY com.amazonaws.eclipse.ec2 4 0 2010-05-12 21:34:47.328
!MESSAGE Unable to publish server configuration files: Unable to copy remote file after trying 4 times
local file: 'C:\DOCUME~1\Daniel\LOCALS~1\Temp\ec2archive3491319647547856934.zip'
remote file: '/tmp/ec2archive3491319647547856934.zip'

Results from first attempt:
Unexpected exception: java.net.ConnectException: Connection refused: connect
root cause: java.net.ConnectException: Connection refused: connect

!STACK 0
com.amazonaws.eclipse.ec2.RemoteFileCopyException: Unable to copy remote file after trying 4 times
local file: 'C:\DOCUME~1\Daniel\LOCALS~1\Temp\ec2archive3491319647547856934.zip'
remote file: '/tmp/ec2archive3491319647547856934.zip'

Results from first attempt:
Unexpected exception: java.net.ConnectException: Connection refused: connect
root cause: java.net.ConnectException: Connection refused: connect

at com.amazonaws.eclipse.ec2.RemoteCommandUtils.copyRemoteFile(RemoteCommandUtils.java:128)
at com.amazonaws.eclipse.wtp.tomcat.Ec2TomcatServer.publishServerConfiguration(Ec2TomcatServer.java:170)
at com.amazonaws.ec2.cluster.Cluster.publishServerConfiguration(Cluster.java:367)
at com.amazonaws.eclipse.wtp.ElasticClusterBehavior.publishServer(ElasticClusterBehavior.java:536)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:866)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:708)
at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:2731)
at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:278)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
</snip>

Discussion

  • D C

    D C - 2010-05-13

    Note that in RemoteCommandUtils.java, the following line hardcodes the root user. Nasty

    <snip>
    Session session = jsch.getSession("root", instance.getPublicDnsName(), 22);
    </snip>

     
  • Jason Fulghum

    Jason Fulghum - 2010-05-17

    Hey dpcowx, the tools currently make some assumptions about the remote EC2 instances, but I see your point that making some of these more configurable could help some users.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.