I have a custom centos AMI on which i installed aws-cfn-bootstrap from https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.amzn1.noarch.rpm.
After running cloudformation script,cloud-init is stuck for that instance.
I tried to look into cloud-init.log. I couldn't able to debug the issue.
and I have no idea how to debug this. Help needed, I am currently stuck here. Below are some errors from log. Help me in solving this.
Do I need to change cloud-init.cfg ??
2017-10-10 13:12:26,172 - util.py[DEBUG]: Running command ['mount', '-o', 'ro,sync', '-t', 'iso9660', '/dev/xvda', '/tmp/tmptIJHi2'] with allowed return codes [0] (shell=False, capture=True)
2017-10-10 13:12:26,188 - util.py[DEBUG]: Failed mount of '/dev/xvda' as 'iso9660': Unexpected error while running command.
Command: ['mount', '-o', 'ro,sync', '-t', 'iso9660', '/dev/xvda', '/tmp/tmptIJHi2']
Exit code: 32
Reason: -
Stdout: -
2017-10-10 13:12:27,908 - util.py[DEBUG]: Failed mount of '/dev/xvda' as 'iso9660': Unexpected error while running command.
Command: ['mount', '-o', 'ro,sync', '-t', 'iso9660', '/dev/xvda', '/tmp/tmpJcAGOG']
Exit code: 32
Reason: -
Stdout: -
2017-10-11 04:05:42,847 - util.py[WARNING]: Failed running /var/lib/cloud/instance/scripts/part-001 [1]
2017-10-11 04:05:42,847 - util.py[DEBUG]: Failed running /var/lib/cloud/instance/scripts/part-001 [1]
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 802, in runparts
subp(prefix + [exe_path], capture=False)
File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 1858, in subp
cmd=args)
ProcessExecutionError: Unexpected error while running command.
Command: ['/var/lib/cloud/instance/scripts/part-001']
Exit code: 1
Reason: -
Stdout: -
Stderr: -
BRs,
Kiran
The problem of yours is the mount command.
Are you launch the instance using from existing server (using it's AMI)?
You can check by running the command on that server, and see if it is working or not.
I believe that your command is something like this.
mount -o ro,sync -t iso9660 /dev/xvda /tmp/tmptIJHi2
Related
So I have installed torch in my local machine and it is working correctly, but while deploying it in aws it show the following error.
I am trying to deploy my django app on AWS elastic beanstalk but I am facing the following error.
2021-04-20 18:00:43 INFO Environment update is starting.
2021-04-20 18:00:46 INFO Deploying new version to instance(s).
2021-04-20 18:00:57 ERROR Instance deployment failed to install application dependencies. The deployment failed.
2021-04-20 18:00:57 ERROR Instance deployment failed. For details, see 'eb-engine.log'.
2021-04-20 18:01:01 ERROR [Instance: i-0eee746bc342a71cd] Command failed on instance. Return code: 1 Output: Engine execution has encountered an error..
2021-04-20 18:01:01 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2021-04-20 18:01:01 ERROR Unsuccessful command execution on instance id(s) 'i-0eee746bc342a71cd'. Aborting the operation.
2021-04-20 18:01:01 ERROR Failed to deploy application.
My eb-engine.log
Downloading https://download.pytorch.org/whl/cpu/torchvision-0.6.1%2Bcpu-cp37-cp37m-linux_x86_64.whl (5.7 MB)
Collecting torch==1.8.1+cpu
2021/04/20 18:00:57.931655 [ERROR] An error occurred during execution of command [app-deploy] - [InstallDependency]. Stop running the command. Error: fail to install dependencies with requirements.txt file with error Command /bin/sh -c /var/app/venv/staging-LQM1lest/bin/pip install -r requirements.txt failed with error exit status 2. Stderr:ERROR: Exception:
Traceback (most recent call last):
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/resolvelib/resolvers.py", line 171, in _merge_into_criterion
crit = self.state.criteria[name]
KeyError: 'torch'
.
.
.
.
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/msgpack/fallback.py", line 671, in _unpack
ret[key] = self._unpack(EX_CONSTRUCT)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/msgpack/fallback.py", line 684, in _unpack
return bytes(obj)
MemoryError
My requirements.txt
-f https://download.pytorch.org/whl/torch_stable.html
torchvision==0.6.1+cpu
torch==1.8.1+cpu
Can someone explain me what I am doing wrong?
Thank you so much
I am trying to deploy my app on AWS but it seems to stuck at this point:
Uploading: [##################################################] 100% Done...
2019-10-22 11:01:57 INFO Environment update is starting.
2019-10-22 11:02:00 INFO Deploying new version to instance(s).
2019-10-22 11:02:09 ERROR Your requirements.txt is invalid. Snapshot your logs for details.
2019-10-22 11:02:10 ERROR [Instance: i-#######] Command failed on instance. Return code: 1 Output: (TRUNCATED)...)
File "/usr/lib64/python2.7/subprocess.py", line 190, in check_call
raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2019-10-22 11:02:10 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2019-10-22 11:02:10 ERROR Unsuccessful command execution on instance id(s) 'i########'. Aborting the operation.
2019-10-22 11:02:11 ERROR Failed to deploy application.
ERROR: ServiceError - Failed to deploy application.
It says that my requirements.txt is invalid, Why ?
Requirement.txt
Django
django-crispy-forms==1.7.0
pytz==2017.3
gunicorn==19.9.0
django-widget-tweaks
psycopg2
Please help me in figuring out what I am doing wrong.
I'm using AWS Code Deploy in order to deploy my ASP.NET application into an auto-scaling group.
When deploying i've this error: Script at specified location: application-start.bat failed with exit code 66.
From what i've seen the error code 66 is "The network resource type is not correct", which is very bizzare in this case...
My bundle contains an appspec.yml file like this:
version: 0.0
os: windows
files:
- source: ./
destination: c:\inetpub\wwwroot
hooks:
ApplicationStop:
- location: application-stop.bat
timeout: 900
ApplicationStart :
- location: application-start.bat
timeout: 900
And the bat 2 files (application-stop / application-start) only contains one line each
iisreset /stop
iisreset /start
When i go to the EC2 instance to look at the aws code deploy logs, it's not more clear to me
2016-04-04 08:58:42 ERROR [codedeploy-agent(2848)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Error during perform: InstanceAgent::Plugins::CodeDeployPlugin::ScriptError - Script at specified location: application-start.bat failed with exit code 66
C:/Windows/TEMP/ocr512.tmp/src/lib/instance_agent/plugins/codedeploy/hook_executor.rb:150:in 'execute_script'
C:/Windows/TEMP/ocr512.tmp/src/lib/instance_agent/plugins/codedeploy/hook_executor.rb:107:in 'block (2 levels) in execute'
Does anyone run into the same issues and find a way to fix it ?
I am trying to add a start-stop-restart recipe for the redis-server
logged in the remote server via ssh I can run
service redis-server restart
but adding to deploy.rake
%w[start stop restart].each do |command|
desc "#{command} Redis server."
task command do
on roles(:app) do
execute "service redis-server #{command}"
end
end
end
I get an error on restart
DEBUG [8410afb7] Command: service redis-server restart
DEBUG [8410afb7] Stopping redis-server:
DEBUG [8410afb7] redis-server.
DEBUG [8410afb7] Starting redis-server:
DEBUG [8410afb7] touch:
DEBUG [8410afb7] cannot touch ‘/var/run/redis/redis-server.pid’:
Permission denied
which is obvious as /run is root:root...
how can I solve it ? should I install redis-server in my home directory ? ( if possible? )
thanks for any suggestion
I should write :
execute :sudo, "service redis-server #{command}"
in my deploy.rake recipe
I don't know why but I cannot seem to figure out why this is happening. I can build and run the docker image locally.
Recent Events:
2015-05-25 12:57:07 UTC+1000 ERROR Update environment operation is complete, but with errors. For more information, see troubleshooting documentation.
2015-05-25 12:57:07 UTC+1000 INFO New application version was deployed to running EC2 instances.
2015-05-25 12:57:04 UTC+1000 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2015-05-25 12:57:04 UTC+1000 ERROR [Instance: i-4775ec9b] Command failed on instance. Return code: 1 Output: (TRUNCATED)... run Docker container: vel="fatal" msg="Error response from daemon: Cannot start container 02c057b331bf3a3d912bf064f1dca3e00c95746b5748c3c4a28a5c6b452ff335: [8] System error: exec: \"bin/app\": permission denied" . Check snapshot logs for details. Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/04run.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2015-05-25 12:57:03 UTC+1000 ERROR Failed to run Docker container: vel="fatal" msg="Error response from daemon: Cannot start container 02c057b331bf3a3d912bf064f1dca3e00c95746b5748c3c4a28a5c6b452ff335: [8] System error: exec: \"bin/app\": permission denied" . Check snapshot logs for details.
Dockerfile:
FROM java:8u45-jre
MAINTAINER Terence Munro <terry#zenkey.com.au>
ADD ["opt", "/opt"]
WORKDIR /opt/docker
RUN ["chown", "-R", "daemon:daemon", "."]
USER daemon
ENTRYPOINT ["bin/app"]
EXPOSE 9000
Dockerrun.aws.json:
{
"AWSEBDockerrunVersion": "1",
"Ports": [
{
"ContainerPort": "9000"
}
],
"Volumes": []
}
Additional logs as attachment at: https://forums.aws.amazon.com/thread.jspa?threadID=181270
Any help is extremely appreciated.
#nick-humrich suggestion of trying eb local run worked. So using eb deploy ended up working.
I had previously been uploading through the web interface.
Initially using eb deploy was giving me a ERROR: TypeError :: data must be a byte string but I found this issue which was resolved by uninstalling pyopenssl.
So I don't know why the web interface was giving me permission denied perhaps something to do with the zip file?
But anyway I'm able to deploy now thank you.
I had a similar problem running Docker on Elastic Beanstalk. When I pointed CMD in the Dockerfile to a shell script (/path/to/my_script.sh), the EB deployment would fail with
/path/to/my_script.sh: Permission denied.
Apparently, even though I had run RUN chmod +x /path/to/my_script.sh during the Docker build, by the time the image was run, the permissions had been changed. Eventually, to make it work I settled on:
CMD ["/bin/bash","-c","chmod +x /path/to/my_script.sh && /path/to/my_script.sh"]