goconvey icon indicating copy to clipboard operation
goconvey copied to clipboard

404 Page Not Found

Open tgrosinger opened this issue 11 years ago • 25 comments

I have Convey running and can see in netcat that it is listening on port 8080. When I navigate to http://localhost:8080 however I see a blank page with only the words "404 page not found". If I stop Convey this page is no longer accessible.

I am running on Ubuntu 14.04 with Go 1.3 and the web UI was working great until one time when I restarted it.

tgrosinger avatar Jul 29 '14 16:07 tgrosinger

Strange. Cache issue? (Try a hard refresh or with cache disabled?)

What is the output of telnet localhost 8080 then:

GET / HTTP/1.1

mholt avatar Jul 29 '14 16:07 mholt

telnet successfully connects and a hard refresh has the same results as stated above.

tgrosinger avatar Jul 29 '14 17:07 tgrosinger

So the telnet output is a 200 (the HTML of the GoConvey UI)? Then it sounds like a browser issue. Which browser are you using? What happens if you try a different one? Also try killing the goconvey process and re-starting it (with the UI closed, just to be sure).

If it's still 404ing, what does the browser's inspector tools say about the raw HTTP request? i.e. what is its request URL, and the raw response from the server?

mholt avatar Jul 29 '14 17:07 mholt

It actually was only able to make a connection, not receive any actual content. I did find an issue though which was preventing tests from compiling.

It seems that it will not fully start when the tests do not compile. It looks like it starts, but the web UI will not be accessible. My problem is now solved, but I am not closing the issue so you are aware of this and can further diagnose it.

Thanks for your help!

tgrosinger avatar Jul 29 '14 21:07 tgrosinger

@tgrosinger - I've never seen the server have problems starting just because a package wouldn't build. In fact, it's designed to show build failures. Do you have any console output from the server that you can include here? Is the code you are testing open-source, and if so, can you link to the commit that wasn't building?

mdwhatcott avatar Jul 30 '14 01:07 mdwhatcott

I'm having the same issue

telnet localhost 8081 
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET / HTTP/1.1

HTTP/1.1 404 Not Found
Content-Type: text/plain; charset=utf-8
Date: Thu, 14 Aug 2014 15:32:31 GMT
Content-Length: 19

404 page not found
^]
telnet> Connection closed.

Nothing much changed since I last run it, except I think I pulled the latest version of GoConvey. I'll go update now and see

kalbasit avatar Aug 14 '14 15:08 kalbasit

Ok so I recently change the location of my GOPATH from ~/code/go to ~/go. However, I did not remove the go/bin or go/pkg folders. I suspect that the here variable was still pointing to the old location of the GOPATH and GoConvey just couldn't find the static files.

@tgrosinger try remove the bin/pkg folders and re-install

kalbasit avatar Aug 16 '14 06:08 kalbasit

@eMxyzptlk Cheers - you were spot on!

gwhitelaw avatar Oct 14 '14 17:10 gwhitelaw

@tgrosinger - Are you encountering this behavior or does the suggestion by @eMxyzptlk (above) help?

mdwhatcott avatar Oct 23 '14 21:10 mdwhatcott

My guess is that the suggestion to remove the bin and pkg folders, then reinstall, worked. Bizarre. I'm still looking into why that would be.

mholt avatar Oct 24 '14 15:10 mholt

I renamed my goworkspace and this same problem occurred for me, and the provided solution worked (remove $gopath/pkg directory), so that go get and go install can re-generate those files.

For some reason (I assume internal-workings of Go), some of the files inside the $gopath/pkg/ contain full paths to other files living inside that directory.

Link to a question on golang-dev mailing list regarding these files: https://groups.google.com/d/topic/golang-dev/IbYwz9xwNys/discussion

gima avatar Nov 14 '14 17:11 gima

Sounds like this is more a go issue than a goconvey issue.

mdwhatcott avatar Nov 14 '14 18:11 mdwhatcott

Sounds like this is more a go issue than a goconvey issue.

I disagree.

