blackfriday icon indicating copy to clipboard operation
blackfriday copied to clipboard

Code no longer builds due to broken URL github.com/russross/blackfriday/v2

Open jinzishuai opened this issue 5 years ago • 17 comments

We use packages that uses blackfriday and today we got

github.com/russross/blackfriday (download)
[13:54:28]package github.com/russross/blackfriday/v2: cannot find package "github.com/russross/blackfriday/v2" in any of:
[13:54:28]	/opt/go/src/github.com/russross/blackfriday/v2 (from $GOROOT)
[13:54:28]	/opt/TeamCity/buildAgent/work/34f7a3c3b5ec8423/server/syntropy3/src/go/src/github.com/russross/blackfriday/v2 (from $GOPATH)

I checked that the URL of github.com/russross/blackfriday/v2 is not valid.

Anything changed recently? Our daily builds have been working for quite a long time.

Thanks Shi

jinzishuai avatar Oct 29 '18 20:10 jinzishuai

What version of Go are you using?

moorereason avatar Oct 29 '18 20:10 moorereason

We are using go version go1.9.2 linux/amd64. thanks

jinzishuai avatar Oct 30 '18 02:10 jinzishuai

It’s related to Go modules. You need at least 1.9.7. See https://github.com/golang/go/wiki/Modules.

moorereason avatar Oct 30 '18 03:10 moorereason

@moorereason I have Go 1.11. So what gives?

import "gopkg.in/russross/blackfriday.v2"
$ go build
go: downloading gopkg.in/russross/blackfriday.v2 v2.0.1
build fancypackage: cannot find module for path gopkg.in/russross/blackfriday.v2

wizardist avatar Nov 03 '18 17:11 wizardist

@wizardist, not sure, but it's unrelated to this issue.

moorereason avatar Nov 03 '18 17:11 moorereason

@moorereason yeah, maybe a bug in go mod, maybe smelly package cache, but import "github.com/russross/blackfriday/v2" worked.

wizardist avatar Nov 04 '18 19:11 wizardist

@moorereason I have Go 1.11. So what gives?

import "gopkg.in/russross/blackfriday.v2"
$ go build
go: downloading gopkg.in/russross/blackfriday.v2 v2.0.1
build fancypackage: cannot find module for path gopkg.in/russross/blackfriday.v2

I am experience this problem too when doing Travis CI, on local everything OK. Any update on this?

sonyarianto avatar Nov 29 '18 10:11 sonyarianto

I had this problem with skaffold importing "gopkg.in/russross/blackfriday.v2" My workaround is to use a replace directive in my go.mod:

replace gopkg.in/russross/blackfriday.v2 => github.com/russross/blackfriday/v2 v2.0.1

bttk avatar Apr 12 '19 19:04 bttk

@bttk

replace gopkg.in/russross/blackfriday.v2 => github.com/russross/blackfriday/v2 v2.0.1

Thank you! You just made my day! I've spent hours because of this:

go: gopkg.in/russross/[email protected]: go.mod has non-....v2 module path "github.com/russross/blackfriday/v2" at revision v2.0.1
go get: error loading module requirements

Now go build works without complains. – Just out of curiosity: What made you think of that workaround?

mwat56 avatar May 04 '19 15:05 mwat56

@mwat56 I saw the same error

At first I thought it was an error in the module path, but go docs say it is an exception for paths in gopkg.in

I saw, that replace can be used to override version and location, so I used it.

bttk avatar May 04 '19 23:05 bttk

@bttk I am having a similar issue, what was your remediation?

tbarbugli avatar Jul 29 '19 08:07 tbarbugli

@tbarbugli

I am having a similar issue, what was your remediation?

In go.mod this:

require (
    // …
    gopkg.in/russross/blackfriday.v2 v2.0.1
)

replace gopkg.in/russross/blackfriday.v2 => github.com/russross/blackfriday/v2 v2.0.1

Hope it helps.

mwat56 avatar Jul 29 '19 11:07 mwat56

when i use this `require ( // … gopkg.in/russross/blackfriday.v2 v2.0.1 )

replace gopkg.in/russross/blackfriday.v2 => github.com/russross/blackfriday/v2 v2.0.1`

i got this message go: github.com/russross/blackfriday/[email protected] used for two different module paths (github.com/russross/blackfriday/v2 and gopkg.in/russross/blackfriday.v2) anything wrong?

Mote-Z avatar Apr 22 '20 13:04 Mote-Z

@Mote-Z

[...] i got this message go: github.com/russross/blackfriday/[email protected] used for two different module paths (github.com/russross/blackfriday/v2 and gopkg.in/russross/blackfriday.v2) anything wrong?

Did you check your source files to make sure your imports point to gopkg.in/russross/blackfriday.v2?

mwat56 avatar Apr 23 '20 09:04 mwat56

@Mote-Z

[...] i got this message go: github.com/russross/blackfriday/[email protected] used for two different module paths (github.com/russross/blackfriday/v2 and gopkg.in/russross/blackfriday.v2) anything wrong?

Did you check your source files to make sure your imports point to gopkg.in/russross/blackfriday.v2?

yes , first I imports "gopkg.in/russross/blackfriday.v2" and it shows me the error above , later i change all (imports and module in go.mod) to "github.com/russross/blackfriday/v2" , it worked

Mote-Z avatar Apr 28 '20 00:04 Mote-Z

I'm on go version go1.15.6 windows/amd64. Indeed, running go get github.com/russross/blackfriday/v2 did not work and caused the following:

cannot find package "github.com/russross/blackfriday/v2" in any of:
        C:\Go\src\github.com\russross\blackfriday\v2 (from $GOROOT)
        C:\Users\Atulya\gopath\src\github.com\russross\blackfriday\v2 (from $GOPATH)

I was able to get it working perfectly fine using: go get gopkg.in/russross/blackfriday.v2 and importing using

import "gopkg.in/russross/blackfriday.v2"

Thanks for developing this! 👍🏼

atultw avatar Mar 21 '21 19:03 atultw

Same issue here with Go 1.15.11 on linux/amd64 when running go get on a project that has github.com/russross/blackfriday/v2 v2.0.1 in its go.mod requirements (and imports the GitHub name as well). This works as a workaround:

replace github.com/russross/blackfriday/v2 => gopkg.in/russross/blackfriday.v2 v2.0.1

Considering the former is supposed to be the canonical v2 URL though, something is definitely afoul here.

JustAnotherArchivist avatar Apr 17 '21 20:04 JustAnotherArchivist