Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: cannot read image #167

Open
1 task done
CodingEmil opened this issue May 23, 2024 · 4 comments
Open
1 task done

Error: cannot read image #167

CodingEmil opened this issue May 23, 2024 · 4 comments
Labels
Status: Created The issue has been created but not yet assigned or addressed. Type: Bug Something isn't working

Comments

@CodingEmil
Copy link
Contributor

Avoid duplicated bug reports

  • I've found a bug and checked that there are no open or closed bug report related to this.

Description

After creating a custom Plant and adding an image everything works like it's supposed to, I can even see the image. If I want to edit the entry of this plant I'll get an error message:
server-1 | 2024-05-23T22:14:17.979Z ERROR 23 --- [io-8080-exec-10] .g.m.p.i.s.FileSystemImageStorageService : Error while reading image fee1ef14-2ded-45de-b78c-dbc139521870 permission deny
The image isn't shown anymore and I cant edit/delete the entry.

Local environment

No response

@CodingEmil CodingEmil added Status: Created The issue has been created but not yet assigned or addressed. Type: Bug Something isn't working labels May 23, 2024
@MDeLuise
Copy link
Owner

Hi @CodingEmil,
This seems to be a problem of permissions for the upload-dir folder you're using.

Do you use a docer-compose.yml like this?

  server:
    image: msdeluise/plant-it-server:latest
    env_file: server.env
    depends_on:
      - db
      - cache
    restart: unless-stopped
    volumes:
      - "./upload-dir:/upload-dir"
      - "./certs:/certificates"
    ports:
      - "8080:8080"
      - "3000:3000"

  db:
    image: mysql:8.0
    restart: always
    env_file: server.env
    volumes:
      - "./db:/var/lib/mysql"

  cache:
    image: redis:7.2.1
    restart: always

Specifically the line - "./upload-dir:/upload-dir".
If so, do you have read and write access to the ./upload-dir repository?

@CodingEmil
Copy link
Contributor Author

Hi @MDeLuise,
yes, I am using the default docker-compose.yml file. It seems more like a Linux/docker problem...
Not quite sure what/whom to give permission, I haven't adjusted any permissions. My setup:
Running docker on a container inside Proxmox. Did not create any other users.
Could you tell me your setup? Did you setup any other users?

@CodingEmil
Copy link
Contributor Author

CodingEmil commented May 24, 2024

I created a new container doing all those steps:
mkdir plantit && cd plantit
nano docker-compose.yml

version: "3"
name: plant-it
services:
  server:
    image: msdeluise/plant-it-server:latest
    env_file: server.env
    depends_on:
      - db
      - cache
    restart: unless-stopped
    volumes:
      - "./upload-dir:/upload-dir"
      - "./certs:/certificates"
    ports:
      - "8080:8080"
      - "3000:3000"

  db:
    image: mysql:8.0
    restart: always
    env_file: server.env
    volumes:
      - "./db:/var/lib/mysql"

  cache:
    image: redis:7.2.1
    restart: always

nano server.env

#
# DB
#
MYSQL_HOST=db
MYSQL_PORT=3306
MYSQL_USERNAME=root
MYSQL_PSW=root
MYSQL_DATABASE=bootdb
MYSQL_ROOT_PASSWORD=root

#
# JWT
#
JWT_SECRET=putTheSecretHere
JWT_EXP=1

#
# Server config
#
USERS_LIMIT=2 ##ONLY LINE CHANGED
UPLOAD_DIR=/upload-dir
API_PORT=8080
TREFLE_KEY=
LOG_LEVEL=DEBUG
ALLOWED_ORIGINS=*

#
# Cache
#
CACHE_TTL=86400
CACHE_HOST=cache
CACHE_PORT=6379

#
# SSL
#
SSL_ENABLED=false
CERTIFICATE_PATH=/certificates/

docker compose up -d

Then I am creating a new Plant, adding a picture, everything works so far. If I edit the plant (change title for example) I'll get the same error message. I am talking about the picture of the species, not a single plant.
Any advice?

@MDeLuise
Copy link
Owner

Hi there! I'm currently reviewing some older issues, and I wanted to check if this issue is still affecting you. With the latest release of the project (0.9.0), which includes numerous dependency updates and bug fixes, there's a chance the problem might have been resolved.

Could you please confirm whether you're still experiencing this issue on the latest version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Created The issue has been created but not yet assigned or addressed. Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants