Deploy stage failed: FileMagic v0.7.1 error

0

I built a simple CodePipeline for a SpringBoot Java application with 3 steps:

  1. Source: get the source from GitHub
  2. Build: a jar file
  3. Deploy: to an AWS Elastic Beanstalk instance

1 and 2 steps successfully pass while Deploy step fails. The only error I see in eb-activity.log:

01_configure_application.sh] : Activity execution failed, because: Executing: /usr/bin/unzip -o -d /var/app/staging /opt/elasticbeanstalk/deploy/appsource/source_bundle
  FileMagic v0.7.1: compiled magic version [5.21] does not match with shared library magic version [5.37]
  Archive:  /opt/elasticbeanstalk/deploy/appsource/source_bundle
    inflating: /var/app/staging/microservices/my-service/target/my-service.jar  
  Unable to launch application as the source bundle does not contain either a file named application.jar or a Procfile.
  Unable to launch application as the source bundle does not contain either a file named application.jar or a Procfile. (ElasticBeanstalk::ExternalInvocationError)
caused by: Executing: /usr/bin/unzip -o -d /var/app/staging /opt/elasticbeanstalk/deploy/appsource/source_bundle
  FileMagic v0.7.1: compiled magic version [5.21] does not match with shared library magic version [5.37]
  Archive:  /opt/elasticbeanstalk/deploy/appsource/source_bundle
    inflating: /var/app/staging/microservices/my-service/target/my-service.jar  
  Unable to launch application as the source bundle does not contain either a file named application.jar or a Procfile.
  Unable to launch application as the source bundle does not contain either a file named application.jar or a Procfile. (Executor::NonZeroExitStatus)

My Buildspec:

build:
  commands:
      - mvn -P ci --settings settings.xml install -DskipTests
artifacts:
  files:
     - microservices/my-service/target/my-service.jar

If I deploy this jar directly to AWS Elastic Beanstalk using AWS Web Interface, it works perfectly.

Please, help me. I'm ready to share any other config on demand.

Edited by: siden on Mar 24, 2020 7:14 PM

Edited by: siden on Mar 24, 2020 7:22 PM

Edited by: siden on Mar 24, 2020 7:24 PM

siden
asked 3 years ago37 views
1 Answer
0

The problem was in artifact's sub-folders, it's impossible to use an artifact location as in my Buildspec:

artifacts:
  files:
     - microservices/my-service/target/my-service.jar

the only correct way is folder/myapp.jar, for example:

artifacts:
  files:
     - target/my-service.jar

so you should specify outputDirectory in your maven config if it is different.

siden
answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions