Import from Wordpress - missed images 404

If you’re looking for some help, it’s important to provide as much context as possible so that people are able to assist you. Try to always mention:

  • What version of Ghost are you using? 3.42.0

  • What configuration? docker rootless, Caddy Proxy

  • What browser? Chromium

  • What errors or information do you see in the console?

    [2021-03-09 16:06:28] ERROR “GET /content/images/size/w1000/2020/11/inwertersmart-girl-1666678.jpg” 500 7ms

    Failed to lookup view “error-404” in views directory “/var/lib/ghost/versions/3.42.0/core/server/views/”


    Error: Failed to lookup view “error-404” in views directory “/var/lib/ghost/versions/3.42.0/core/server/views/”
    at Function.render (/var/lib/ghost/versions/3.42.0/node_modules/express/lib/application.js:580:17)
    at ServerResponse.render (/var/lib/ghost/versions/3.42.0/node_modules/express/lib/response.js:1012:7)
    at _private.ThemeErrorRenderer (/var/lib/ghost/versions/3.42.0/core/server/web/shared/middlewares/error-handler.js:190:9)
    at Layer.handle_error (/var/lib/ghost/versions/3.42.0/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix (/var/lib/ghost/versions/3.42.0/node_modules/express/lib/router/index.js:315:13)
    at /var/lib/ghost/versions/3.42.0/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/lib/ghost/versions/3.42.0/node_modules/express/lib/router/index.js:335:12)
    at next (/var/lib/ghost/versions/3.42.0/node_modules/express/lib/router/index.js:275:10)
    at Layer.handle_error (/var/lib/ghost/versions/3.42.0/node_modules/express/lib/router/layer.js:67:12)
    at trim_prefix (/var/lib/ghost/versions/3.42.0/node_modules/express/lib/router/index.js:315:13)
    at /var/lib/ghost/versions/3.42.0/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/lib/ghost/versions/3.42.0/node_modules/express/lib/router/index.js:335:12)
    at next (/var/lib/ghost/versions/3.42.0/node_modules/express/lib/router/index.js:275:10)
    at _private.prepareError (/var/lib/ghost/versions/3.42.0/core/server/web/shared/middlewares/error-handler.js:72:5)
    at Layer.handle_error (/var/lib/ghost/versions/3.42.0/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix (/var/lib/ghost/versions/3.42.0/node_modules/express/lib/router/index.js:315:13)

      [2021-03-08 22:01:53] WARN {{#get}} helper took 342ms to complete
    
      {{#get}} helper took 342ms to complete
    
      Error ID:
          e447fda0-8059-11eb-96c4-cbe6c8cc375e
    
      Error Code:
          SLOW_GET_HELPER
    
      Details:
          api:          v3.postsPublic.browse
          apiOptions:
            include: authors,tags
            limit:   3
          returnedRows: 3
    
  • What steps could someone else take to reproduce the issue you’re having?

  • Ubuntu 20.04
  • docker rootless
  • docker compose
  • copy images to ghost/content/images/
    *export/import from Wordpress to Ghost

While editing the post, path to the image URL is correct there, but still the image is not found.
I also uploaded featured image manually on post and the image has been uploaded and displayed correctly on the post-edit page, but it was not in /content/images directory and not displayed on frontend post.

docker-compose ghost settings:

ghost:

    container_name: ghost

    image: ghost:3.42.0

    restart: unless-stopped

    depends_on:

      - mysql

    environment:

      NODE_ENV: production

      url: https://example.com

    volumes:

      - ./ghostcms/content:/var/lib/ghost/content

      - ./ghostcms/config.production.json:/var/lib/ghost/config.production.json

config file:

{
    "url": "https://example.com",
    "server": {
        "port": 2351,
        "host": "10.5.0.6"
    },
    "database": {
        "client": "mysql",
        "connection": {
            "host": "10.5.0.7",
            "port": 3306,
            "user": "$user",
            "password": "$password",
            "database": "$databasename",
            "charset": "utf8mb4"
            }
    },
    "mail": {
        "transport": "SMTP",
        "options": {
          "service": "$service",
          "host": "$host",
          "port": 587,
          "secureConnection": true,
          "auth": {
            "user": "$user",
            "pass": "$pass"
          }
        }
    },
    "privacy": {
      "useUpdateCheck": false,
      "useGravatar": false
    }
  }
1 Like

I just checked that directories “mysql” and ghost’s “content” has different unknown users 100998 and 100999.
I changed this the ownership (PUID 1000) with e.g. sudo chown -R username:username ./mysql and for ghost content too. It didn’t fix the issue. The group GUID is correct.

Docker container and other directories ownership are set to user UID 1000. Docker is run by non-root user with UID 1000.

Permissions are set to w+r for user and group

I added PUID: 1000 and GUID: 1000 env to docker-compose mysql and ghost. Problem persists.