Hyperledger Sawtooth Marketplace Rest API 404 error

192 views Asked by At

I am trying to build & test the following program on a clean install of Ubuntu v18:

https://github.com/hyperledger/sawtooth-marketplace

After installing, I get a 404 "resource not found" error when I try to navigate to the "Marketplace-Rest-API" (localhost:8040) and the "Sawtooth-Blockchain-Rest-API" (localhost:8043)

I am not sure why these don't work. The interfaces at localhost:8041 and localhost:8042 work perfectly well. It seems the rest APIs are navigated to in a similar way to these two so I'm not sure why they would work and the others wouldn't.

Edit: It seems I can reach the ports because there is a response in terminal:

 `[2018-11-20 15:16:14 +0000] [10] [INFO] Goin' Fast @ http://market-rest-api:8000
--- Logging error ---
`Traceback (most recent call last):
  File "/usr/lib/python3.5/logging/__init__.py", line 982, in emit
    stream.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 59-63: ordinal not in range(128)
Call stack:
  File "/project/sawtooth-marketplace/bin/marketplace-rest-api", line 30, in <module>
    main()
  File "/project/sawtooth-marketplace/rest_api/api/main.py", line 189, in main
    loop.run_forever()
  File "/usr/lib/python3.5/asyncio/base_events.py", line 345, in run_forever
    self._run_once()
  File "/usr/lib/python3.5/asyncio/base_events.py", line 1312, in _run_once
    handle._run()
  File "/usr/lib/python3.5/asyncio/events.py", line 125, in _run
    self._callback(*self._args)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/usr/local/lib/python3.5/dist-packages/sanic/app.py", line 775, in create_server
    backlog=backlog, run_async=True)
  File "/usr/local/lib/python3.5/dist-packages/sanic/app.py", line 891, in _helper
    logger.debug(self.config.LOGO)
Message: '\n                 \u2584\u2584\u2584\u2584\u2584\n        \u2580\u2580\u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2584\u2584\u2584       _______________\n      \u2584\u2584\u2584\u2584\u2584  \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2584  /                 \\\n     \u2580\u2580\u2580\u2580\u2588\u2588\u2588\u2588\u2588\u258c \u2580\u2590\u2584 \u2580\u2590\u2588 |   Gotta go fast!  |\n   \u2580\u2580\u2588\u2588\u2588\u2588\u2588\u2584\u2584 \u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2584\u2588\u2588 | _________________/\n   \u2580\u2584\u2584\u2584\u2584\u2584  \u2580\u2580\u2588\u2584\u2580\u2588\u2550\u2550\u2550\u2550\u2588\u2580 |/\n        \u2580\u2580\u2580\u2584  \u2580\u2580\u2588\u2588\u2588 \u2580       \u2584\u2584\n     \u2584\u2588\u2588\u2588\u2580\u2580\u2588\u2588\u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2584 \u2584\u2580\u2580\u2580\u2580\u2580\u2580\u2588\u258c\n   \u2588\u2588\u2580\u2584\u2584\u2584\u2588\u2588\u2580\u2584\u2588\u2588\u2588\u2580 \u2580\u2580\u2588\u2588\u2588\u2588      \u2584\u2588\u2588\n\u2584\u2580\u2580\u2580\u2584\u2588\u2588\u2584\u2580\u2580\u258c\u2588\u2588\u2588\u2588\u2592\u2592\u2592\u2592\u2592\u2592\u2588\u2588\u2588     \u258c\u2584\u2584\u2580\n\u258c    \u2590\u2580\u2588\u2588\u2588\u2588\u2590\u2588\u2588\u2588\u2592\u2592\u2592\u2592\u2592\u2590\u2588\u2588\u258c\n\u2580\u2584\u2584\u2584\u2584\u2580   \u2580\u2580\u2588\u2588\u2588\u2588\u2592\u2592\u2592\u2592\u2584\u2588\u2588\u2580\n          \u2580\u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2580\n        \u2584\u2584\u2588\u2588\u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2580\u2588\n      \u2584\u2588\u2588\u2580     \u2580\u2580\u2580  \u2588\n     \u2584\u2588             \u2590\u258c\n \u2584\u2584\u2584\u2584\u2588\u258c              \u2580\u2588\u2584\u2584\u2584\u2584\u2580\u2580\u2584\n\u258c     \u2590                \u2580\u2580\u2584\u2584\u2584\u2580\n \u2580\u2580\u2584\u2584\u2580\n'
 `

Any help would be much appreciated!

1

There are 1 answers

0
Dan Anderson On

So the REST API does not work at all for you, it seems.

Ports 8042 (thinkdb admin) and 8041 (Sawbuck web app) are not related to the REST API.

My guess is the sawtooth-rest-api and market-rest-api components have not started (if you are using Docker) or you have not started the marketplace-rest-api and the sawtooth-rest-api commands (daemons) if you are running directly in Ubuntu. Are these processes running? Can the ports be reached from the network (e.g., access the Marketplace REST API with telnet localhost 8040 and Sawtooth REST API with telnet localhost 8043 )