-
Notifications
You must be signed in to change notification settings - Fork 443
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
sbt docker:publishLocal
sporadically builds with the wrong version
#1164
Comments
Do you have a minimal example to reproduce this? Are you having any custom auto plugins in your code? I haven't seen this anywhere before 😲 |
@muuki88 I do not have any example that reproduces this 100% of the time. The issue happens sporadically. I understand that there may be some combination of settings in my project which is causing this that would be difficult to reproduce and I cannot give you my project. That is why it would be great to know how I can further debug this when it happens again - perhaps I could provide some debug output that would let you know what is happening. An example build.sbt file is below. We run the following build command:
Just now we've had several failures in a row which produced the following output. The presence of SNAPSHOT in the output indicates that the build did not correctly figure out the version (even though it appears right there in
|
Thanks for adding a bit more information 😄 It seems that this is not sbt-native-packager related. Still I wonder why this is happening. What plugins do you have in your |
Do you think it's a core sbt issue? We typically use the following plugins: com.typesafe.play sbt-plugin No other |
@muuki88 Just ran into this on 4 builds in a row - it's blocking me from being able to deploy a production build. What I can observe is that the |
@muuki88 Any thoughts/updates on this? Thank you. |
Unfortunately not 😣 and I don't have the time to investigate myself 😌 However I can try to act as a sparring partner here. Is this the only project were this is happening? |
It sporadically happens in various projects (we have ~15 microservices, all with nearly the same setup). Where do you suspect the issue is? sbt? sbt-native-packager? Is there any debug output I can turn on in either one that might help determine why it's choosing SNAPSHOT when it has a version defined in build.sbt? Thank you |
Usually you can call I suspect the issue somewhere in your build setup 😁 a race condition in the setting intitialization code of sbt would have caused a lot more traction. What might shed a bit more light on this if you execute something like this
|
Thanks for that command! I will post what the output looks like in the normal case and when the issue happens again. |
When everything works correctly, the output of
When the issue happens, the output is as follows:
|
@mrubin You'll see the second output if you run |
@dwickern prior to the |
Are you using If you change your |
We do use Both development and production builds have exhibited the issue, so I don’t think it’s related to git (or those kinds of plugins). Our Jenkins builds issue the following command (this is on Linux):
Is there anything wrong with that command? Thank you very much. |
The command doesn't change the |
I also wonder why the version comes from
the
The debian plugin should not set the Which it actually does: https://github.com/sbt/sbt-native-packager/blob/master/src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala#L88 where and how to you set the |
Yes the The above example for |
@mrubin how does the |
It is committed this way. |
@muuki88 Anything else I can try for this? |
I have ran out of ideas 😢 |
@muuki88 where are you running your build? I'm currently experiencing an issue when building sbt project on amazon-ami for eks. |
I don't do docker 🤪 ( yet ) |
Expected behaviour
sbt docker:publishLocal
always uses the correct versionActual behaviour
sbt docker:publishLocal
sporadically builds with the wrong versionInformation
We put the version number in our build.sbt file like so:
version := "1.2.3"
Most of the time, the correct version is used. However, sometimes, I see "SNAPSHOT" appearing in the build output and the version number from build.sbt is not used, despite being right there. This causes our docker image to have an unexpected name and fails our build.How can I further debug this to see what's wrong?
The text was updated successfully, but these errors were encountered: