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

Switched from SQLite to MySQL (Maria) and now crashes #2274

Closed
4 tasks done
YouveGotMeowxy opened this issue Feb 10, 2025 · 2 comments
Closed
4 tasks done

Switched from SQLite to MySQL (Maria) and now crashes #2274

YouveGotMeowxy opened this issue Feb 10, 2025 · 2 comments
Labels
🐛 Bug Something isn't working

Comments

@YouveGotMeowxy
Copy link

YouveGotMeowxy commented Feb 10, 2025

Environment

Docker

Version

latest as of this post

Describe the problem

Per the title, fresh default install (sqlite) seemingly went fine (no errors); switched to MariaDB, and the log now looks like this:

Image

Also, when navigating to any other page, I get this:

 Error [TRPCError]: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(select json_array(`groupMembers_group`.`id`, `groupMembers_group`.`name`, `g...' at line 1
    at E.query (.next/server/chunks/5143.js:164:51965)
    at I.execute (.next/server/chunks/5143.js:170:27462)
    at QueryPromise.execute (.next/server/chunks/5143.js:164:121934)
    at QueryPromise.then (.next/server/chunks/5143.js:170:55294) {
  code: 'INTERNAL_SERVER_ERROR',
  digest: '140570336',
  [cause]: Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(select json_array(`groupMembers_group`.`id`, `groupMembers_group`.`name`, `g...' at line 1
      at E.query (.next/server/chunks/5143.js:164:51965)
      at I.execute (.next/server/chunks/5143.js:170:27462)
      at QueryPromise.execute (.next/server/chunks/5143.js:164:121934)
      at QueryPromise.then (.next/server/chunks/5143.js:170:55294) {
    code: 'ER_PARSE_ERROR',
    errno: 1064,
    sql: "select `groupMembers`.`group_id`, `groupMembers`.`user_id`, `groupMembers_group`.`data` as `group` from `groupMember` `groupMembers` left join lateral (select json_array(`groupMembers_group`.`id`, `groupMembers_group`.`name`, `groupMembers_group`.`owner_id`, `groupMembers_group_boardPermissions`.`data`) as `data` from (select * from `group` `groupMembers_group` where `groupMembers_group`.`id` = `groupMembers`.`group_id` limit 1) `groupMembers_group` left join lateral (select coalesce(json_arrayagg(json_array(`groupMembers_group_boardPermissions`.`board_id`, `groupMembers_group_boardPermissions`.`group_id`, `groupMembers_group_boardPermissions`.`permission`)), json_array()) as `data` from `boardGroupPermission` `groupMembers_group_boardPermissions` where `groupMembers_group_boardPermissions`.`group_id` = `groupMembers_group`.`id`) `groupMembers_group_boardPermissions` on true) `groupMembers_group` on true where `groupMembers`.`user_id` = 'ziim6'",
    sqlState: '42000',
    sqlMessage: "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(select json_array(`groupMembers_group`.`id`, `groupMembers_group`.`name`, `g...' at line 1"
  }
}
2025-02-10T03:27:36.815Z info: ? Connection (1) 1006 
Killed
Container stopped

The initial db migrate did seem to populate the MySQL db, so it seems the connection itself shouldn't be the problem.

Running this in docker swarm, here is my Compose:

Expand
homarr:
  hostname: 'homarr'
  image: 'ghcr.io/homarr-labs/homarr:latest'
  environment:
    TZ: 'America/Chicago'
    DB_DRIVER: 'mysql2'
    DB_DIALECT: 'mysql'
    DB_HOST: 'mariadb'
    DB_PORT: '3306'
    DB_NAME: 'homarr'
    DB_USER: 'oc_homarr'
    DB_PASSWORD: '<redacted>'
    SECRET_ENCRYPTION_KEY: 'redacted'
  volumes:
    - '/opt/docker/configs/homarr/appdata:/appdata:rw'
    - '/var/run/docker.sock:/var/run/docker.sock'
  deploy:
    mode: 'global'
    labels:
      swag.uptime-kuma.enabled: "true"
      swag.uptime-kuma.monitor.name: "Homarr"
      swag.uptime-kuma.monitor.url: "https://homarr.mydomain.com"
      swag.uptime-kuma.monitor.description: "Server Managment"
      swag.uptime-kuma.monitor.parent: "HOMEPAGES"
      com.ouroboros.enable: 'true'
    resources:
      limits:
        memory: '200M'
    restart_policy:
      condition: 'any'
  networks:
    - 'mariadb'

Logs

No response

Context

No response

Please tick the boxes

  • I confirm that I attached the proper logs
  • I've read the docs
  • I've checked for duplicate issues
  • I've tried to debug myself
@YouveGotMeowxy YouveGotMeowxy added the 🐛 Bug Something isn't working label Feb 10, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in Homarr Kanban Feb 10, 2025
Copy link

Hi 👋. Thank you for submitting your first issue to Homarr. Please ensure that you've provided all nessesary information. You can use the three dots > Edit button to update your post with additional images and information. Depending on the current volume of requests, the team should get in conact with you shortly.

@manuel-rw
Copy link
Collaborator

Wrong repository, please post on homarr-labs/homarr for requests regarding 1.0

@manuel-rw manuel-rw closed this as not planned Won't fix, can't repro, duplicate, stale Feb 10, 2025
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Homarr Kanban Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
Status: ✅ Done
Development

No branches or pull requests

2 participants