0

I've got a Ruby application that has been deployed to an AWS instance using CodeDeploy via CircleCI. I added a gem to the application. All tests are passing both locally and in CircleCI, but the deployment stage fails with this error:

$ create_application_revision /tmp/codedeploy_applications.json /tmp/codedeploy_revisions.json
create_application_revision loaded: {"applications":[{"application_root":"/","region":"us-west-2","revision_location":{"revisionType":"S3","s3Location":{"bucket":"something","key":"etl-scripts-testdeploy-3a050b1"}},"deployment_group":"EtlScriptsFleet","application_name":"EtlScripts"}]}
Bundling EtlScripts from /home/ubuntu/etl-scripts
Unhandled exception
[Errno 2] No such file or directory: '/home/ubuntu/etl-scripts/vendor/bundle/ruby/2.2.0/gems/regexp-examples-1.1.4/db/unicode_ranges_2.1.pstore'

It's true that file doesn't exist. It doesn't exist locally either, but all tests pass. I just can't figure out why the deployment process thinks it needs this file?

I noticed that in the source code for this gem (https://github.com/tom-lord/regexp-examples/tree/master/db) is a symbolic link and that's probably why it's not being created. But I'm still confused about how the deployment bundle process would know about a non-existant symbolic link.

Any help greatly appreciated!

2 Answers2

1

It seems the deployment stage is being handled by the deploy push command from aws CLI, and it cannot handle broken symlinks.

I could reproduce the problem by trying to deploy an app containing a broken symlink using the push command:

(Command - aws deploy push --application-name --s3-location s3:///.zip --source ./) (Output - [Errno 2] No such file or directory: '/path/to/source/')

I guess you will need to manually remove all broken symlinks for the deployment to succeed.

Jamal
  • 763
  • 7
  • 22
  • 32
0

For what it's worth, this gem was later refactored to not use symbolic links; as of v1.3.0.

Upgrading from your current version (1.1.4) should almost certainly require no code change.

Tom Lord
  • 27,404
  • 4
  • 50
  • 77