Skip to content

Instantly share code, notes, and snippets.

@fischermario
Last active May 29, 2018 09:41
Show Gist options
  • Save fischermario/e2c254ec927cbf3ca9c65e19a9b07bdf to your computer and use it in GitHub Desktop.
Save fischermario/e2c254ec927cbf3ca9c65e19a9b07bdf to your computer and use it in GitHub Desktop.

Error 405 after trying to provision a client

1. docker-compse result

Creating mainflux-things-db  ... done
Creating mainflux-nats       ... done
Creating mainflux-nginx      ... done
Creating mainflux-normalizer ... done
Creating mainflux-dashflux   ... done
Creating mainflux-users-db   ... done
Creating mainflux-users      ... done
Creating mainflux-things     ... done
Creating mainflux-ws         ... done
Creating mainflux-mqtt       ... done
Creating mainflux-http       ... done
CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS              PORTS                                                              NAMES
70672693c681        mainflux/ws:latest           "/exe"                   22 seconds ago      Up 18 seconds       0.0.0.0:8186->8186/tcp                                             mainflux-ws
7c4cbb3b7367        mainflux/http:latest         "/exe"                   22 seconds ago      Up 18 seconds       0.0.0.0:8185->8185/tcp                                             mainflux-http
8c31288ba12b        mainflux/mqtt:latest         "node mqtt.js"           22 seconds ago      Up 20 seconds       0.0.0.0:1883->1883/tcp, 0.0.0.0:8880->8880/tcp                     mainflux-mqtt
9bbd4c34f3f3        mainflux/things:latest       "/exe"                   23 seconds ago      Up 17 seconds       0.0.0.0:8182->8182/tcp, 8183/tcp                                   mainflux-things
bce0201f71b2        mainflux/users:latest        "/exe"                   23 seconds ago      Up 21 seconds       0.0.0.0:8180->8180/tcp, 8181/tcp                                   mainflux-users
bf9b660944c2        postgres:10.2-alpine         "docker-entrypoint.s…"   25 seconds ago      Up 23 seconds       5432/tcp                                                           mainflux-users-db
9c2da075d0be        mainflux/dashflux:latest     "nginx -g 'daemon of…"   25 seconds ago      Up 23 seconds       80/tcp, 0.0.0.0:3000->3000/tcp                                     mainflux-dashflux
2350c5643c49        nginx:1.13-alpine            "nginx -g 'daemon of…"   25 seconds ago      Up 19 seconds       0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:8883->8883/tcp   mainflux-nginx
812ad3db631b        nats:1.0.2                   "/gnatsd -c gnatsd.c…"   25 seconds ago      Up 22 seconds       4222/tcp, 6222/tcp, 8222/tcp                                       mainflux-nats
7a05d7413b1e        mainflux/normalizer:latest   "/exe"                   25 seconds ago      Up 21 seconds       8184/tcp                                                           mainflux-normalizer
5ae0afc6364c        postgres:10.2-alpine         "docker-entrypoint.s…"   25 seconds ago      Up 22 seconds       5432/tcp                                                           mainflux-things-db

2. Account creation

Request:

curl -s -S -i --cacert docker/ssl/certs/mainflux-server.crt --insecure -X POST -H "Content-Type: application/json" https://localhost/users -d '{"email":"test@gmail.com", "password":"123"}'

Response:

HTTP/1.1 201 Created
Server: nginx/1.13.12
Date: Tue, 29 May 2018 09:24:30 GMT
Content-Type: application/json
Content-Length: 0
Connection: keep-alive
Strict-Transport-Security: max-age=63072000; includeSubdomains
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: *
Access-Control-Allow-Headers: *

3. Obtaining an authorization key

Request:

curl -s -S -i --cacert docker/ssl/certs/mainflux-server.crt --insecure -X POST -H "Content-Type: application/json" https://localhost/tokens -d '{"email":"test@gmail.com", "password":"123"}'

Response:

HTTP/1.1 201 Created
Server: nginx/1.13.12
Date: Tue, 29 May 2018 09:25:53 GMT
Content-Type: application/json
Content-Length: 194
Connection: keep-alive
Strict-Transport-Security: max-age=63072000; includeSubdomains
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: *
Access-Control-Allow-Headers: *

{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Mjc2MjE5NTMsImlhdCI6MTUyNzU4NTk1MywiaXNzIjoibWFpbmZsdXgiLCJzdWIiOiJ0ZXN0QGdtYWlsLmNvbSJ9.4IzfWgZQB7lnIq04-mI7n1lR30olj-qjUvuHc5Kvwvo"}

4. Provisioning devices

Request:

curl -s -S -i --cacert docker/ssl/certs/mainflux-server.crt --insecure -X POST -H "Content-Type: application/json" -H "Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Mjc2MjE5NTMsImlhdCI6MTUyNzU4NTk1MywiaXNzIjoibWFpbmZsdXgiLCJzdWIiOiJ0ZXN0QGdtYWlsLmNvbSJ9.4IzfWgZQB7lnIq04-mI7n1lR30olj-qjUvuHc5Kvwvo" https://localhost/clients -d '{"type":"device", "name":"weio"}'

Response:

HTTP/1.1 405 Not Allowed
Server: nginx/1.13.12
Date: Tue, 29 May 2018 09:27:00 GMT
Content-Type: text/html
Content-Length: 174
Connection: keep-alive

<html>
<head><title>405 Not Allowed</title></head>
<body bgcolor="white">
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx/1.13.12</center>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment