Cli: Dependency package download failed

Created on 24 Sep 2019  ยท  20Comments  ยท  Source: urfave/cli

The package "https://github.com/cpuguy83/go-md2man/v2/md2man" used in docs.go could not been download any more. It needs to be fixed please.

kinbug statutriage

Most helpful comment

Still waiting for someone to give me a full reproduction in CI slightly_smiling_face

Excuse me, What's "CI" means?

Can you provide us a reproducible environment, like a container and some commands? :)

All 20 comments

Downgrading to v1.21.0 worked for me.

@lvbin2012 @zzell @vulcan-lin @lbarman can any of you show me a CI build that reproduces this?

@lvbin2012 did you run this with enabled go modules? How does the output of go env look like?

i met this problem also; "urfave/cli/docs.go:11:2: cannot find package "github.com/cpuguy83/go-md2man/v2/md2man"";
$ go env

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build572817432=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"

Still waiting for someone to give me a full reproduction in CI ๐Ÿ™‚

Hey FYI for everyone following this, I still don't have enough information to debug this! Please help me out with a CI build I can look at, so I can have the full context of the failure

Still waiting for someone to give me a full reproduction in CI ๐Ÿ™‚

Excuse me, What's "CI" means?

Still waiting for someone to give me a full reproduction in CI slightly_smiling_face

Excuse me, What's "CI" means?

Can you provide us a reproducible environment, like a container and some commands? :)

go version:go version go1.7.1 linux/amd64
os: ubuntu 14.04
kernel:3.13.0-83-generic
command: $ go build main.go

package main

import (
    "fmt"
    "github.com/urfave/cli"
    "log"
    "os"
    "os/exec"
    "syscall"
)

func main() {
    app := cli.NewApp()
    app.Commands = []cli.Command{
        {
            Name: "run",
            Usage: `create a container with namespace and cgroups limit mydocker run -ti [command]`,
            Flags: []cli.Flag{
                cli.BoolFlag{
                    Name: "ti",
                },
            },
            Action: func(c *cli.Context) error {
                if len(c.Args()) < 1 {
                    return fmt.Errorf("missing container command")
                }

                cmd := exec.Command("/proc/self/exe", "init", c.Args().Get(0))
                cmd.SysProcAttr = &syscall.SysProcAttr{
                    Cloneflags:syscall.CLONE_NEWIPC | syscall.CLONE_NEWUTS | syscall.CLONE_NEWPID | syscall.CLONE_NEWNS | syscall.CLONE_NEWNET,
                }

                if tty := c.Bool("ti"); tty {
                    cmd.Stdin = os.Stdin
                    cmd.Stdout = os.Stdout
                    cmd.Stderr = os.Stderr
                }

                if err := cmd.Start(); err != nil {
                    log.Fatal(err)
                }

                if err := cmd.Wait(); err != nil {
                    log.Fatal(err)
                }

                return nil
            },
        },
        {
            Name: "init",
            Usage: "init for container",
            Action: func(c *cli.Context) error {
                command := c.Args().Get(0)
                if err := syscall.Mount("proc", "/proc", "proc", uintptr(syscall.MS_NOEXEC | syscall.MS_NOSUID | syscall.MS_NOSUID), ""); err != nil {
                    log.Fatal(err)
                }

                argv := []string{command}
                if err:= syscall.Exec(command, argv, os.Environ()); err !=nil {
                    log.Fatal(err)
                }
                return nil
            },
        },
    }

    if err := app.Run(os.Args); err != nil {
        log.Fatal(err)
    }
}

message

../../urfave/cli/docs.go:11:2: cannot find package "github.com/cpuguy83/go-md2man/v2/md2man" in any of:
    /usr/local/go/src/github.com/cpuguy83/go-md2man/v2/md2man (from $GOROOT)
    /root/go/src/github.com/cpuguy83/go-md2man/v2/md2man (from $GOPATH)

@johnnylei that's better, but I need a bit more ๐Ÿ” if it's in a public repo, can you link me to the repo? Otherwise can you give me:

  • your go.mod / go.sum file
  • the command you are running when you get the error above

@johnnylei that's better, but I need a bit more ๐Ÿ” if it's in a public repo, can you link me to the repo? Otherwise can you give me:

  • your go.mod / go.sum file
  • the command you are running when you get the error above

https://github.com/johnnylei/my_docker

We use go modules, this requires go 1.12 or even 1.13. your go binary does not support go modules and fetches random versions of our dependencies.

We use go modules, this requires go 1.12 or even 1.13. your go binary does not support go modules and fetches random versions of our dependencies.

thanks, i fixed this problem using git checkout v1.17.0;

Pre-emptively: please keep this issue open, I'm not confident that johnnylei's issue is the same as everyone else's.

@lvbin2012 @zzell @vulcan-lin @lbarman @tharvik can you go through the debugging steps above, so we can get more details about this issue? You asked for us to fix a problem we don't know how to reproduce, and cannot help you without more input.

Hi @lynncyrin , sorry for being unresponsive. The problem does not happen when I download everything on a fresh computer; I must have some package stuck somewhere, however go get -u ./... is currently not solving the issue. But I can confirm that if you start from 0 (no Go packages on a VM), I don't get the issue.

@lbarman does that mean this issue https://github.com/dedis/prifi/issues/213 is resolved also?

๐Ÿ‘‹ @lvbin2012 one last ping on this ๐Ÿ™ can you go through some of the same debugging instructions that are described above? If not, I can close this โ™ป๏ธ

@lynncyrin dedis/prifi#213 is resolved (or rather, not reproducable), looks like a transient issue.

As far as I can tell, nobody is still experiencing an issue here that we can solve on our end - so I'm closing this.

Please feel free to comment again if you have a similar issue, ideally with debugging information included. Thanks everyone! โœจ

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LeonB picture LeonB  ยท  5Comments

costela picture costela  ยท  3Comments

krostar picture krostar  ยท  5Comments

lynncyrin picture lynncyrin  ยท  3Comments

navono picture navono  ยท  4Comments