#unable to load default labels: repository does not exist

1 messages · Page 1 of 1 (latest)

swift kraken
#

I tried to push the docker image the way this link does.
https://docs.dagger.io/730264/quickstart-publish/#publish-the-application

However, it fails with the following error.

unable to load default labels: repository does not exist

Post "http://dagger/query": dial tcp 127.0.0.1:35859: connect: connection refused
Please visit https://dagger.io/help#go for troubleshooting guidance.
exit status 1

How can I resolve this error?

This is my code.

func main() {
    ctx := context.Background()

    client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
    if err != nil {
        return nil, err
    }
    defer client.Close()

    src := client.Host().Directory("./sample-app")

    image := client.Container().Build(src)

    resp, err := image.Publish(ctx, fmt.Sprintf("ttl.sh/sample-dagger-%.0f", math.Floor(rand.Float64()*10000000)))
    fmt.Println(resp)
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }
}

Publish the application

long epoch
#

Hi! Is this happening in your local machine?

swift kraken
#

Yes!

long epoch
#

Ok, the unable to load labels is a warning message, you can ignore it. cc @past night maybe we should add a WARN prefix there or something.

Regarding the error you're getting, seems like the Dagger engine is not running. Can you verify by doing a docker ps?

swift kraken
#

The dagger engin seems to be activated.

$ docker ps
docker ps
CONTAINER ID   IMAGE                              COMMAND                  CREATED          STATUS          PORTS     NAMES
86bfceb76e9b   registry.dagger.io/engine:v0.4.0   "dagger-entrypoint.s…"   39 minutes ago   Up 39 minutes             dagger-engine-98b68395a7
eff25d

I have also implemented a pipeline to run the go test, which works fine.

long epoch
#

So it's only the publish pipeline that throws this error?

swift kraken
#

It’s just as you said

long epoch
#

Strange... I'm not in a computer now. I'll check it out later. What's your setup?

#

Linux, Mac or Windows?

swift kraken
#

Thanks.
My environment is windows.

neat steppe
#

Trying this on my Windows box

#

Wondering if you have golang 1.20

#

prob need to update mine, let's see

#

did a choco uninstall dagger had old version and choco install dagger. Got dagger 0.4.0.

PS C:\Windows\System32> dagger
Usage:
  dagger [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  query       Send API queries to a dagger engine
  run         Runs a command in a Dagger session
  version     Print dagger version

Flags:
      --debug            show buildkit debug logs
  -h, --help             help for dagger
      --workdir string   The host workdir loaded into dagger (default ".")

Use "dagger [command] --help" for more information about a command.
#

but I shouldn't need that to be present since SDK will take care of any needed CLI and Dagger Engine container images. Will uninstall again and use Go SDK.

#
PS C:\Users\Home\go-dagger\sample-app> go version
go version go1.17.8 windows/amd64
#

had old go version . Will update to 1.20

#

but will run once first with 1.17 🙂

#

installed SDK

PS C:\Users\Home\go-dagger> go get dagger.io/dagger@latest
go: downloading dagger.io/dagger v0.5.0
#

helpful message ! note: module requires Go 1.20

#

installed golang 1.20.2

#
PS C:\Users\Home\go-dagger> go version
go version go1.20.2 windows/amd64
PS C:\Users\Home\go-dagger> go get dagger.io/dagger@latest
go: downloading dagger.io/dagger v0.5.0
go: downloading github.com/vektah/gqlparser/v2 v2.5.1
go: downloading github.com/Khan/genqlient v0.5.0
go: downloading github.com/iancoleman/strcase v0.2.0
go: downloading golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
go: downloading github.com/adrg/xdg v0.4.0
go: downloading golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab
PS C:\Users\Home\go-dagger> go mod tidy
go: downloading github.com/stretchr/testify v1.8.1
go: downloading github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883
go: downloading github.com/sergi/go-diff v1.1.0
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/agnivade/levenshtein v1.1.1
long epoch
#

Thx Jeremy I have to dual boot to Windows and had a super busy day to test this 🙏

neat steppe
#
import "fmt"
import "math"
import "math/rand"
import "os"

import "dagger.io/dagger"

func main() {
    ctx := context.Background()

    client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
    if err != nil {
        panic(err)
    }
    defer client.Close()

    src := client.Host().Directory("./sample-app")

    image := client.Container().Build(src)

    resp, err := image.Publish(ctx, fmt.Sprintf("jeremyatdockerhub/sample-dagger-%.0f", math.Floor(rand.Float64()*10000000)))
    fmt.Println(resp)
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }
}
#

slight mod of original (panic, my dockerhub namespace)

#
PS C:\Users\Home\go-dagger> tree /F
Folder PATH listing for volume WINDOWS
Volume serial number is 0CD4-8562
C:.
│   go.mod
│   go.sum
│   main.go
│
└───sample-app
        Dockerfile
#
PS C:\Users\Home\go-dagger> type .\sample-app\Dockerfile
FROM alpine:latest
#

run from

#
PS C:\Users\Home\go-dagger> docker ps
CONTAINER ID   IMAGE                              COMMAND                  CREATED         STATUS         PORTS     NAMES
f9ee43816a5d   registry.dagger.io/engine:v0.4.0   "dagger-entrypoint.s…"   7 minutes ago   Up 7 minutes             dagger-engine-98b68395a7eff25d
#

regarding ttl.sh...hmmm wonder if
sample-dagger-1695583 is valid for ttl.sh or if it needs to be more like sample-dagger-1695583:1h for a 1 hour time to live

#

I'll try that

#

acutally those both work ☝️

#
func main() {
    ctx := context.Background()

    client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
    if err != nil {
        panic(err)
    }
    defer client.Close()

    src := client.Host().Directory("./sample-app")

    image := client.Container().Build(src)

    resp, err := image.Publish(ctx, fmt.Sprintf("ttl.sh/sample-dagger-%.0f", math.Floor(rand.Float64()*10000000)))
    fmt.Println(resp)
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }
}
#
#4 pushing manifest for ttl.sh/sample-dagger-6763849:latest@sha256:1343f5cb7668f09c43663aeb4a7198a7641d3f8d354236138c84583c9867a490 1.1s done
#
PS C:\Users\Home\go-dagger> docker run -it --rm ttl.sh/sample-dagger-6763849@sha256:1343f5cb7668f09c43663aeb4a7198a7641d3f8d354236138c84583c9867a490 sh
Unable to find image 'ttl.sh/sample-dagger-6763849@sha256:1343f5cb7668f09c43663aeb4a7198a7641d3f8d354236138c84583c9867a490' locally
ttl.sh/sample-dagger-6763849@sha256:1343f5cb7668f09c43663aeb4a7198a7641d3f8d354236138c84583c9867a490: Pulling from sample-dagger-6763849
63b65145d645: Already exists
Digest: sha256:1343f5cb7668f09c43663aeb4a7198a7641d3f8d354236138c84583c9867a490
Status: Downloaded newer image for ttl.sh/sample-dagger-6763849@sha256:1343f5cb7668f09c43663aeb4a7198a7641d3f8d354236138c84583c9867a490
/ # uname
Linux
swift kraken
#

Thank you for checking. I have solved this problem.

This was a problem with my source code.

long epoch
#

awesome @swift kraken !

swift kraken
#

Thanks for your thoughtful response!!!