When using eb CLI
eb init
eb create
i get an error:
ERROR: [Instance: i-003165df12360a5c4] Command failed on instance. Return code: 1 Output: Dockerfile and Dockerrun.aws.json are both missing, abort deployment.
It seems like the ZIP file sent to the S3 indeed only contains README.md file. but the local folder does contain the Dockerfile and
eb local run
seems to work fine.
Any ideas?
Answer: It's because the Dockerfile wasn't committed. (By default the EB CLI deploys the latest commit in the current branch).
I had the same problem, and figured out the reason after reading your question and answer. You probable had a new git repo with only a readme file. Once you deleted the .git directory, the EB CLI no longer treated your directory as a git repo.
Seems to be solved.
After removing ".git" folder "eb create" worked.
Seems like a bug in elastic beanstalk as i don't see why the existents of a subfolder should prevent eb from zipping the files in the directory...
Related
I have a Docker application which runs fine locally, and have done eb init and I'm able to run it successfully with eb local run.
Now I would like to deploy this app to a fresh new Elastic Beanstalk environment.
I understand I would need to use eb create myapp to create an environment, which would then be followed by eb deploy.
The environment creation fails and when I look at the logs, I see stuff like this:
2022/04/02 22:45:01.221361 [INFO] COPY failed: file not found in build context or excluded by .dockerignore: stat xxx.jar: file does not exist
This copy command is in my Dockerfile. Why is EB apparently trying to rebuild the image? And why is it trying this on environment creation?
What's the correct sequence of commands to create an environment and deploy my local image (which runs fine with eb local run)?
I've looked through the reams of documentation on the topic, but I feel like I'm so close and just need a specific one or two CLI commands.
eb create and eb deploy appear to be broken.
I was able to successfully deploy by creating a zip file containing the Dockerfile and all local dependencies, and then manually uploading the zip to the Elastic Beanstalk environment previously created by eb create (initially in a broken state).
Elastic Beanstalk automatically builds and runs the docker image.
I build my symfony 4 application with composer install inside docker container.
Composer version 1.10.19
But i got this error.
[ErrorException]
file_put_contents(/root/.composer/cache/repo/https---flex.symfony.com/): failed to open stream: Is a directory
If i run composer install 1 more time without any interruption build is succeeded.
If i delete vendor and var/cache directory on project directory error accoured again.
I tried this methods:
trigger 'composer clearcache' command no success
Delete ~/.composer directory no success
chmod -R 777 ~/.composer no success
Some build of the same project inside different container is succeeded. My container starts with this volumes:
project directory
~/.ssh directory
I search across net but got no solution. PLease help.
This was a bug on Flex version <1.13.4
In latest version (as I write 1.13.4) the issue is solved.
The problem was:
Writing to the cache with an empty key will fail with "failed to open
stream: Is a directory", so do not try to do that.
We noticed this when cloudflare - or the backend service - responded with a "last-modified" header for our CI servers (AWS) but not for our local system. This triggered the condition to become true and it tries to write a cache file without a filename.
That problem was solved with commit d81196c3f3b5
Edit: as posted by #Tmb a workaround is to use: composer install --no-cache ...
When I type -> rails new test_app, it only does the following ->
create
create README.md
create Rakefile
create .ruby-version
create config.ru
create .gitignore
create Gemfile
run git init from "."
I was able to run this command successfully (where it created all the folders and files needed in a rails app) in my c:\users\ directory, however was not able to run it anymore after that. I have also deleted all rails related files in that directory and retried, but have had no success.
Please help.
Install git from Git-Scm.
Enter git --version in command line if it returns version info go ahead and run
rails new projectname
If git --version throws error in command prompt as 'git' is not recognized as an internal or external command. Add environment variable for git. Refer Stackoverflow link to add environment variables for git
I'm trying to get the CircleCI CLI tool ( https://circleci.com/docs/2.0/local-jobs/ ) working on Ubuntu WSL on Windows 10. It appeared to install successfully -- and the file permissions appear to be correct. I have Docker for Windows installed and running, and the Linux Docker client works without issue.
But now it always errors when trying to validate a CircleCI config file.
I have tried:
circleci config validate -c .circleci/config.yml
and
circleci config validate
from the root of my repo.
But each time, it gives the error:
Error: open .circleci/config.yml: no such file or directory
Has anyone been able to get this work?
sudo worked for me to overcome this. However, I stuck with the next error.
I'm attempting to add a post deployment script to my Elastic Beanstalk. I've read a few blog posts (read the references) that reference adding a config file to the .elasticbeanstalk directory. The config file is supposed to create a shell script and copy it to the directory:
/opt/elasticbeanstalk/hooks/appdeploy/post
In my .elasticbeanstalk folder, I have the following files:
config.yml
branch-defaults:
staging:
environment: env-name
global:
application_name: app-name
default_ec2_keyname: aws-eb
default_platform: 64bit Amazon Linux 2015.03 v1.3.1 running Ruby 2.2 (Passenger Standalone)
default_region: us-west-2
profile: eb-cli
sc: git
test.config (the config I added to test out how the post deployment script works):
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/01_test.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
# This is my test shell script
After I run eb deploy though, the shell script doesn't get copied to the above directory. My /opt/elasticbeanstalk/appdeploy/post directory is empty. The .elasticbeanstalk folder is correct in the /var/app/current/ directory. I also can not see anything in the log files that references the new script or an error. I've checked eb-tools.log, eb-activity.log, cron, and grepped all logs for keywords around those files. Still, no luck.
Thanks in advance for any help/suggestions!
References:
https://forums.aws.amazon.com/thread.jspa?threadID=137136
http://www.dannemanne.com/posts/post-deployment_script_on_elastic_beanstalk_restart_delayed_job
The right place to drop your config file is .ebextensions directory in your app and not . elasticbeanstalk. You should then see your shell script in the /opt/elasticbeanstalk/hooks/appdeploy/post directory.
As noted in the forum post
"Dropping files directly into the hooks directories is risky as this is not the documented method, is different in some containers and may change in the future"