TryGhost / Ghost

Independent technology for modern publishing, memberships, subscriptions and newsletters.
https://ghost.org
MIT License
47.48k stars 10.36k forks source link

permalink: '{globals.permalinks}' invalid, trailing slash required error - default fails from docker hub download #15469

Closed imylomylo closed 2 years ago

imylomylo commented 2 years ago

Issue Summary

I downloaded the docker image from docker hub, put it into a docker-compose with mysql 8, and had error on install about permalinks. (My journey of yesterday started off in mariadb running under easy engine, so i knew i was in for some software masochism)

The following definition "{globals.permalinks}" is invalid: A trailing slash is required

I'm new to ghost, exploring it from other web stuff and it took me a couple of hours to find out what to do.

I ended up grep -ril permalink in the content directory and found settings/routes.yaml which had the `{globals.permalinks}' offending line.

Finding my way to the routes documentation, I ended up eventually putting

permalink: /{slug}/

but only after leaving it out completely to try to make the original error go away. The new error said permalink was required, and gave the /{slug}/ example - however, super inconvenient for a fresh install.

Perhaps a few of the suggested options in docs can be put into the routes.yaml file commented out to offer a newbie some option.

The error message, permalink: '{globals.permalinks}' invalid could probably also tell the user to check the routes.yaml file (if this is the only place such a setting can be used).

Of course, I did not RTFM, because i have a grey beard, and we didn't do things like that. Now get off my lawn, i've been waiting 20+ years to sound like i have a belly full of food and ready to snooze but would rather configure some new app that seems like it will be enjoyable....but why such frustration at the first steps!! Hopefully this rant will offer a google link for someone that searches any of the following:

permalink: '{globals.permalinks}' invalid ghost -wordpress
The following definition "{globals.permalinks}" is invalid: A trailing slash is required.
ValidationError: The following definition "{globals.permalinks}" is invalid: A trailing slash is required.

Steps to Reproduce

Create a docker-compose.yaml file, with mysql-8, and configure it appropriately. This configuration is a bit of a frankenstein because it uses nginx proxy from easy-engine.

There's not much v5 docker-compose material out there, so hopefully i can make something turnkey during the week for other newbs.

version: '3.5'

services:
  ghost:
    image: ghost:5.14.2-alpine
    restart: always
    volumes:
      - "/opt/easyengine/sites/020.tokyo.n******s.org/app/htdocs/:/var/lib/ghost/content"
    depends_on:
      - ghostdb
    environment:
      # see https://docs.ghost.org/docs/config#section-running-ghost-with-config-env-variables
      database__client: mysql
      database__connection__host: ghostdb
      database__connection__user: ghost
      database__connection__password: ghost
      database__connection__database: ghost
      url: http://020.tokyo.n******s.org/
    networks:
      site-network:
        aliases:
          - 020.tokyo.n******s.org
  ghostdb:
    image: mysql:8.0
    restart: unless-stopped
    container_name: ghostdb
    cap_add:
      - SYS_NICE
    environment:
      - MYSQL_ROOT_PASSWORD=YourSecureRootPasswordGoesHere
      - MYSQL_DATABASE=ghost
      - MYSQL_USER=ghost
      - MYSQL_PASSWORD=ghost
    volumes:
    ## You'll need to create a new folder on your system for the Docker volume
      - /opt/easyengine/sites/020.tokyo.n******s.org/db:/var/lib/mysql
    networks:
      site-network:
        aliases:
          - 020.tokyo.n******s.org
networks:
  site-network:
    name: 020.tokyo.n******s.org
    labels:
     - "org.label-schema.vendor=EasyEngine"
     - "io.easyengine.site=020.tokyo.n******s.org"
  global-backend-network:
    external:
      name: ee-global-backend-network

Ghost Version

5.14

Node.js Version

16

How did you install Ghost?

docker

Database type

MySQL 8

Browser & OS version

No response

Relevant log / error output

No hint of where to look to fix this error message, most frustrating for me as a newb. Was it a database collation problem, a database field error, and last place i looked was routes.yaml

ghost_1    | [2022-09-24 17:43:29] ERROR The following definition "{globals.permalinks}" is invalid: A trailing slash is required.
ghost_1    | 
ghost_1    | The following definition "{globals.permalinks}" is invalid: A trailing slash is required.

No search results.

66ce5b50-3c30-11ed-8efa-1f906766d729

No search results.

81fb72f0-3c30-11ed-b383-91ff86ccf3e8

Helpful output! But only after knowing I had fiddled with routes.yaml

ghost_1    | The following definition "/" is invalid: Please define a permalink route.
ghost_1    | 
ghost_1    | "e.g. permalink: /{slug}/"
ghost_1    | 


### Code of Conduct

- [X] I agree to be friendly and polite to people in this repository
ErisDS commented 2 years ago

If this is truly reproducible with the docker image from docker hub, then it'd be best to raise the issue with them: https://github.com/docker-library/ghost/issues however I suspect that isn't the case (else we'd have heard about this before).

When it comes to the unintelligible error, could you please clarify the contents of the routes.yaml file when the error message was triggered?

github-actions[bot] commented 2 years ago

Note from our bot: The needs info label has been added to this issue. Updating your original issue with more details is great, but won't notify us, so please make sure you leave a comment so that we can see when you've updated us.

imylomylo commented 2 years ago

If this is truly reproducible with the docker image from docker hub, then it'd be best to raise the issue with them: https://github.com/docker-library/ghost/issues however I suspect that isn't the case (else we'd have heard about this before).

When it comes to the unintelligible error, could you please clarify the contents of the routes.yaml file when the error message was triggered?

Sure, i will be working through this later this week. Thanks for replying - it wasn't my best bug report :)

ErisDS commented 2 years ago

Did you ever get to the bottom of this?

github-actions[bot] commented 2 years ago

Hey @imylomylo 👋

Our team needed some more info to get to the bottom of this, however we've not heard back from you. We're going to close this for now, but let us know if you manage to dig up some more info and we'll reopen.

imylomylo commented 2 years ago

Sorry I did not try again in recent weeks. If I do web stuff and encounter it i will re-open and reference this ticket. Cheers

On Thu, Nov 3, 2022 at 12:30 AM Hannah Wolfe @.***> wrote:

Did you ever get to the bottom of this?

— Reply to this email directly, view it on GitHub https://github.com/TryGhost/Ghost/issues/15469#issuecomment-1300984994, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEUADPQOQAWZZIA2EQ5FYN3WGKQLZANCNFSM6AAAAAAQUXYNIQ . You are receiving this because you authored the thread.Message ID: @.***>