blackducksoftware / hub-detect

This is now deprecated. Please see synopsys-detect.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting 404 for /api/current-version

tyd opened this issue · comments

commented

This morning I started getting the following 404. Previously with version 3.0.1 this wasn't happening.

With Detect Version: 3.1.0 we are now getting:
2018-03-19 11:02:59 ERROR [main] --- There was a problem trying to GET this item: http://XXXXX:8080/api/current-version?offset=0&limit=100. Error: 404 Not Found: 404: Not Found

We are running Blackduck Hub 3.6.2

I'm experiencing the same problem with Blackduck Hub 4.0.0.

16:21:45.051 [info] 2018-03-19 16:21:45 ERROR [main] --- An unrecoverable error occurred - most likely this is due to your environment and/or configuration. Please double check the Hub Detect documentation: https://blackducksoftware.atlassian.net/wiki/x/Y7HtAg
16:21:45.051 [info] 2018-03-19 16:21:45 ERROR [main] --- There was a problem trying to GET this item: https://XXXX/api/current-version?offset=0&limit=100. Error: 404 : 404
16:21:45.056 [info] 2018-03-19 16:21:45 INFO  [main] --- 
16:21:45.056 [info] 2018-03-19 16:21:45 INFO  [main] --- 
16:21:45.056 [info] 2018-03-19 16:21:45 INFO  [main] --- ======== Detect Results ========
16:21:45.060 [info] 2018-03-19 16:21:45 INFO  [main] --- Overall Status: FAILURE_GENERAL_ERROR
16:21:45.060 [info] 2018-03-19 16:21:45 INFO  [main] --- ================================
16:21:45.060 [info] 2018-03-19 16:21:45 INFO  [main] --- 
16:21:45.062 [info] 2018-03-19 16:21:45 INFO  [main] --- Hub-Detect run duration: 00h 00m 01s 155ms
16:21:45.111 [info] Result code of 99, exiting
16:21:45.115 [error] Hub-detect scan failed! Exit code: 99

Same problem here.
Same log.
same version (3.1.0)

commented

As a workaround, you can run 3.0.1 with the following env var:

export DETECT_LATEST_RELEASE_VERSION=3.0.1

Can someone try running curl http://XXXXX:8080/api/current-version?offset=0&limit=100? What does that return? make sure you use curl -k https://XXXXX:8080/api/current-version?offset=0&limit=100, if the Hub server is https

commented

@jamesrichard91

I ran curl http://XXXXX:8080/api/current-version?offset=0&limit=100
and received:

{"errorMessage":"Invalid username or password","arguments":{},"errors":null,"errorCode":"{core.rest.unauthenticated}"}

commented

@morsmodre which version of the Hub are you running please?

The result of running curl -k https://XXXXX/api/current-version?offset=0&limit=100

{"errorMessage":"Invalid username or password","arguments":{},"errors":null,"errorCode":"{core.rest.unauthenticated}"}

@jamesrichard91

@akamen We're using Hub 4.0.0

And we're using hub-detect in the standard way:

bash <(curl -s https://blackducksoftware.github.io/hub-detect/hub-detect.sh) \
--blackduck.hub.url="<myserver>" \
--blackduck.hub.username="<myuser> \
--blackduck.hub.password="<mypass>" \
--detect.project.name="<project>" \
--detect.project.version.name="<branch>" \
--detect.risk.report.pdf=true \
--blackduck.hub.auto.import.cert=true \
--detect.notice.report=true \
--detect.api.timeout=2700000 
commented

@morsmodre as it turns out, Hub Detect 3.1.0 requires a much later Hub version. So two options here:

  1. Upgrade your Hub
  2. Downgrade your Detect: export DETECT_LATEST_RELEASE_VERSION=3.0.1