goconvey calls runtime.Caller(0). This reports, among other things, the file location of the calling function. In the larger context of generic Go programs, it's perfectly valid for this not to exist. Imagine if you compile a Go program and then give it to me. My file system will differ from yours. I probably don't have the source to whatever you gave me installed, much less in exactly the same place. That's perfectly valid when reporting, say, a stack trace, but not so much when trying to access files based on that path.

This is similar to what's happened with Goconvey. It looks in a directory that was valid when Goconvey.exe was compiled. But I've changed my file system, and that directory no longer exists in the same place.

I don't know what the right answer is, exactly, but I'm pretty sure that it involves not using runtime.Caller() to find Goconvey's html files. At a guess, you'd want to either search underneath $GOPATH, or just have a GOCONVEY or GOCONVEYPATH variable (or both).

theclapp avatar Feb 01 '15 21:02 theclapp

I'd rather not use an extra environment variable or assume that goconvey is installed at $GOAPTH/src/github.com/smartystreets/goconvey (although I don't know why it wouldn't be).

We could simply do an exists check at startup and if the directory doesn't exist (because someone moved their $GOPATH, we warn the user to delete $GOPATH/bin/goconvey and re-run go install github.com/smartystreets/goconvey.

mdwhatcott avatar Feb 09 '15 22:02 mdwhatcott

Sorry for my absence. I somehow missed the mention notifications. Needless to say, I stopped encountering this issue.

Anyone else still having this, or should we close the issue?

tgrosinger avatar Oct 01 '15 21:10 tgrosinger

@tgrosinger Not lately. But move $GOPATH/src/github.com/smartystreets/goconvey to somewhere else and try it yourself.

theclapp avatar Oct 02 '15 00:10 theclapp

I had this issue today. I was receiving a 404 error after changing my $GOPATH location. To fix it I

  1. Deleted the file /bin/goconvey
  2. Deleted folder /pkg/github/smartstreets/goconvey
  3. Ran go get github.com/smartystreets/goconvey

Thanks for your great work on goconvey :100:

iampeterbanjo avatar Mar 07 '16 20:03 iampeterbanjo

Thanks for posting your workaround @iampeterbanjo

mdwhatcott avatar Mar 07 '16 20:03 mdwhatcott

I had this issue today due to I had used goconvey for another project in my machine, To fix it I

  1. export new GOPATH for my workspace
  2. go get github.com/smartystreets/goconvey
  3. ran whereis goconvey to find old goconvey and delete it
  4. cp new goconvey from $GOPATH/bin/ to /bin/ folder hope this would be useful and thanks all participants especially the author

ansiz avatar Aug 03 '16 03:08 ansiz

I have a similar issue. I have the goconvey binary on my server, I launch a container (which has a different gopath) and start the goconvey binary inside it. On startup it logs:

Could not find or create the coverage report directory (at: '/home/craig/projects/workspace/src/github.com/smartystreets/goconvey/web/client/reoprts').

The issue I believe is that inside my container the /home/craig/projects... path does not exist. Is there a way to have goconvey put reports somewhere else?

mindscratch avatar Dec 15 '16 19:12 mindscratch

@mindscratch: I think your code block has a typo reoprts, unclear if that accurately reflects error message or not.

atz avatar Mar 07 '19 16:03 atz

@atz thanks for mentioning it, though I'm no longer using goconvey so I can't confirm if that was the problem :)

mindscratch avatar Mar 07 '19 16:03 mindscratch

I did not change anything on my machine and I suddenly started experiencing this issue. The work arounds mentioned here don't work. Any other thoughts, it's weird this happens

sandy-adi avatar Aug 04 '20 21:08 sandy-adi

I met the same issue. some txt files generated in $GOPATH/pkg/mod/github.com/smartystreets/[email protected]/web/client/reports but same name html files not exists。

check $GOROOT/bin If the go not in this path, move your go into it。 whereis go find your go.

Jiaget avatar Jan 07 '22 09:01 Jiaget

https://github.com/smartystreets/goconvey/issues/619#issuecomment-1980343642

MrGuoRanDuo avatar Mar 07 '24 02:03 MrGuoRanDuo