Windows habitat issue for version 0.69

we are facing below issue during windows habitat builds

library.jenkins-habitat-lib.version: master
C:\Program Files\docker\docker.EXE: Error response from daemon: Invalid container name

can someone help me out ,please let me know what to do

please let me know how to upgrade and downgrade versions in windows

This is strange, it doesn’t look like you’re even getting to the point of a build, was this ever working for you? v0.69 is a bit old at this point.

I know I have seen this before when I have either inadvertently added an extra arg in my hab pkg build or in a HAB_DOCKER_OPTS variable in such a way that causes the pass through to docker to make docker run think it needs to start a named container.

Can we see the actual hab pkg build command you are invoking and also check your HAB_DOCKER_OPTS variable.

Before its working fine but recentli all builds failed due to the invalid container name error. We are planning to upgrade hab version 0.72 but upgrade is the only solution?

Please let me know how to upgrade and downgrade habitaat in windows

I’m hesitant to say that upgrading is the only solution since I cannot reproduce on version 0.69.0 locally. More information of the hab command your CI is calling to invoke the build would help us to better zero in on the problem. Also helpful is if you invoke the build with the RUST_LOG environment variable set to debug. This outputs the exact arguments sent to docker.exe and would help identify how a container name is being passed to docker.

Regarding upgrade/downgrade: if you are on a system that already has habitat installed, you can downgrade or upgrade to any version of Habitat by running hab pkg install core/hab/<VERSION_NUMBER>. For example, to upgrade to 0.72.0, you would run hab pkg install core/hab/0.72.0. Then you cab invoke a build under that version by using the absolute path of its hab.exe binary. This binary would live in c:\hab\pkgs\core\hab\0.72.0\<RELEASE NUMBER>\bin\. You could also add that directory to your path and then hab should resolve to it.

Hope this helps.

Thanks so much for you reply mwrock, appreciate it

 After installing the package where i have to set the path? Bcoz still i see my old pkg version 

If am upgrading in prod what steps i need take care?

Since it sounds like it is Jenkins that invokes Habitat, you will want to set the PATH at the machine level. With powershell you can do this with:

[Environment]::SetEnvironmentVariable("PATH", "[DESIRED PATH]", "Machine")

Then restart your jenkins process.

I want to make it clear. Am doing upgrade in jenkins windows slave from hab version 0.69 to 0. 72 and we are using chocolatey and i have upgraded with the command choco upgrade hab - - version 0.72.

After execution Now its showing hab version 0.72. Apart from that i have to do anything in slave to invoke jenkins job builds with hab version 0.72? There will be any mpact on the jobs? 0. 72 relies on docker?

That is correct. There should not be any other impact. Had I known you were using chocolatey I would have suggested that you just use choco upgrade habitat --version 0.72.0 -y which would have handled the path for you.

A habitat build only relies on docker if you specifically pass -D to hab pkg build. Without that docker should not be invoked.

hi i upgraded , but now its not able to find artifact pls find the below error
we are using habitat executer plugin
Setting Directory: C:\hab\svc\jenkins-slave\data\workspace\workspace\test-hab/results/

before we gave {workspace}/results/last_build.env to find artifact but now its taking only {workspace}/results/last_build.ps1 any reason ?

while running promote stage this path script is executing and showing error

error: The following required arguments were not provided: <CHANNEL> USAGE: hab.exe pkg promote [OPTIONS] <PKG_IDENT> <CHANNEL> For more information try --help

Several versions back we changed the .env generated files to .ps1 for windows builds so that they could actually be executed.

Regarding the missing <CHANNEL>, can you provide the hab pkg promote command you are executing?

thanks so much for your reply mwrock … now working properly i have to change file extention from env to ps1 … thanks for your support :slight_smile:

Fantastic! Glad things are working!!

1 Like