dikaio
12/19/2017 - 11:04 PM

iex.ex

<dikaio> iex -S mix phx.server
Erlang/OTP 20 [erts-9.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]

[info] Running TycoonWeb.Endpoint with Cowboy using http://0.0.0.0:4000
Interactive Elixir (1.5.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> [info] OPTIONS /api/v1/registrations
[debug] Preflight CORS request from Origin 'http://localhost:8080' is allowed
[info] Sent 200 in 5ms
[info] POST /api/v1/registrations
[debug] Simple CORS request from Origin 'http://localhost:8080' is allowed
[debug] Processing with TycoonWeb.RegistrationController.create/2
  Parameters: %{"user" => %{"email" => "i@dikaio.com", "first_name" => "Donovan", "last_name" => "Dikaio", "password" => "[FILTERED]", "password_confirmation" => "[FILTERED]"}}
  Pipelines: [:api]
[debug] QUERY OK db=0.2ms
begin []
[debug] QUERY ERROR db=12.6ms
INSERT INTO "users" ("email","encrypted_password","first_name","last_name","inserted_at","updated_at") VALUES ($1,$2,$3,$4,$5,$6) RETURNING "id" ["i@dikaio.com", "$argon2i$v=19$m=65536,t=6,p=1$UkZRgIAZhIDriR7plII3eg$lcEUi1WVP7y5LFgx+gt3M+l7WotXILayLz1hoGUPKDY", "Donovan", "Dikaio", {{2017, 12, 19}, {22, 26, 53, 786169}}, {{2017, 12, 19}, {22, 26, 53, 786178}}]
[debug] QUERY OK db=0.2ms
rollback []
[info] Sent 422 in 501ms
[info] OPTIONS /api/v1/sessions
[debug] Preflight CORS request from Origin 'http://localhost:8080' is allowed
[info] Sent 200 in 55µs
[info] POST /api/v1/sessions
[debug] Simple CORS request from Origin 'http://localhost:8080' is allowed
[debug] Processing with TycoonWeb.SessionController.create/2
  Parameters: %{"email" => "i@dikaio.com", "password" => "[FILTERED]"}
  Pipelines: [:api]
[debug] QUERY OK source="users" db=4.5ms
SELECT u0."id", u0."email", u0."encrypted_password", u0."first_name", u0."last_name", u0."inserted_at", u0."updated_at" FROM "users" AS u0 WHERE (u0."email" = $1) ["i@dikaio.com"]
[info] Sent 201 in 415ms
[info] OPTIONS /api/v1/servers
[debug] Preflight CORS request from Origin 'http://localhost:8080' is allowed
[info] Sent 200 in 45µs
[debug] QUERY OK source="users" db=1.2ms
SELECT u0."id", u0."email", u0."encrypted_password", u0."first_name", u0."last_name", u0."inserted_at", u0."updated_at" FROM "users" AS u0 WHERE (u0."id" = $1) [1]
[info] JOIN "users:1" to TycoonWeb.UserChannel
  Transport:  Phoenix.Transports.WebSocket (2.0.0)
  Serializer:  Phoenix.Transports.V2.WebSocketSerializer
  Parameters: %{}
[info] Replied users:1 :ok
[info] GET /api/v1/servers
[debug] Simple CORS request from Origin 'http://localhost:8080' is allowed
[debug] QUERY OK source="users" db=2.0ms
SELECT u0."id", u0."email", u0."encrypted_password", u0."first_name", u0."last_name", u0."inserted_at", u0."updated_at" FROM "users" AS u0 WHERE (u0."id" = $1) [1]
[debug] Processing with TycoonWeb.ServerController.index/2
  Parameters: %{}
  Pipelines: [:api]
[debug] QUERY OK source="servers" db=2.0ms
SELECT s0."id", s0."name", s0."instanceId", s0."instanceIp", s0."status", s0."db_root_pass", s0."wp_db", s0."wp_user", s0."wp_pass", s0."wp_user_pass", s0."dns_configured", s0."ssl_configured", s0."user_id", s0."inserted_at", s0."updated_at" FROM "servers" AS s0 WHERE (s0."user_id" = $1) [1]
[info] Sent 200 in 9ms
[info] OPTIONS /api/v1/servers
[debug] Preflight CORS request from Origin 'http://localhost:8080' is allowed
[info] Sent 200 in 65µs
[info] POST /api/v1/servers
[debug] Simple CORS request from Origin 'http://localhost:8080' is allowed
[debug] QUERY OK source="users" db=1.6ms
SELECT u0."id", u0."email", u0."encrypted_password", u0."first_name", u0."last_name", u0."inserted_at", u0."updated_at" FROM "users" AS u0 WHERE (u0."id" = $1) [1]
[debug] Processing with TycoonWeb.ServerController.create/2
  Parameters: %{"server" => %{"name" => "nearlycivilized.com"}}
  Pipelines: [:api]
[debug] QUERY OK db=0.2ms
begin []
[debug] QUERY OK db=13.8ms
INSERT INTO "servers" ("db_root_pass","instanceId","instanceIp","name","user_id","wp_db","wp_pass","wp_user","wp_user_pass","inserted_at","updated_at") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11) RETURNING "id" ["db_root_pass_3914306", "i-038dfe3b1f372b068", "13.56.179.159", "nearlycivilized.com", 1, "wp_db_1480821", "pass_9404335", "wp_user_3547651", "wp_user_pass_7771038", {{2017, 12, 19}, {22, 27, 13, 807265}}, {{2017, 12, 19}, {22, 27, 13, 807272}}]
[debug] QUERY OK db=0.8ms
commit []
{:ok, "c639aa56-dece-44c3-8f73-ce15d4339c59"}
[info] Sent 201 in 1433ms
[info] Elixir.Worker[c639aa56-dece-44c3-8f73-ce15d4339c59] start
[info] OPTIONS /api/v1/servers/check_dns
[debug] Preflight CORS request from Origin 'http://localhost:8080' is allowed
[info] Sent 200 in 63µs
[info] POST /api/v1/servers/check_dns
[debug] Simple CORS request from Origin 'http://localhost:8080' is allowed
[debug] QUERY OK source="users" db=1.8ms
SELECT u0."id", u0."email", u0."encrypted_password", u0."first_name", u0."last_name", u0."inserted_at", u0."updated_at" FROM "users" AS u0 WHERE (u0."id" = $1) [1]
[debug] Processing with TycoonWeb.ServerController.check_dns/2
  Parameters: %{"id" => 1}
  Pipelines: [:api]
[debug] QUERY OK source="servers" db=8.5ms
SELECT s0."id", s0."name", s0."instanceId", s0."instanceIp", s0."status", s0."db_root_pass", s0."wp_db", s0."wp_user", s0."wp_pass", s0."wp_user_pass", s0."dns_configured", s0."ssl_configured", s0."user_id", s0."inserted_at", s0."updated_at" FROM "servers" AS s0 WHERE ((s0."id" = $1) AND (s0."user_id" = $2)) [1, 1]
[info] Sent 202 in 124ms
"DNS not configured"
[error] #PID<0.516.0> running TycoonWeb.Endpoint terminated
Server: localhost:4000 (http)
Request: POST /api/v1/servers/check_dns
** (exit) an exception was raised:
    ** (RuntimeError) expected action/2 to return a Plug.Conn, all plugs must receive a connection (conn) and return a connection
        (tycoon) lib/tycoon_web/controllers/api/v1/server_controller.ex:1: TycoonWeb.ServerController.phoenix_controller_pipeline/2
        (tycoon) lib/tycoon_web/endpoint.ex:1: TycoonWeb.Endpoint.instrument/4
        (phoenix) lib/phoenix/router.ex:278: Phoenix.Router.__call__/1
        (tycoon) lib/tycoon_web/endpoint.ex:1: TycoonWeb.Endpoint.plug_builder_call/2
        (tycoon) lib/plug/debugger.ex:99: TycoonWeb.Endpoint."call (overridable 3)"/2
        (tycoon) lib/tycoon_web/endpoint.ex:1: TycoonWeb.Endpoint.call/2
        (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
        (cowboy) /Users/dikaio/Projects/tycoon/back/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
"running"
[debug] QUERY OK source="servers" db=2.7ms
SELECT s0."id", s0."name", s0."instanceId", s0."instanceIp", s0."status", s0."db_root_pass", s0."wp_db", s0."wp_user", s0."wp_pass", s0."wp_user_pass", s0."dns_configured", s0."ssl_configured", s0."user_id", s0."inserted_at", s0."updated_at" FROM "servers" AS s0 WHERE (s0."instanceId" = $1) ["i-038dfe3b1f372b068"]
[debug] QUERY OK db=0.1ms
begin []
[debug] QUERY OK db=9.7ms
UPDATE "servers" SET "status" = $1, "updated_at" = $2 WHERE "id" = $3 ["running", {{2017, 12, 19}, {22, 27, 34, 269233}}, 1]
[debug] QUERY OK db=0.5ms
commit []
[debug] QUERY OK source="users" db=0.7ms
SELECT u0."id", u0."email", u0."encrypted_password", u0."first_name", u0."last_name", u0."inserted_at", u0."updated_at", u0."id" FROM "users" AS u0 WHERE (u0."id" = $1) [1]
[DEPRECATION WARNING]: The sudo command line option has been deprecated in
                                                                           favor of the "become" command line arguments. This feature will be removed in
                                                                         version 2.6. Deprecation warnings can be disabled by setting
                                                      deprecation_warnings=False in ansible.cfg.
                {"\nPLAY [nearlycivilized.com] *****************************************************\n\nTASK [Gathering Facts] *********************************************************\nfatal: [nearlycivilized.com]: UNREACHABLE! => {\"changed\": false, \"msg\": \"Failed to connect to the host via ssh: Warning: Permanently added '13.56.179.159' (ECDSA) to the list of known hosts.\\r\\nubuntu@13.56.179.159: Permission denied (publickey).\\r\\n\", \"unreachable\": true}\n\tto retry, use: --limit @/Users/dikaio/Projects/tycoon/back/_build/dev/lib/tycoon/priv/ansible/ansible-ubuntu-16/playbook.retry\n\nPLAY RECAP *********************************************************************\nnearlycivilized.com        : ok=0    changed=0    unreachable=1    failed=0   \n\n",
 4}
[debug] Sending email with Bamboo.MailgunAdapter:

%Bamboo.Email{assigns: %{}, bcc: [], cc: [], from: {nil, "install@tycoon.io"}, headers: %{}, html_body: "<strong>nearlycivilized.com installation completed.</strong>\n<p>kindly point your domain A record to 13.56.179.159</p>\n<p>Also point CNAME record www to nearlycivilized.com</p>\n<p>\nYou can access your admin dashbord at nearlycivilized.com/wp-admin with credentials\nusername: i@dikaio.com\npassword: wp_user_pass_7771038\n</p>\n", private: %{}, subject: "Installation Complete!", text_body: "nearlycivilized.com installation completed.\nkindly point your domain A record to 13.56.179.159\nAlso point CNAME record www to nearlycivilized.com\nYou can access your admin dashbord at nearlycivilized.com/wp-admin with credentials\nusername: i@dikaio.com\npassword: wp_user_pass_7771038\n\n", to: [nil: "i@dikaio.com"]}

[info] Elixir.Worker[c639aa56-dece-44c3-8f73-ce15d4339c59] done: 44281ms sec
[debug] QUERY OK source="users" db=0.3ms
SELECT u0."id", u0."email", u0."encrypted_password", u0."first_name", u0."last_name", u0."inserted_at", u0."updated_at" FROM "users" AS u0 WHERE (u0."id" = $1) [1]
[info] JOIN "users:1" to TycoonWeb.UserChannel
  Transport:  Phoenix.Transports.WebSocket (2.0.0)
  Serializer:  Phoenix.Transports.V2.WebSocketSerializer
  Parameters: %{}
[info] Replied users:1 :ok
[debug] QUERY OK source="users" db=0.3ms
SELECT u0."id", u0."email", u0."encrypted_password", u0."first_name", u0."last_name", u0."inserted_at", u0."updated_at" FROM "users" AS u0 WHERE (u0."id" = $1) [1]
[info] JOIN "users:1" to TycoonWeb.UserChannel
  Transport:  Phoenix.Transports.WebSocket (2.0.0)
  Serializer:  Phoenix.Transports.V2.WebSocketSerializer
  Parameters: %{}
[info] Replied users:1 :ok
[debug] QUERY OK source="users" db=0.8ms
SELECT u0."id", u0."email", u0."encrypted_password", u0."first_name", u0."last_name", u0."inserted_at", u0."updated_at" FROM "users" AS u0 WHERE (u0."id" = $1) [1]
[info] JOIN "users:1" to TycoonWeb.UserChannel
  Transport:  Phoenix.Transports.WebSocket (2.0.0)
  Serializer:  Phoenix.Transports.V2.WebSocketSerializer
  Parameters: %{}
[info] Replied users:1 :ok
[debug] QUERY OK source="users" db=0.3ms
SELECT u0."id", u0."email", u0."encrypted_password", u0."first_name", u0."last_name", u0."inserted_at", u0."updated_at" FROM "users" AS u0 WHERE (u0."id" = $1) [1]
[info] JOIN "users:1" to TycoonWeb.UserChannel
  Transport:  Phoenix.Transports.WebSocket (2.0.0)
  Serializer:  Phoenix.Transports.V2.WebSocketSerializer
  Parameters: %{}
[info] Replied users:1 :ok
[debug] QUERY OK source="users" db=0.7ms
SELECT u0."id", u0."email", u0."encrypted_password", u0."first_name", u0."last_name", u0."inserted_at", u0."updated_at" FROM "users" AS u0 WHERE (u0."id" = $1) [1]
[info] JOIN "users:1" to TycoonWeb.UserChannel
  Transport:  Phoenix.Transports.WebSocket (2.0.0)
  Serializer:  Phoenix.Transports.V2.WebSocketSerializer
  Parameters: %{}
[info] Replied users:1 :ok