Closed letsjustfixit closed 4 years ago
interesting sidenote: switching to sqlite3 got rid of the issue however that is just a workaround it doesnt solve the problem itself..
so just added -e database__client=sqlite3 -e database__connection__filename=/var/lib/ghost/current/content/data/db.sqlite3
and boom launch complete.. 😕 ❓
I can't reproduce an issue with Ghost using Percona
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c009fd2132f6 ghost:latest "docker-entrypoint.s…" 5 minutes ago Up 5 minutes 0.0.0.0:8080->2368/tcp ghost
85616f095e3b percona "/docker-entrypoint.…" 9 minutes ago Up 9 minutes 3306/tcp db
Hey there!
Thanks for the blazing fast followup!
I've experimented a bit locally (database was mariadb) where all went well, then moved on to the percona xtradb cluster and it moved on to another problem, however I think this might be a ghost problem (percona xtradb cluster master-enforceing compatibility one) + proxysql, not one with the docker container.. ..so I suppose feel free to close the ticket.
anyway:
```
[2020-02-17 14:59:16] INFO Creating table: posts
[2020-02-17 14:59:17] INFO Creating table: posts_meta
[2020-02-17 14:59:17] INFO Creating table: users
[2020-02-17 14:59:17] INFO Creating table: posts_authors
[2020-02-17 14:59:17] INFO Creating table: roles
[2020-02-17 14:59:17] INFO Creating table: roles_users
[2020-02-17 14:59:17] INFO Creating table: permissions
[2020-02-17 14:59:18] INFO Creating table: permissions_users
[2020-02-17 14:59:18] INFO Creating table: permissions_roles
[2020-02-17 14:59:18] INFO Creating table: permissions_apps
[2020-02-17 14:59:18] INFO Creating table: settings
[2020-02-17 14:59:18] INFO Creating table: tags
[2020-02-17 14:59:18] INFO Creating table: posts_tags
[2020-02-17 14:59:18] INFO Creating table: apps
[2020-02-17 14:59:18] INFO Creating table: app_settings
[2020-02-17 14:59:19] INFO Creating table: app_fields
[2020-02-17 14:59:19] INFO Creating table: invites
[2020-02-17 14:59:19] INFO Creating table: brute
[2020-02-17 14:59:19] INFO Creating table: webhooks
[2020-02-17 14:59:19] INFO Creating table: sessions
[2020-02-17 14:59:19] INFO Creating table: integrations
[2020-02-17 14:59:19] INFO Creating table: api_keys
[2020-02-17 14:59:20] INFO Creating table: mobiledoc_revisions
[2020-02-17 14:59:20] INFO Creating table: members
[2020-02-17 14:59:20] INFO Creating table: members_stripe_customers
[2020-02-17 14:59:20] INFO Creating table: members_stripe_customers_subscriptions
[2020-02-17 14:59:20] INFO Creating table: actions
[2020-02-17 14:59:20] INFO Creating table: emails
[2020-02-17 14:59:20] INFO Model: Tag
[2020-02-17 14:59:20] INFO Model: Role
[2020-02-17 14:59:20] INFO Model: Permission
[2020-02-17 14:59:21] INFO Model: User
[2020-02-17 14:59:22] INFO Model: Post
[2020-02-17 14:59:23] INFO Model: Integration
[2020-02-17 14:59:23] INFO Relation: Role to Permission
[2020-02-17 14:59:24] INFO Relation: Post to Tag
[2020-02-17 14:59:24] INFO Relation: User to Role
[2020-02-17 14:59:29] INFO Ghost is running in production...
[2020-02-17 14:59:29] INFO Your site is now available on http://10.9.1.38:2368/
[2020-02-17 14:59:29] INFO Ctrl+C to shut down
[2020-02-17 14:59:29] INFO Ghost boot 15.364s
[2020-02-17 15:00:15] INFO "GET /" 200 920ms
(node:1) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
[2020-02-17 15:00:15] INFO "GET /assets/built/screen.css?v=f7b5a363e5" 200 10ms
[2020-02-17 15:00:15] INFO "GET /assets/built/casper.js?v=f7b5a363e5" 200 3ms
[2020-02-17 15:00:16] INFO "GET /favicon.ico" 200 5ms
[2020-02-17 15:00:22] INFO "GET /ghost/" 200 219ms
[2020-02-17 15:00:22] INFO "GET /ghost/assets/img/medium-7359075af28d69523987ff4c0e2067c5.png" 200 3ms
[2020-02-17 15:00:22] ERROR "GET /ghost/api/v3/admin/users/me/?include=roles" 403 13ms
Authorization failed
"Unable to determine the authenticated user or integration. Check that cookies are being passed through if using session authentication."
Error ID:
38d07030-5196-11ea-b077-dd4ff3c58726
----------------------------------------
NoPermissionError: Authorization failed
at new NoPermissionError (/var/lib/ghost/versions/3.5.2/node_modules/ghost-ignition/lib/errors/index.js:127:23)
at authorizeAdminApi (/var/lib/ghost/versions/3.5.2/core/server/services/auth/authorize.js:27:25)
at Layer.handle [as handle_request] (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/layer.js:95:5)
at next (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/route.js:137:13)
at authenticate (/var/lib/ghost/versions/3.5.2/core/server/services/auth/session/middleware.js:103:16)
at Layer.handle [as handle_request] (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/layer.js:95:5)
at next (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/route.js:137:13)
at authenticate (/var/lib/ghost/versions/3.5.2/core/server/services/auth/api-key/admin.js:40:16)
at Layer.handle [as handle_request] (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/layer.js:95:5)
at next (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/layer.js:95:5)
at /var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/index.js:281:22
at param (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/index.js:354:14)
at param (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/index.js:365:14)
at Function.process_params (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/index.js:410:3)
at next (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/index.js:275:10)
at /var/lib/ghost/versions/3.5.2/node_modules/cors/lib/index.js:228:13
at handleCORS (/var/lib/ghost/versions/3.5.2/core/server/web/shared/middlewares/api/cors.js:71:16)
at corsMiddleware (/var/lib/ghost/versions/3.5.2/node_modules/cors/lib/index.js:204:7)
at Layer.handle [as handle_request] (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/index.js:317:13)
at /var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/index.js:335:12)
at next (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/index.js:275:10)
at Function.handle (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/index.js:174:3)
at router (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/index.js:47:12)
at Layer.handle [as handle_request] (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/index.js:317:13)
at /var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/index.js:335:12)
at next (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/index.js:275:10)
at cacheControlHeaders (/var/lib/ghost/versions/3.5.2/core/server/web/shared/middlewares/cache-control.js:32:9)
at Layer.handle [as handle_request] (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/index.js:317:13)
at /var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/index.js:335:12)
at next (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/index.js:275:10)
at checkVersionMatch (/var/lib/ghost/versions/3.5.2/core/server/web/shared/middlewares/api/version-match.js:23:5)
at Layer.handle [as handle_request] (/var/lib/ghost/versions/3.5.2/node_modules/express/lib/router/layer.js:95:5)
[2020-02-17 15:00:22] INFO "GET /ghost/api/v3/admin/site/" 200 7ms
[2020-02-17 15:00:23] INFO "GET /ghost/api/v3/admin/authentication/setup/" 200 30ms
[2020-02-17 15:00:23] INFO "GET /ghost/api/v3/admin/authentication/setup/" 200 15ms
[2020-02-17 15:00:37] INFO "POST /ghost/api/v3/admin/authentication/setup/" 201 379ms
[2020-02-17 15:00:37] ERROR "POST /ghost/api/v3/admin/session" 500 23ms
Unknown error
Error ID:
4154c440-5196-11ea-b077-dd4ff3c58726
Error Code:
ER_UNKNOWN_ERROR
----------------------------------------
InternalServerError: Unknown error
at new InternalServerError (/var/lib/ghost/versions/3.5.2/node_modules/ghost-ignition/lib/errors/index.js:90:23)
at Object.handleStoreError (/var/lib/ghost/versions/3.5.2/core/server/web/shared/middlewares/api/spam-prevention.js:27:25)
at module.exports.
There was a bug on version 3.5.x.
It's recommended to run 3.6.x
@wglambert problems start to arise if you would like to finish setting up & getting to the admin ui screen @pascalandy Hey! We meet again after so long :) :wave: I've given it one more shot :crossed_fingers: , however it is all the same. I think its just an issue with percona replication vs ghost :beetle: . /TBH I've already removed proxysql :bulb: as seemd to be the reason for the original issue (resource[fixture] not found)/
:heavy_check_mark: the issue with the bruteforce checking was an easy one with missing pk on the table:
alter table brute add `id` varchar(24) NOT NULL;alter table brute add PRIMARY KEY(id);
then realized default value must be provided and percona has no convinience function to set uuid-s so modified it to good old int autoincrements..
ALTER TABLE brute CHANGE id id INT(10)AUTO_INCREMENT PRIMARY KEY;
:man_facepalming: I'm just going to host my own personal blog, but it seems its easier and faster to do a quick 1node vanialla mysql setup compared to my idea of db replication with perconas take on galera. Thanks for all your work with maintaining the image
```
[2020-02-18 09:17:59] INFO Ctrl+C to shut down
[2020-02-18 09:17:59] INFO Ghost boot 17.558s
[2020-02-18 09:18:07] INFO "GET /" 200 985ms
(node:1) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
[2020-02-18 09:18:08] INFO "GET /assets/built/screen.css?v=a099c3efc1" 200 16ms
[2020-02-18 09:18:08] INFO "GET /assets/built/casper.js?v=a099c3efc1" 200 8ms
[2020-02-18 09:18:10] INFO "GET /favicon.ico" 200 6ms
[2020-02-18 09:18:13] INFO "GET /ghost" 301 2ms
[2020-02-18 09:18:14] INFO "GET /ghost/" 200 226ms
[2020-02-18 09:18:14] INFO "GET /ghost/assets/vendor.min-e80c50b3effa149734ab96b786349748.css" 200 76ms
[2020-02-18 09:18:14] INFO "GET /ghost/assets/ghost.min-0ec555bafc92452cf60496eb4ba4fd72.css" 200 167ms
[2020-02-18 09:18:14] INFO "GET /ghost/assets/ghost.min-0df10fff52a407c2771c9ac9076c4ed4.js" 200 288ms
[2020-02-18 09:18:15] INFO "GET /ghost/assets/vendor.min-5962b43ff141d221620b6489791d96ce.js" 200 766ms
[2020-02-18 09:18:15] ERROR "GET /ghost/api/v3/admin/users/me/?include=roles" 403 20ms
Authorization failed
"Unable to determine the authenticated user or integration. Check that cookies are being passed through if using session authentication."
Error ID:
97f04d30-522f-11ea-b642-99045c538f54
----------------------------------------
NoPermissionError: Authorization failed
at new NoPermissionError (/var/lib/ghost/versions/3.6.0/node_modules/ghost-ignition/lib/errors/index.js:127:23)
at authorizeAdminApi (/var/lib/ghost/versions/3.6.0/core/server/services/auth/authorize.js:27:25)
at Layer.handle [as handle_request] (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/layer.js:95:5)
at next (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/route.js:137:13)
at authenticate (/var/lib/ghost/versions/3.6.0/core/server/services/auth/session/middleware.js:103:16)
at Layer.handle [as handle_request] (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/layer.js:95:5)
at next (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/route.js:137:13)
at authenticate (/var/lib/ghost/versions/3.6.0/core/server/services/auth/api-key/admin.js:40:16)
at Layer.handle [as handle_request] (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/layer.js:95:5)
at next (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/layer.js:95:5)
at /var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/index.js:281:22
at param (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/index.js:354:14)
at param (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/index.js:365:14)
at Function.process_params (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/index.js:410:3)
at next (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/index.js:275:10)
at /var/lib/ghost/versions/3.6.0/node_modules/cors/lib/index.js:228:13
at handleCORS (/var/lib/ghost/versions/3.6.0/core/server/web/shared/middlewares/api/cors.js:71:16)
at corsMiddleware (/var/lib/ghost/versions/3.6.0/node_modules/cors/lib/index.js:204:7)
at Layer.handle [as handle_request] (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/index.js:317:13)
at /var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/index.js:335:12)
at next (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/index.js:275:10)
at Function.handle (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/index.js:174:3)
at router (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/index.js:47:12)
at Layer.handle [as handle_request] (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/index.js:317:13)
at /var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/index.js:335:12)
at next (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/index.js:275:10)
at cacheControlHeaders (/var/lib/ghost/versions/3.6.0/core/server/web/shared/middlewares/cache-control.js:32:9)
at Layer.handle [as handle_request] (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/index.js:317:13)
at /var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/index.js:335:12)
at next (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/index.js:275:10)
at checkVersionMatch (/var/lib/ghost/versions/3.6.0/core/server/web/shared/middlewares/api/version-match.js:23:5)
at Layer.handle [as handle_request] (/var/lib/ghost/versions/3.6.0/node_modules/express/lib/router/layer.js:95:5)
[2020-02-18 09:18:15] INFO "GET /ghost/assets/img/favicon.ico" 200 13ms
[2020-02-18 09:18:15] INFO "GET /ghost/api/v3/admin/site/" 200 6ms
[2020-02-18 09:18:15] INFO "GET /ghost/api/v3/admin/authentication/setup/" 200 31ms
[2020-02-18 09:18:15] INFO "GET /ghost/api/v3/admin/authentication/setup/" 200 8ms
[2020-02-18 09:18:15] INFO "GET /ghost/assets/img/install-welcome-ff3912d18bf8949df89c83b1c3b8bb66.png" 200 11ms
[2020-02-18 09:18:24] INFO "GET /ghost/assets/img/user-image-0d67f7ca80917835524605cf4d106aef.png" 200 6ms
[2020-02-18 09:19:04] INFO "POST /ghost/api/v3/admin/authentication/setup/" 201 535ms
[2020-02-18 09:19:04] ERROR "POST /ghost/api/v3/admin/session" 500 178ms
Unknown error
Error ID:
b555a190-522f-11ea-b642-99045c538f54
Error Code:
ER_UNKNOWN_ERROR
----------------------------------------
InternalServerError: Unknown error
at new InternalServerError (/var/lib/ghost/versions/3.6.0/node_modules/ghost-ignition/lib/errors/index.js:90:23)
at Object.handleStoreError (/var/lib/ghost/versions/3.6.0/core/server/web/shared/middlewares/api/spam-prevention.js:27:25)
at module.exports.
:information_source: And its not even a new problem, others with proxy setups (in this case docker) suffered the same fate before.. http://forum.ghost.org/t/cant-create-new-site-cryptic-error-meessage/9396/11
the error above is thrown because it tries to query the roles however the setup hasnt completed yet..
Hey! I've just wanted to spin up the latest official image of ghost backed with a percona mysql db, however it crashed on boot, so I've created a oneliner to test it out:
docker run -it --rm --network=db_network -e database__connection__port=6033 -e database__client=mysql -e database__connection__database=db -e database__connection__host=db -e database__connection__user=test -e database__connection__password=test1 -e unsplash__applicationId=id -e url=http://host -e urlssl=https://host ghost:latest bash
fiddled with knex-migrator a little, but didnt lead anywhere useful..
Any ideas?