Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: failed to build: executing lifecycle: failed with status code: 51 #703

Closed
dmitry-mightydevops opened this issue May 2, 2022 · 4 comments · Fixed by #741
Closed

Comments

@dmitry-mightydevops
Copy link

What happened?

Unable to pack dotnet core app using latest paketo builder. It waits for 10 minutes on this line determining projects to restore... and the outputs:

➜ pack build project-latest -v --builder paketobuildpacks/builder:full
...
failed to execute 'dotnet publish': exit status 1
ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 51

See gist output: https://gist.github.com/dmitry-mightydevops/ecdad35ded2d7ab54ef2ba4a4d763f45

at the same time if I use older version of the builder

➜ pack build project-0.1.340 -v --buildpack paketo-buildpacks/dotnet-core --builder paketobuildpacks/builder:0.1.340-full
...
[exporter] Reading buildpack directory: /layers/paketo-buildpacks_dotnet-publish
[exporter] Reading buildpack directory: /layers/paketo-buildpacks_dotnet-execute
[exporter] Reading buildpack directory item: launch.toml
Successfully built image project-0.1.340

See gist output: https://gist.github.com/dmitry-mightydevops/92c61d21fc042ea4f6b39eb12d34540d

  • What were you attempting to do?

Compile dotnet-core app using pack cli and latest builder:full image utilizing paketo-buildpacks/dotnet-core buildpack

  • What did you expect to happen?

Pack to compile the image

  • What was the actual behavior? Please provide log output, if possible.

failed after 10m with:

Determining projects to restore...
...
ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 51

See gist output: https://gist.github.com/dmitry-mightydevops/ecdad35ded2d7ab54ef2ba4a4d763f45

Build Configuration

  • What platform (pack, kpack, tekton buildpacks plugin, etc.) are you
    using? Please include a version.
➜ pack version                                       
0.25.0+git-b9be13a.build-3254
  • What buildpacks are you using? Please include versions.

paketo-buildpacks/dotnet-core

  • What builder are you using? If custom, can you provide the output from pack inspect-builder <builder>?

paketobuildpacks/builder:full

  • Can you provide a sample app or relevant configuration (buildpack.yml,
    nginx.conf, etc.)?
➜ cat buildpack.yml                     
dotnet-build:                                                                                                                                                 
  project-path: "src/Ccf.Loyalty/Ccf.Loyalty.Web"

Checklist

  • [ x ] I have included log output.
  • [ x ] The log output includes an error message.
  • [ x ] I have included steps for reproduction.
@fg-j
Copy link

fg-j commented May 2, 2022

I suspect you're running into #670, since your build using .NET SDK v6.0.102 succeeds, and using .NET SDK 6.0.202 fails.

To confirm, can you add --env BP_DOTNET_PUBLISH_FLAGS="--verbosity=detailed" to your pack build and show us the output?

@dmitry-mightydevops
Copy link
Author

so got a lot more output @fg-j but the bottom of it has this:

3>Done building target "_GenerateRestoreProjectPathItemsPerFramework" in project "Project.Loyalty.Domain.csproj".
           3>Target "_GenerateRestoreProjectPathItemsCurrentProject" in file "/layers/paketo-buildpacks_dotnet-core-sdk/dotnet-core-sdk/sdk/6.0.202/NuGet.targets" from project "/workspace/src/Project.Loyalty/Project.Loyalty.Domain/Project.Loyalty.Domain.csproj" (target "_GenerateRestoreProjectPathItems" depends on it):
           3>Done building target "_GenerateRestoreProjectPathItemsCurrentProject" in project "Project.Loyalty.Domain.csproj".
           3>Target "_GenerateRestoreProjectPathItems" in file "/layers/paketo-buildpacks_dotnet-core-sdk/dotnet-core-sdk/sdk/6.0.202/NuGet.targets" from project "/workspace/src/Project.Loyalty/Project.Loyalty.Domain/Project.Loyalty.Domain.csproj" (target "_GenerateRestoreProjectPathWalk" depends on it):
             Task "RemoveDuplicates"
             Done executing task "RemoveDuplicates".
           3>Done building target "_GenerateRestoreProjectPathItems" in project "Project.Loyalty.Domain.csproj".
           3>Target "_GenerateRestoreProjectPathWalk" in file "/layers/paketo-buildpacks_dotnet-core-sdk/dotnet-core-sdk/sdk/6.0.202/NuGet.targets" from project "/workspace/src/Project.Loyalty/Project.Loyalty.Domain/Project.Loyalty.Domain.csproj" (entry point):
             Task "MSBuild"
               Global Properties:
                 ExcludeRestorePackageImports=true
           1>Done executing task "MSBuild" -- FAILED.
         1:3>Done executing task "MSBuild" -- FAILED.
         1:3>Done building target "_GenerateRestoreProjectPathWalk" in project "Project.Loyalty.Web.csproj" -- FAILED.
           2>Done executing task "MSBuild" -- FAILED.
           2>Done building target "_GenerateRestoreProjectPathWalk" in project "Project.Loyalty.DataAccess.csproj" -- FAILED.
           1>Done building target "_GetAllRestoreProjectPathItems" in project "Project.Loyalty.Web.csproj" -- FAILED.
           3>Done executing task "MSBuild" -- FAILED.
           3>Done building target "_GenerateRestoreProjectPathWalk" in project "Project.Loyalty.Domain.csproj" -- FAILED.
         1:3>Done Building Project "/workspace/src/Project.Loyalty/Project.Loyalty.Web/Project.Loyalty.Web.csproj" (_GenerateRestoreProjectPathWalk target(s)) -- FAILED.
           3>Done Building Project "/workspace/src/Project.Loyalty/Project.Loyalty.Domain/Project.Loyalty.Domain.csproj" (_GenerateRestoreProjectPathWalk target(s)) -- FAILED.
           1>Done Building Project "/workspace/src/Project.Loyalty/Project.Loyalty.Web/Project.Loyalty.Web.csproj" (Restore target(s)) -- FAILED.
           2>Done Building Project "/workspace/src/Project.Loyalty/Project.Loyalty.DataAccess/Project.Loyalty.DataAccess.csproj" (_GenerateRestoreProjectPathWalk target(s)) -- FAILED.
      
      Build succeeded.
          0 Warning(s)
          0 Error(s)
      
      Time Elapsed 00:10:00.42
      Failed after 10m0.755073538s
failed to execute 'dotnet publish': exit status 1
ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 51

@fg-j
Copy link

fg-j commented May 3, 2022

Thanks @dmitry-mightydevops. From that output (particularly the MSBuild failure around the GenerateRestoreProjectPathWalk target), this looks to be the same issue as #670. We currently have an RFC open to change the .NET SDK buildpack to resolve this issue.

For now, the recommended workaround is to compile the app before the buildpack build, since the .NET Core buildpack supports containerizing .NET FDDs and FDEs. For details on how to do this, see my comment on #670.

@dmitry-mightydevops
Copy link
Author

ok thanks @fg-j

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants