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

Failed to pack with version 0.12 #670

Closed
3 tasks done
ManuDinicola opened this issue Mar 7, 2022 · 11 comments · Fixed by #741
Closed
3 tasks done

Failed to pack with version 0.12 #670

ManuDinicola opened this issue Mar 7, 2022 · 11 comments · Fixed by #741

Comments

@ManuDinicola
Copy link

ManuDinicola commented Mar 7, 2022

What happened?

After upgrading to the version 0.12 , the dotnet publish failed. If we specify the version 0.11.3, no error occur.
The problem occur when we have project A that reference Project B that reference Project C.

If we use the same dotnet sdk 6.0.200 and run the dotnet publish witht the same parameter , we don't encounter any errors.

  • What were you attempting to do?
    We try to pack our dotnet application with gcr.io/paketo-buildpacks/dotnet-core buildpack v0.12

  • What did you expect to happen?

That the command succeeded

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

Build Configuration

  • What platform (pack, kpack, tekton buildpacks plugin, etc.) are you
    using? Please include a version.

pack build testpublish --env BP_DOTNET_PROJECT_PATH=./src/WebApi --env BP_DOTNET_PUBLISH_FLAGS="--verbosity=detailed"

pack --version
0.23.0+git-0db2c77.build-3056

  • What buildpacks are you using? Please include versions.
    gcr.io/paketo-buildpacks/dotnet-core:0.12.0

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

  • Can you provide a sample app or relevant configuration (buildpack.yml,
    nginx.conf, etc.)?
    here is a sample project https://github.com/ManuDinicola/NetPublishedFailed

Checklist

  • I have included log output.
  • The log output includes an error message.
  • I have included steps for reproduction.
@sophiewigmore
Copy link
Member

@ManuDinicola which .NET Core SDK version is used in the failing build? 6.0.200?

@ManuDinicola
Copy link
Author

@sophiewigmore yes the sdk is 6.0.200

@sophiewigmore
Copy link
Member

Ok, I've tried to reproduce this error by creating a new app that looks just like https://github.com/paketo-buildpacks/dotnet-publish/tree/main/integration/testdata/multiple_projects_msbuild, but uses .NET Core 6. When I built it with .NET Core buildpack v0.12.0, it used SDK 6.0.200 and the build succeeded. I wasn't able to reproduce the error.

Would you be able to point me to an app I could use to try to reproduce this? If not your actual app, maybe a simple example that could be used?

@ManuDinicola
Copy link
Author

you can take this app.
https://github.com/ManuDinicola/NetPublishedFailed

The problem occur when we have multiple project where Project A reference Project B and Project B reference Project C

@sophiewigmore
Copy link
Member

sophiewigmore commented Mar 7, 2022

Great, I just tried out a few builds with this app.

  1. Test 1 I built this app with .NET Core buildpack v0.12. It used .NET Core SDK 6.0.200 and failed, but with a different output than you saw. Can you add a comment with the full .NET Publish output you're seeing?
  2. I saw the build pass with .NET Core v0.11.3 using .NET Core SDK 6.0.102

The only discernible difference is the .NET Core SDK version being used as you pointed out.. I think we'll need to investigate this further

@ManuDinicola
Copy link
Author

ManuDinicola commented Mar 8, 2022

publish.log
Here are the log

With the real project where the error happen , the error is a little bit different. (You can see the error in the file below)
publish_prodapplication.log

@sophiewigmore
Copy link
Member

sophiewigmore commented Mar 11, 2022

We've (myself and @fg-j) been looking into this, but haven't been able to pinpoint the source of the issue. @macsux - looping you in incase you've seen something like this before? We're starting to wonder if it's an SDK issue instead of buildpack, even though it passes locally.

@fg-j
Copy link

fg-j commented Mar 28, 2022

I've reproduced this with a different project that has a similar dependency structure: https://github.com/blogifierdotnet/Blogifier
Building with buildpack version 0.11.3 succeeds, but with the latest buildpack, it fails.

It seems that this may be an instance of this issue filed on the .NET SDK repo. We'll continue to monitor that issue for updates.

For the time being, as a workaround, you can dotnet publish your project with your own .NET SDK installation before using the buildpack to containerize it. Be sure to publish with the proper flags, e.g.

dotnet publish . --configuration Release --runtime ubuntu.18.04-x64 --output /tmp/publish-output

Then, you can pack build myapp --path /tmp/publish-output --buildpack paketo-buildpacks/dotnet-core and the buildpack will containerize the framework-dependent executable produced by your local dotnet publish command.

@fg-j
Copy link

fg-j commented May 3, 2022

Heads up, @ManuDinicola, we've opened an RFC to make changes to the .NET SDK buildpack that should address your issue: paketo-buildpacks/rfcs#185

@macsux
Copy link

macsux commented May 3, 2022

See my comment on this issue in paketo-buildpacks/rfcs#185 (comment)

@fg-j
Copy link

fg-j commented Jun 6, 2022

I've also reproduced this issue trying to build components of https://github.com/Squidex/squidex

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.

4 participants