You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running eb create or eb deploy commands on WINDOWS 10, files with executable permissions (ex: chmod +x build.sh) are not zipped correctly when creating the application version archive that gets uploaded.
Steps to reproduce
Create IAM user named eb-full (IAM > Add user > check programmatic access > Attach "AdministratorAccess-AWSElasticBeanstalk")
Add "eb-full" user to /.aws credentials and config files.
Go to EC2 > Network & Security > Key Pairs > Actions > Import key pair > import eb-user.pub. Give it name eb-user.
On Windows machine, make project root folder named awsebcli-deploy-bug. Ex: C:\Users\<myuser>\Downloads\awsebcli-deploy-bug for this example.
From terminal, initialize Elastic Beanstalk: eb init --profile eb-cli
C:\Users\Jarad\Downloads\awsebcli-deploy-bug>eb init --profile eb-cli
Select a default region
1) us-east-1 : US East (N. Virginia)
2) us-west-1 : US West (N. California)
3) us-west-2 : US West (Oregon)
4) eu-west-1 : EU (Ireland)
5) eu-central-1 : EU (Frankfurt)
6) ap-south-1 : Asia Pacific (Mumbai)
7) ap-southeast-1 : Asia Pacific (Singapore)
8) ap-southeast-2 : Asia Pacific (Sydney)
9) ap-northeast-1 : Asia Pacific (Tokyo)
10) ap-northeast-2 : Asia Pacific (Seoul)
11) sa-east-1 : South America (Sao Paulo)
12) cn-north-1 : China (Beijing)
13) cn-northwest-1 : China (Ningxia)
14) us-east-2 : US East (Ohio)
15) ca-central-1 : Canada (Central)
16) eu-west-2 : EU (London)
17) eu-west-3 : EU (Paris)
18) eu-north-1 : EU (Stockholm)
19) eu-south-1 : EU (Milano)
20) ap-east-1 : Asia Pacific (Hong Kong)
21) me-south-1 : Middle East (Bahrain)
22) af-south-1 : Africa (Cape Town)
(default is 3):
Enter Application Name
(default is "awsebcli-deploy-bug"):
Application awsebcli-deploy-bug has been created.
Select a platform.
1) .NET Core on Linux
2) .NET on Windows Server
3) Docker
4) GlassFish
5) Go
6) Java
7) Node.js
8) PHP
9) Packer
10) Python
11) Ruby
12) Tomcat
(make a selection): 3
Select a platform branch.
1) Docker running on 64bit Amazon Linux 2
2) Multi-container Docker running on 64bit Amazon Linux
3) Docker running on 64bit Amazon Linux
(default is 1): 1
Cannot setup CodeCommit because there is no Source Control setup, continuing with initialization
Do you want to set up SSH for your instances?
(Y/n): y
Select a keypair.
1) eb-user
2) xxxxxxxxx
3) [ Create new KeyPair ]
(default is 2): 1
Notice that it indicates -rw-rw-rw- for build.sh. I think this is a bug caused by EB CLI while zipping on Windows.
If I zip the same files, like so:
zip -r upload . -x ".elasticbeanstalk/*"
and upload to the "production" environment manually in the online interface... it totally works! I visit the domain and see the default nginx success page.
I ssh into the working running EC2 instance with eb ssh and check the permissions of build.sh. It shows executable, when I manually uploaded the package.
I don't want to manually zip and upload a package; I want to use EB CLI 100% of the time when deploying a change. I expect when doing eb deploy, that it zips the package and maintains the correct executable file permissions for files that need to be executable.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
OS: Windows 10 Pro version 20H2
EBCLI version: EB CLI 3.20.0 (Python 3.7.3)
Additional Context
I know line endings can cause problems (CRLF vs LF). This problem is not that. My build.sh file has line ending as LF.
I FIRMLY want to name my production compose file docker-compose.prod.yml for workflow reasons and efficiency. That's why I have the build.sh file to begin with. Elastic Beanstalk doesn't seem to have a key that let's me define the name of the docker-compose file I want to use. If I were able to set that as a key somewhere, that would be best-case.
The text was updated successfully, but these errors were encountered:
@jaradc Hi I can't create a file with .sh as extension in Windows and has x permission. I do create a .exe file with x permission but then deployment is fine. I also tried to create a x permission .sh file in Linux, run git updat-index --chmod="+x" to preserve x permission and then pull on Windows, but still .sh file on Windows don't have x permission. Appreciate it if you could tell me how to get a .sh file with x permission on Windows.
@Mickeypeng Please see my StackOverflow post I linked to. I mentioned "I opened up Git Bash which uses MINGW64 terminal". More details in that post. Thanks for looking into this!
Description
When running
eb create
oreb deploy
commands on WINDOWS 10, files with executable permissions (ex: chmod +x build.sh) are not zipped correctly when creating the application version archive that gets uploaded.Steps to reproduce
awsebcli-deploy-bug
. Ex:C:\Users\<myuser>\Downloads\awsebcli-deploy-bug
for this example.eb init --profile eb-cli
eb create production
It shows build.sh has executable permissions seen by -rwxr-xr-x.
But I'll run chmod anyways:
Permissions still the same.
eb deploy
again. Same exact error as above.eb ssh
,Notice that it indicates -rw-rw-rw- for build.sh. I think this is a bug caused by EB CLI while zipping on Windows.
and upload to the "production" environment manually in the online interface... it totally works! I visit the domain and see the default nginx success page.
I ssh into the working running EC2 instance with
eb ssh
and check the permissions of build.sh. It shows executable, when I manually uploaded the package.Expected result
I don't want to manually zip and upload a package; I want to use EB CLI 100% of the time when deploying a change. I expect when doing
eb deploy
, that it zips the package and maintains the correct executable file permissions for files that need to be executable.Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
Additional Context
docker-compose.prod.yml
for workflow reasons and efficiency. That's why I have the build.sh file to begin with. Elastic Beanstalk doesn't seem to have a key that let's me define the name of the docker-compose file I want to use. If I were able to set that as a key somewhere, that would be best-case.The text was updated successfully, but these errors were encountered: