Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Installation problem #56

Open
DawidCh opened this issue Nov 29, 2018 · 9 comments
Open

Installation problem #56

DawidCh opened this issue Nov 29, 2018 · 9 comments

Comments

@DawidCh
Copy link

DawidCh commented Nov 29, 2018

Hello.
During installation I have following problem:

go get github.com/Microsoft/azure-vhd-utils
    # github.com/Microsoft/azure-vhd-utils/upload
    go/src/github.com/Microsoft/azure-vhd-utils/upload/upload.go:89:34: cxt.BlobServiceClient.PutPage undefined (type storage.BlobStorageClient has no field or method PutPage)
    go/src/github.com/Microsoft/azure-vhd-utils/upload/upload.go:93:7: undefined: storage.PageWriteTypeUpdate
    # github.com/Microsoft/azure-vhd-utils/upload/metadata
    go/src/github.com/Microsoft/azure-vhd-utils/upload/metadata/metaData.go:95:32: blobClient.GetBlobMetadata undefined (type storage.BlobStorageClient has no field or method GetBlobMetadata)

My versions:

go version go1.11 linux/amd64
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.1 LTS
Release:	18.04
Codename:	bionic

Could you please help?
Regards, Dawid.

@slcj
Copy link

slcj commented Dec 4, 2018

+1 I'm experiencing the same issue.
go version go1.11.2 linux/amd64

@cs-niraj-nandane
Copy link

+1 I am getting same issue on CentOS 7

@rahulroshan96
Copy link

rahulroshan96 commented Jan 4, 2019

+1 I am also getting the same error on
Linux 4.4.0-137-generic #163-Ubuntu SMP Mon Sep 24 13:14:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

# github.com/Microsoft/azure-vhd-utils/upload
go/src/github.com/Microsoft/azure-vhd-utils/upload/upload.go:89:34: cxt.BlobServiceClient.PutPage undefined (type storage.BlobStorageClient has no field or method PutPage)
go/src/github.com/Microsoft/azure-vhd-utils/upload/upload.go:93:7: undefined: storage.PageWriteTypeUpdate
# github.com/Microsoft/azure-vhd-utils/upload/metadata
go/src/github.com/Microsoft/azure-vhd-utils/upload/metadata/metaData.go:95:32: blobClient.GetBlobMetadata undefined (type storage.BlobStorageClient has no field or method GetBlobMetadata)

@aaha97
Copy link

aaha97 commented Jan 7, 2019

moving the azure-vhd-utils directory from $GOPATH/src/github.com/Microsoft/ to $GOPATH/bin and performing a build from within the directory worked for me

@cs-niraj-nandane
Copy link

how to do that ?

@tonylambiris
Copy link

tonylambiris commented Jan 21, 2019

I was able to fix this by using the following Gopkg.toml

[[constraint]]
  name = "github.com/Azure/azure-sdk-for-go"
  revision = "d05c22dc3f9fdd2ec6e3593839fdd44df17f2de5"

[[constraint]]
  name = "github.com/Azure/azure-pipeline-go"
  revision = "f4da77e3846319876aebb41f2e6dccc6b1d7f1e0"

[[constraint]]
  name = "github.com/Azure/azure-storage-blob-go"
  revision = "fb328272929aed4cd6e5108011abe489d6e445fa"

[[constraint]]
  name = "gopkg.in/urfave/cli.v1"
  version = "1.20.0"

[prune]
  go-tests = true
  unused-packages = true

The quick steps are:

  1. Clone this repo and cd into aazure-vhd-utils (make sure you're on master)
  2. Run go get -v -u github.com/golang/dep/cmd/dep
  3. Run dep init -v
  4. Replace the generated Gopkg.toml with the snippet above
  5. run dep ensure -v -update

Then you should be able to type make:

➜ make
go test ./...
?   	github.com/Microsoft/azure-vhd-utils	[no test files]
?   	github.com/Microsoft/azure-vhd-utils/upload	[no test files]
?   	github.com/Microsoft/azure-vhd-utils/upload/concurrent	[no test files]
?   	github.com/Microsoft/azure-vhd-utils/upload/metadata	[no test files]
?   	github.com/Microsoft/azure-vhd-utils/upload/progress	[no test files]
?   	github.com/Microsoft/azure-vhd-utils/vhdcore	[no test files]
?   	github.com/Microsoft/azure-vhd-utils/vhdcore/bat	[no test files]
?   	github.com/Microsoft/azure-vhd-utils/vhdcore/block	[no test files]
?   	github.com/Microsoft/azure-vhd-utils/vhdcore/block/bitmap	[no test files]
?   	github.com/Microsoft/azure-vhd-utils/vhdcore/common	[no test files]
?   	github.com/Microsoft/azure-vhd-utils/vhdcore/diskstream	[no test files]
?   	github.com/Microsoft/azure-vhd-utils/vhdcore/footer	[no test files]
?   	github.com/Microsoft/azure-vhd-utils/vhdcore/header	[no test files]
?   	github.com/Microsoft/azure-vhd-utils/vhdcore/header/parentlocator	[no test files]
?   	github.com/Microsoft/azure-vhd-utils/vhdcore/innererror	[no test files]
?   	github.com/Microsoft/azure-vhd-utils/vhdcore/reader	[no test files]
?   	github.com/Microsoft/azure-vhd-utils/vhdcore/validator	[no test files]
?   	github.com/Microsoft/azure-vhd-utils/vhdcore/vhdfile	[no test files]
?   	github.com/Microsoft/azure-vhd-utils/vhdcore/writer	[no test files]
go build
golint ./...
vendor/gopkg.in/urfave/cli.v1/command.go:69:6: exported type CommandsByName should have comment or be unexported
vendor/gopkg.in/urfave/cli.v1/errors.go:37:6: exported type ErrorFormatter should have comment or be unexported
go fmt ./...
➜ ./azure-vhd-utils -h | head -5
NAME:
   vhd - Commands to manage VHDs

USAGE:
   azure-vhd-utils [global options] command [command options] [arguments...]

@sachinktewari
Copy link

The solution is simple. I am assuming you already installed go environment on your system and GOPATH and its bin is already appended in PATH. Now do the following things.

  1. Install golint using following command
    go get -u golang.org/x/lint/golint
  2. Clone the azure-vhd-utils to some directory and cd to azure-vhd-utils directory.
  3. Now make
    $ make
    go test ./...
    ? github.com/Microsoft/azure-vhd-utils [no test files]
    ? github.com/Microsoft/azure-vhd-utils/upload [no test files]
    ? github.com/Microsoft/azure-vhd-utils/upload/concurrent [no test files]
    ? github.com/Microsoft/azure-vhd-utils/upload/metadata [no test files]
    ? github.com/Microsoft/azure-vhd-utils/upload/progress [no test files]
    ? github.com/Microsoft/azure-vhd-utils/vhdcore [no test files]
    ? github.com/Microsoft/azure-vhd-utils/vhdcore/bat [no test files]
    ? github.com/Microsoft/azure-vhd-utils/vhdcore/block [no test files]
    ? github.com/Microsoft/azure-vhd-utils/vhdcore/block/bitmap [no test files]
    ? github.com/Microsoft/azure-vhd-utils/vhdcore/common [no test files]
    ? github.com/Microsoft/azure-vhd-utils/vhdcore/diskstream [no test files]
    ? github.com/Microsoft/azure-vhd-utils/vhdcore/footer [no test files]
    ? github.com/Microsoft/azure-vhd-utils/vhdcore/header [no test files]
    ? github.com/Microsoft/azure-vhd-utils/vhdcore/header/parentlocator [no test files]
    ? github.com/Microsoft/azure-vhd-utils/vhdcore/innererror [no test files]
    ? github.com/Microsoft/azure-vhd-utils/vhdcore/reader [no test files]
    ? github.com/Microsoft/azure-vhd-utils/vhdcore/validator [no test files]
    ? github.com/Microsoft/azure-vhd-utils/vhdcore/vhdfile [no test files]
    ? github.com/Microsoft/azure-vhd-utils/vhdcore/writer [no test files]
    go build
    golint ./...
    go fmt ./...
  4. You can find the executable in the same directory.
  5. Enjoy.

@invidian
Copy link

invidian commented May 9, 2019

Dockerized version for anyone interested:

FROM microsoft/azure-cli

RUN apk add go --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community/ --allow-untrusted

WORKDIR /usr/src

RUN go get -u golang.org/x/lint/golint && \
    wget https://github.com/microsoft/azure-vhd-utils/archive/master.zip && \
    unzip master.zip && \
    rm master.zip

WORKDIR /usr/src/azure-vhd-utils-master

ENV PATH="/root/go/bin:${PATH}"
RUN make && \
    cp /usr/src/azure-vhd-utils-master/azure-vhd-utils /usr/local/bin/azure-vhd-utils

marwinski added a commit to gardenlinux/gardenlinux that referenced this issue Mar 18, 2020
This is dirty but due to the effort I commit this here.

This tool is taken from https://github.com/microsoft/azure-vhd-utils
and has been compiled with some difficulty. In the end this weird hint
did help: microsoft/azure-vhd-utils#56 (comment)
@stderr-to-devnull
Copy link

stderr-to-devnull commented Feb 24, 2021

The solution is simple. I am assuming you already installed go environment on your system and GOPATH and its bin is already appended in PATH. Now do the following things.

1. Install golint using following command
   **go get -u golang.org/x/lint/golint**

2. Clone the azure-vhd-utils to some directory and cd to azure-vhd-utils directory.

3. Now make
   $ make
   go test ./...
   ?   	github.com/Microsoft/azure-vhd-utils	[no test files]
   ?   	github.com/Microsoft/azure-vhd-utils/upload	[no test files]
   ?   	github.com/Microsoft/azure-vhd-utils/upload/concurrent	[no test files]
   ?   	github.com/Microsoft/azure-vhd-utils/upload/metadata	[no test files]
   ?   	github.com/Microsoft/azure-vhd-utils/upload/progress	[no test files]
   ?   	github.com/Microsoft/azure-vhd-utils/vhdcore	[no test files]
   ?   	github.com/Microsoft/azure-vhd-utils/vhdcore/bat	[no test files]
   ?   	github.com/Microsoft/azure-vhd-utils/vhdcore/block	[no test files]
   ?   	github.com/Microsoft/azure-vhd-utils/vhdcore/block/bitmap	[no test files]
   ?   	github.com/Microsoft/azure-vhd-utils/vhdcore/common	[no test files]
   ?   	github.com/Microsoft/azure-vhd-utils/vhdcore/diskstream	[no test files]
   ?   	github.com/Microsoft/azure-vhd-utils/vhdcore/footer	[no test files]
   ?   	github.com/Microsoft/azure-vhd-utils/vhdcore/header	[no test files]
   ?   	github.com/Microsoft/azure-vhd-utils/vhdcore/header/parentlocator	[no test files]
   ?   	github.com/Microsoft/azure-vhd-utils/vhdcore/innererror	[no test files]
   ?   	github.com/Microsoft/azure-vhd-utils/vhdcore/reader	[no test files]
   ?   	github.com/Microsoft/azure-vhd-utils/vhdcore/validator	[no test files]
   ?   	github.com/Microsoft/azure-vhd-utils/vhdcore/vhdfile	[no test files]
   ?   	github.com/Microsoft/azure-vhd-utils/vhdcore/writer	[no test files]
   go build
   golint ./...
   go fmt ./...

4. You can find the executable in the same directory.

5. Enjoy.

Why isn't this answer placed in the INSTALLATION INSTRUCTIONS since following the current ones results in these errors:

go get github.com/Microsoft/azure-vhd-utils
# github.com/Microsoft/azure-vhd-utils/upload
src/github.com/Microsoft/azure-vhd-utils/upload/upload.go:89:34: cxt.BlobServiceClient.PutPage undefined (type storage.BlobStorageClient has no field or method PutPage)
src/github.com/Microsoft/azure-vhd-utils/upload/upload.go:93:7: undefined: storage.PageWriteTypeUpdate
# github.com/Microsoft/azure-vhd-utils/upload/metadata
src/github.com/Microsoft/azure-vhd-utils/upload/metadata/metaData.go:95:32: blobClient.GetBlobMetadata undefined (type storage.BlobStorageClient has no field or method GetBlobMetadata)

...or what dependencies need to be met before attempting to go get? ALL dependencies for main distros like Ubuntu (20.04) in my case. The installation instructions are incomplete/faulty.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants