CodePipeline Deploy not working

0

Hy, i have setup an Codepipeline and a Elastic Beanstalk Environment with Sample code. Codepipeline Running correctly until Deploy Stage. I get this Error in CodePipeline:

Deployment completed, but with errors: During an aborted deployment, some instances may have deployed the new application version. To ensure all instances are running the same version, re-deploy the appropriate application version. Failed to deploy application. Unsuccessful command execution on instance id(s) 'i-032e3285bcee38a49'. Aborting the operation. [Instance: i-032e3285bcee38a49] Command failed on instance. Return code: 1 Output: Engine execution has encountered an error.. Instance deployment failed. For details, see 'eb-engine.log'.

Elastic Beanstalk says:

Severe
Application deployment failed at 2023-12-18T21:42:54Z with exit status 1 and error: Engine execution has encountered an error.
Incorrect application version "code-pipeline-1702935745242-0009dc7181f1e42d10280c58276fd8b5ab2f8821" (deployment 4). Expected version "Sample" (deployment 1).

Thank you for your help!

Br Mike

Mike
質問済み 5ヶ月前366ビュー
4回答
0

Hello.

Are there any other errors output to "eb-engine.log"?
I think a more detailed log is output to "eb-engine.log".
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.logging.html

profile picture
エキスパート
回答済み 5ヶ月前
  • Try adding "discard-paths: yes" to buildspec.yml. https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html

    version: 0.2
    
    phases:
      install:
        runtime-versions:
          java: corretto17
      build:
        commands:
          - chmod +x gradlew  # Ensure that gradlew is executable
          - ./gradlew buildFatJar
      post_build:
        commands:
          - mv build/libs/Einkaufsliste-all.jar Einkaufsliste-all.jar
    artifacts:
      files: 'Einkaufsliste-all.jar'
      discard-paths: yes
    
0

Hy,

thank you for your answer! Can i add a logfile here as attachment? I see one error in Log, but why? All is build correctly.

2023/12/18 21:42:54.515857 [ERROR] An error occurred during execution of command [app-deploy] - [CheckProcfileForJavaApplication]. Stop running the command. Error: there is no Procfile and no .jar file at root level of your source bundle 

buildspec.yml look like this:

version: 0.2

phases:
  install:
    runtime-versions:
      java: corretto17
  build:
    commands:
      - chmod +x gradlew  # Ensure that gradlew is executable
      - ./gradlew buildFatJar
  post_build:
    commands:
      - mv build/libs/Einkaufsliste-all.jar Einkaufsliste-all.jar
artifacts:
  files: 'Einkaufsliste-all.jar'

Codedeploy are ok. Here are the latest log-lines.

[Container] 2023/12/18 21:35:10.971800 Phase complete: POST_BUILD State: SUCCEEDED
[Container] 2023/12/18 21:35:10.971814 Phase context status code:  Message: 
[Container] 2023/12/18 21:35:11.048049 Expanding base directory path: .
[Container] 2023/12/18 21:35:11.049751 Assembling file list
[Container] 2023/12/18 21:35:11.049764 Expanding .
[Container] 2023/12/18 21:35:11.051345 Expanding file paths for base directory .
[Container] 2023/12/18 21:35:11.051356 Assembling file list
[Container] 2023/12/18 21:35:11.051360 Expanding Einkaufsliste-all.jar
[Container] 2023/12/18 21:35:11.052925 Found 1 file(s)
[Container] 2023/12/18 21:35:11.408487 Phase complete: UPLOAD_ARTIFACTS State: SUCCEEDED
[Container] 2023/12/18 21:35:11.408506 Phase context status code:  Message: 

If you need more informations, please let me know. Thank you!

Br Mike

Mike
回答済み 5ヶ月前
0

Hy,

thanks. But this dont work. I also get the error:

2023/12/19 09:41:34.219706 [ERROR] An error occurred during execution of command [app-deploy] - [CheckProcfileForJavaApplication]. Stop running the command. Error: there is no Procfile and no .jar file at root level of your source bundle 

Any ideas?

Br Mike

Mike
回答済み 5ヶ月前
0

Hy,

im so sorry, i found my mistake. The solution was i have the input artifact defined to "BuildArtifact". My problem was that stands on "SourceArtifact".

Thank you for your patience and very fast help.

Br Mike

Mike
回答済み 5ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