Deploy to AWS Beanstalk not working

nick.young.356's Avatar

nick.young.356

14 Feb, 2017 03:13 PM

I followed the guide in this blog post: https://www.appveyor.com/blog/2016/11/07/aws-elastic-beanstalk/.

The build and deployment succeed. I see in beanstalk the application update and result in "Environment update completed successfully.". However, after reviewing the deployed site, it does not contain any updates. I manually reviewed the zip file loaded to S3 and it is correct, but somehow it's not getting to IIS.

Deploying manually from visual studio using the AWS deploy tool works just fine. Here is my deploy script:

$packageweb = $artifacts.values | Where-Object { $_.path -like '*AppName.zip' }
$exe = "C:\Program Files (x86)\AWS Tools\Deployment Tool\awsdeploy.exe"

&$exe -w "-DDeploymentPackage=$($packageweb.path)" "-DEnvironment.Name=AppEnvironmentName" "-DApplication.Name=AppName" "-DRegion=us-east-1" "-DAWSAccessKey=$env:AWSAccessKeyId" "-DAWSSecretKey=$env:AWSSecretKey" "-r" "C:\projects\projectName\awsdeploy.txt"

  1. Support Staff 1 Posted by Ilya Finkelshte... on 14 Feb, 2017 05:51 PM

    Ilya Finkelshteyn's Avatar

    Hi Nick,

    I wonder if *AppName.zip filter works OK. Can you please try to add write-host $packageweb.path as second line in the script and see if it actually returns something?

    Ilya.

  2. 2 Posted by nick.young.356 on 14 Feb, 2017 06:41 PM

    nick.young.356's Avatar

    Good thought. We could already infer the path is getting properly set because the correct zip is loaded to S3. However, I added this line anyway and verified it does print a valid path.

  3. Support Staff 3 Posted by Ilya Finkelshte... on 14 Feb, 2017 07:49 PM

    Ilya Finkelshteyn's Avatar

    Could you please send us full appveyor.yml (or use Export YAML menu if you use UI). It is safe if you use secure variables, but please feel free to make conversation private if needed.

    Ilya.

  4. 4 Posted by nick.young.356 on 14 Feb, 2017 07:58 PM

    nick.young.356's Avatar

    YAML is attached.

  5. Support Staff 5 Posted by Ilya Finkelshte... on 14 Feb, 2017 08:19 PM

    Ilya Finkelshteyn's Avatar

    This looks good, maybe something on Amazon side. I will try to run it on my lab and see if this works for me and let you know.

  6. Support Staff 6 Posted by Ilya Finkelshte... on 15 Feb, 2017 09:01 AM

    Ilya Finkelshteyn's Avatar

    I was able to make it work.

    Please note that I will delete this site and YAML in a day or two.

    Did you check All Applications > AppName > Application versions in AWS Beanstalk? Does it list your deployments from VS and from AppVeyor?

    Ilya.

  7. 7 Posted by korenb on 07 Jul, 2017 10:43 AM

    korenb's Avatar

    I have absolutely the same problem
    I checked All Applications > AppName > Application versions and it's ok, i see list of deployments from VS and AppVeyor.
    Moreover, nothing is changed when i switch among thouse versions. The version is worked fine that was published via VS, not AppVeyor

  8. 8 Posted by nick.young.356 on 07 Jul, 2017 01:36 PM

    nick.young.356's Avatar

    @korenb Yeah I never found the root cause. We're still doing manual deploys since neither AppVeyor nor Amazon have taken ownership of the issue.

    The next step I was going to try was to deploy using the AWS CLI using the same commands defined in the AppVeyor deployments. If that works from the CLI, it points to an AppVeyor issue. If it does not, it points to an Amazon issue. I suspect it will not work from the CLI.

  9. 9 Posted by korenb on 10 Jul, 2017 10:44 AM

    korenb's Avatar

    @nick.young.356, I have executed deploy-script on my local machine. the result still the same. so AppVeyor isn't guilty.

  10. Support Staff 10 Posted by Ilya Finkelshte... on 10 Jul, 2017 08:59 PM

    Ilya Finkelshteyn's Avatar

    @korenb Thank you for update! We have a hard time reproducing it. If you could share some response from Amazon support here, it would be great.

    Also if you (or @nick.young.356) by any chance can try to create new beanstalk application (side by side with existing one), and run the same script (with only -DEnvironment.Name changed) against it, will it help?

  11. 11 Posted by nick.young.356 on 17 Jul, 2017 12:21 PM

    nick.young.356's Avatar

    We have multiple beanstalk applications all with the same, or extremely similar, configs. The deploy fails for all of them.

  12. Support Staff 12 Posted by Ilya Finkelshte... on 17 Jul, 2017 05:23 PM

    Ilya Finkelshteyn's Avatar

    @nick.young.356 does it work if you run the same script from local machine?

  13. 13 Posted by nick.young.356 on 19 Jul, 2017 12:09 PM

    nick.young.356's Avatar

    No it doesn't. I'll be working with AWS when I have time to see if I can find a solution. I'll update the thread once I've done that.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

24 Jul, 2017 09:09 PM
24 Jul, 2017 12:39 PM
23 Jul, 2017 12:53 AM
22 Jul, 2017 08:14 PM
22 Jul, 2017 07:59 PM