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

Homarr not working after upgrade #1623

Closed
4 tasks done
doctorniz opened this issue Nov 13, 2023 · 19 comments
Closed
4 tasks done

Homarr not working after upgrade #1623

doctorniz opened this issue Nov 13, 2023 · 19 comments
Labels
🐛 Bug Something isn't working

Comments

@doctorniz
Copy link

Environment

Docker

Version

No response

Describe the problem

Upgraded homarr as usual and I get an error message
-> An unexpected error has occurred
-> Detailed error information: type client side

The logs

My docker-compose
services: homarr: container_name: homarr image: ghcr.io/ajnart/homarr:latest restart: unless-stopped volumes: - /configs/homar/configs:/app/data/configs - /configs/homar/icons:/app/public/icons - /configs/homar/data:/data - /var/run/docker.sock:/var/run/docker.sock environment: - NEXTAUTH_URL=http://localhost:7575 ports: - '7575:7575'

What I have tried

  • deleted the homarr folder
  • used a different folder
  • tried env variable of nextauth_url above (and without)

None of the above works/brings about a new error message

Logs

} }, responseJSON: [ { error: { json: { message: 'no such table: user', code: -32603, data: { code: 'INTERNAL_SERVER_ERROR', httpStatus: 500, path: 'user.count', zodError: null } } } } ] }, shape: { message: 'no such table: user', code: -32603, data: { code: 'INTERNAL_SERVER_ERROR', httpStatus: 500, path: 'user.count', zodError: null } }, data: { code: 'INTERNAL_SERVER_ERROR', httpStatus: 500, path: 'user.count', zodError: null }, name: 'TRPCClientError' }, elapsedMs: 13 } Error [TRPCClientError]: no such table: user at TRPCClientError.from (file:///app/.next/server/src/middleware.js:1718:20) at <unknown> (file:///app/.next/server/src/middleware.js:2273:60) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

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
@doctorniz doctorniz added the 🐛 Bug Something isn't working label Nov 13, 2023
@timleeds15
Copy link

mine didnt work after upgrade either :( I had to delete the container and start from scratch.

@bchen290
Copy link

Just adding that I get that text file busy when trying to run the migration script on startup. Then it errors as above. Think this might be related to this? nodejs/docker-node#1912

@doctorniz
Copy link
Author

I can't even delete the container and start from scratch. I get the same error. I started a new stack (on Portainer).

OS is OMV. Machine is Intel x64.

@manuel-rw
Copy link
Collaborator

We are working on the text file being busy. 0.14.1 should release soon and fix many of the here mentioned issues. Please let us know if they were resolved in 0.14.1 or not.

@Meierschlumpf
Copy link
Collaborator

0.14.1 has been released, can you check if your issues are fixed?

@roziscoding
Copy link

I had to remove the Portainer stack and create a new one, but it did work.

@github-project-automation github-project-automation bot moved this to 🆕 New in Homarr Kanban Nov 15, 2023
@ajnart ajnart closed this as completed Nov 15, 2023
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Homarr Kanban Nov 15, 2023
@AnderssonPeter
Copy link

AnderssonPeter commented Nov 18, 2023

I tried to upgrade to 0.14.1 but I still get this error

},
  shape: {
  message: 'no such table: user',
  code: -32603,
  data: {
  code: 'INTERNAL_SERVER_ERROR',
  httpStatus: 500,
  path: 'user.count',
  zodError: null
}
},
  data: {
  code: 'INTERNAL_SERVER_ERROR',
  httpStatus: 500,
  path: 'user.count',
  zodError: null
},
  name: 'TRPCClientError'
},
  elapsedMs: 14
}
Error [TRPCClientError]: no such table: user
    at TRPCClientError.from (file:///app/.next/server/src/middleware.js:1718:20)
    at <unknown> (file:///app/.next/server/src/middleware.js:2273:60)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Tried to delete and recreate the container but that sadly didn't help

@ajnart
Copy link
Owner

ajnart commented Nov 18, 2023

I tried to upgrade to 0.14.1 but I still get this error

}, shape: { message: 'no such table: user', code: -32603, data: { code: 'INTERNAL_SERVER_ERROR', httpStatus: 500, path: 'user.count', zodError: null } }, data: { code: 'INTERNAL_SERVER_ERROR', httpStatus: 500, path: 'user.count', zodError: null }, name: 'TRPCClientError' }, elapsedMs: 14 } Error [TRPCClientError]: no such table: user at TRPCClientError.from (file:///app/.next/server/src/middleware.js:1718:20) at (file:///app/.next/server/src/middleware.js:2273:60) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Tried to delete and recreate the container but that sadly didn't help

Try to delete your database or try again. You can delete the mount point too if you want

@AnderssonPeter
Copy link

AnderssonPeter commented Nov 18, 2023

I tried to upgrade to 0.14.1 but I still get this error

}, shape: { message: 'no such table: user', code: -32603, data: { code: 'INTERNAL_SERVER_ERROR', httpStatus: 500, path: 'user.count', zodError: null } }, data: { code: 'INTERNAL_SERVER_ERROR', httpStatus: 500, path: 'user.count', zodError: null }, name: 'TRPCClientError' }, elapsedMs: 14 } Error [TRPCClientError]: no such table: user at TRPCClientError.from (file:///app/.next/server/src/middleware.js:1718:20) at (file:///app/.next/server/src/middleware.js:2273:60) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Tried to delete and recreate the container but that sadly didn't help

Try to delete your database or try again. You can delete the mount point too if you want

I don't think I have a database file where is it stored?

Edit: saw that there is a new mount point, I will test if that solves my issue.

@AnderssonPeter
Copy link

AnderssonPeter commented Nov 18, 2023

@ajnart I have now mapped the directory, and it created a db.sqlite file in it but it's size is 0 bytes?
And but sadly I still get the error.

Log:

Exporting hostname...
Migrating database...
yarn run v1.22.19
warning package.json: No license field
warning ../package.json: No license field
warning Skipping preferred cache folder "/usr/local/share/.cache/yarn" because it is not writable.
warning Skipping preferred cache folder "/tmp/.yarn-cache-0" because it is not writable.
warning Skipping preferred cache folder "/tmp/.yarn-cache" because it is not writable.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Yarn hasn't been able to find a cache folder it can use. Please use the explicit --cache-folder option to tell it what location to use, or make one of the preferred locations writable.
Starting production server...
Listening on port 7575 url: http://f601116074a0:7575
 << query  #1 user.count  {
  input: undefined,
  result:  [TRPCClientError: no such table: user] {
  meta: {
  response: Response {
  [Symbol(realm)]: { settingsObject: {} },
  [Symbol(state)]: {
  aborted: false,
  rangeRequested: false,
  timingAllowPassed: false,
  requestIncludesCredentials: false,
  type: 'default',
  status: 500,
  timingInfo: null,
  cacheState: '',
  statusText: 'Internal Server Error',
  headersList: HeadersList {
  cookies: [

],
  [Symbol(headers map)]: Map(8) {
  'connection' => { name: 'connection', value: 'close' },
  'content-encoding' => { name: 'content-encoding', value: 'gzip' },
  'content-type' => { name: 'content-type', value: 'application/json' },
  'date' => { name: 'date', value: 'Sat, 18 Nov 2023 11:49:34 GMT' },
  'keep-alive' => { name: 'keep-alive', value: 'timeout=5' },
  'set-cookie' => {
  name: 'set-cookie',

},
  'transfer-encoding' => { name: 'transfer-encoding', value: 'chunked' },
  'vary' => { name: 'vary', value: 'Accept-Encoding' }
},
  [Symbol(headers map sorted)]: null
},
  urlList: [],
  body: {
  stream: <ref *1> ReadableStream {
  _state: 'closed',
  _reader: ReadableStreamDefaultReader {
  _ownerReadableStream: [Circular *1],
  _closedPromise_resolve: undefined,
  _closedPromise_reject: undefined,
  _closedPromise: Promise {  },
  _readRequests: S {
  _cursor: 0,
  _size: 0,
  _front: { _elements: [], _next: undefined },
  _back: { _elements: [], _next: undefined }
}
},
  _storedError: undefined,
  _disturbed: true,
  _readableStreamController: ReadableStreamDefaultController {
  _controlledReadableStream: [Circular *1],
  _queue: S {
  _cursor: 0,
  _size: 0,
  _front: { _elements: [], _next: undefined },
  _back: { _elements: [], _next: undefined }
},
  _queueTotalSize: 0,
  _started: true,
  _closeRequested: true,
  _pullAgain: false,
  _pulling: true,
  _strategySizeAlgorithm: undefined,
  _strategyHWM: 0,
  _pullAlgorithm: undefined,
  _cancelAlgorithm: undefined
}
},
  source: null,
  length: null
}
},
  [Symbol(headers)]: Headers {
  [Symbol(headers list)]: HeadersList {
  cookies: [

],
  [Symbol(headers map)]: Map(8) {
  'connection' => { name: 'connection', value: 'close' },
  'content-encoding' => { name: 'content-encoding', value: 'gzip' },
  'content-type' => { name: 'content-type', value: 'application/json' },
  'date' => { name: 'date', value: 'Sat, 18 Nov 2023 11:49:34 GMT' },
  'keep-alive' => { name: 'keep-alive', value: 'timeout=5' },
  'set-cookie' => {
  name: 'set-cookie',

},
  'transfer-encoding' => { name: 'transfer-encoding', value: 'chunked' },
  'vary' => { name: 'vary', value: 'Accept-Encoding' }
},
  [Symbol(headers map sorted)]: null
},
  [Symbol(guard)]: 'response',
  [Symbol(realm)]: { settingsObject: {} }
}
},
  responseJSON: [
  {
  error: {
  json: {
  message: 'no such table: user',
  code: -32603,
  data: {
  code: 'INTERNAL_SERVER_ERROR',
  httpStatus: 500,
  path: 'user.count',
  zodError: null
}

@ajnart
Copy link
Owner

ajnart commented Nov 18, 2023

@ajnart I have now mapped the directory, and it created a db.sqlite file in it but it's size is 0 bytes?

And but sadly I still get the error.

Log:


Exporting hostname...

Migrating database...

yarn run v1.22.19

warning package.json: No license field

warning ../package.json: No license field

warning Skipping preferred cache folder "/usr/local/share/.cache/yarn" because it is not writable.

warning Skipping preferred cache folder "/tmp/.yarn-cache-0" because it is not writable.

warning Skipping preferred cache folder "/tmp/.yarn-cache" because it is not writable.

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

error Yarn hasn't been able to find a cache folder it can use. Please use the explicit --cache-folder option to tell it what location to use, or make one of the preferred locations writable.

Starting production server...

Listening on port 7575 url: http://f601116074a0:7575

 << query  #1 user.count  {

  input: undefined,

  result:  [TRPCClientError: no such table: user] {

  meta: {

  response: Response {

  [Symbol(realm)]: { settingsObject: {} },

  [Symbol(state)]: {

  aborted: false,

  rangeRequested: false,

  timingAllowPassed: false,

  requestIncludesCredentials: false,

  type: 'default',

  status: 500,

  timingInfo: null,

  cacheState: '',

  statusText: 'Internal Server Error',

  headersList: HeadersList {

  cookies: [



],

  [Symbol(headers map)]: Map(8) {

  'connection' => { name: 'connection', value: 'close' },

  'content-encoding' => { name: 'content-encoding', value: 'gzip' },

  'content-type' => { name: 'content-type', value: 'application/json' },

  'date' => { name: 'date', value: 'Sat, 18 Nov 2023 11:49:34 GMT' },

  'keep-alive' => { name: 'keep-alive', value: 'timeout=5' },

  'set-cookie' => {

  name: 'set-cookie',



},

  'transfer-encoding' => { name: 'transfer-encoding', value: 'chunked' },

  'vary' => { name: 'vary', value: 'Accept-Encoding' }

},

  [Symbol(headers map sorted)]: null

},

  urlList: [],

  body: {

  stream: <ref *1> ReadableStream {

  _state: 'closed',

  _reader: ReadableStreamDefaultReader {

  _ownerReadableStream: [Circular *1],

  _closedPromise_resolve: undefined,

  _closedPromise_reject: undefined,

  _closedPromise: Promise {  },

  _readRequests: S {

  _cursor: 0,

  _size: 0,

  _front: { _elements: [], _next: undefined },

  _back: { _elements: [], _next: undefined }

}

},

  _storedError: undefined,

  _disturbed: true,

  _readableStreamController: ReadableStreamDefaultController {

  _controlledReadableStream: [Circular *1],

  _queue: S {

  _cursor: 0,

  _size: 0,

  _front: { _elements: [], _next: undefined },

  _back: { _elements: [], _next: undefined }

},

  _queueTotalSize: 0,

  _started: true,

  _closeRequested: true,

  _pullAgain: false,

  _pulling: true,

  _strategySizeAlgorithm: undefined,

  _strategyHWM: 0,

  _pullAlgorithm: undefined,

  _cancelAlgorithm: undefined

}

},

  source: null,

  length: null

}

},

  [Symbol(headers)]: Headers {

  [Symbol(headers list)]: HeadersList {

  cookies: [



],

  [Symbol(headers map)]: Map(8) {

  'connection' => { name: 'connection', value: 'close' },

  'content-encoding' => { name: 'content-encoding', value: 'gzip' },

  'content-type' => { name: 'content-type', value: 'application/json' },

  'date' => { name: 'date', value: 'Sat, 18 Nov 2023 11:49:34 GMT' },

  'keep-alive' => { name: 'keep-alive', value: 'timeout=5' },

  'set-cookie' => {

  name: 'set-cookie',



},

  'transfer-encoding' => { name: 'transfer-encoding', value: 'chunked' },

  'vary' => { name: 'vary', value: 'Accept-Encoding' }

},

  [Symbol(headers map sorted)]: null

},

  [Symbol(guard)]: 'response',

  [Symbol(realm)]: { settingsObject: {} }

}

},

  responseJSON: [

  {

  error: {

  json: {

  message: 'no such table: user',

  code: -32603,

  data: {

  code: 'INTERNAL_SERVER_ERROR',

  httpStatus: 500,

  path: 'user.count',

  zodError: null

}

Your mountpoint is not writeable. Can you try with no mount point for the DB at all? It will create a docker volume automatically

@AnderssonPeter
Copy link

AnderssonPeter commented Nov 18, 2023

How can it create a file if its not writable? (I run my containers with the read_only flag, just for occasions like this, otherwise my backups would have missed this new file)

Looks like I had to add /tmp as a tmpfs to make it work as expected..

@jensneuhaus
Copy link

I had the same issue with the log output no such table: user as in #1623 (comment) when updating to 0.14.1 from a former version (a few months old).

I am using docker-compose and adding the following to my docker-compose file helped:

      - '/my_path/homarr/data:/data'

When the app starts up afterwards, it shows a nice message about the upate process but its too late in my case.

@ajnart
Copy link
Owner

ajnart commented Dec 6, 2023

I had the same issue with the log output no such table: user as in #1623 (comment) when updating to 0.14.1 from a former version (a few months old).

I am using docker-compose and adding the following to my docker-compose file helped:

      - '/my_path/homarr/data:/data'

When the app starts up afterwards, it shows a nice message about the upate process but its too late in my case.

This error does not happen in the latest version, you do not need to mount a db, but it is recommended

@jensneuhaus
Copy link

Well, it just happened for me. I updated to the latest Docker image and when starting up the container, it showed those errors.

PS: Nice update, thanks a lot for working on Homarr :)

@anonysoul
Copy link
Contributor

The problem lies in the fact that the database has not been initialized. The temporary solution is as follows:

# enter the docker container
docker exec -it <your_docker_container_id> /bin/bash

# grant executable permission to the script file
chmod +x /app/scripts/run.sh

# initialize the database
/app/scripts/run.sh

@himanshubabal
Copy link

Showing container as unhealthy
Getting the following error

docker exec -it homarr /bin/bash
root@b7027fdf7fdf:/app# chmod +x /app/scripts/run.sh
root@b7027fdf7fdf:/app# /app/scripts/run.sh
Exporting hostname...
Migrating database...
yarn run v1.22.19
$ ts-node ./migrate.ts
DrizzleError: Failed to run the query '
			CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (
				id SERIAL PRIMARY KEY,
				hash text NOT NULL,
				created_at numeric
			)
		': database is locked
    at Function.wrap (/app/migrate/node_modules/src/errors.ts:13:6)
    at BetterSQLiteSession.run (/app/migrate/node_modules/src/sqlite-core/session.ts:110:23)
    at SQLiteSyncDialect.migrate (/app/migrate/node_modules/src/sqlite-core/dialect.ts:629:11)
    at migrate (/app/migrate/node_modules/src/better-sqlite3/migrator.ts:10:13)
    at migrateDatabase (/app/migrate/migrate.ts:17:16)
    at Object.<anonymous> (/app/migrate/migrate.ts:20:1)
    at Module._compile (node:internal/modules/cjs/loader:1255:14)
    at Module.m._compile (/app/migrate/node_modules/ts-node/src/index.ts:1618:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
    at Object.require.extensions.<computed> [as .ts] (/app/migrate/node_modules/ts-node/src/index.ts:1621:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Starting production server...
node:events:489
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use :::7575
    at Server.setupListenHandle [as _listen2] (node:net:1823:16)
    at listenInCluster (node:net:1871:12)
    at Server.listen (node:net:1959:7)
    at /app/server.js:50:10
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted 'error' event on Server instance at:
    at emitErrorNT (node:net:1850:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'EADDRINUSE',
  errno: -98,
  syscall: 'listen',
  address: '::',
  port: 7575
}

Node.js v20.2.0

@manuel-rw
Copy link
Collaborator

Showing container as unhealthy Getting the following error

docker exec -it homarr /bin/bash
root@b7027fdf7fdf:/app# chmod +x /app/scripts/run.sh
root@b7027fdf7fdf:/app# /app/scripts/run.sh
Exporting hostname...
Migrating database...
yarn run v1.22.19
$ ts-node ./migrate.ts
DrizzleError: Failed to run the query '
			CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (
				id SERIAL PRIMARY KEY,
				hash text NOT NULL,
				created_at numeric
			)
		': database is locked
    at Function.wrap (/app/migrate/node_modules/src/errors.ts:13:6)
    at BetterSQLiteSession.run (/app/migrate/node_modules/src/sqlite-core/session.ts:110:23)
    at SQLiteSyncDialect.migrate (/app/migrate/node_modules/src/sqlite-core/dialect.ts:629:11)
    at migrate (/app/migrate/node_modules/src/better-sqlite3/migrator.ts:10:13)
    at migrateDatabase (/app/migrate/migrate.ts:17:16)
    at Object.<anonymous> (/app/migrate/migrate.ts:20:1)
    at Module._compile (node:internal/modules/cjs/loader:1255:14)
    at Module.m._compile (/app/migrate/node_modules/ts-node/src/index.ts:1618:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
    at Object.require.extensions.<computed> [as .ts] (/app/migrate/node_modules/ts-node/src/index.ts:1621:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Starting production server...
node:events:489
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use :::7575
    at Server.setupListenHandle [as _listen2] (node:net:1823:16)
    at listenInCluster (node:net:1871:12)
    at Server.listen (node:net:1959:7)
    at /app/server.js:50:10
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted 'error' event on Server instance at:
    at emitErrorNT (node:net:1850:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'EADDRINUSE',
  errno: -98,
  syscall: 'listen',
  address: '::',
  port: 7575
}

Node.js v20.2.0

Pretty self-explanitory. Error: listen EADDRINUSE: address already in use :::7575 you already have another Homarr instance running and binding the port. It also locks the DB and doesn't allow other instances to connect

@urukalo
Copy link

urukalo commented Sep 26, 2024

ignore that error, and restart the container after script execution in it

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
Archived in project
Development

No branches or pull requests