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

migration failed with error: Cannot read properties of undefined (reading 'id') #784

Closed
belidzs opened this issue Jan 9, 2025 · 2 comments

Comments

@belidzs
Copy link

belidzs commented Jan 9, 2025

When I try to upgrade from v2.7.4 to v3.0.1, I receive the following error, then the service stops:

> [email protected] migrate
> knex migrate:latest

migration file "20241223103044_visits_user_id.js" failed
migration failed with error: Cannot read properties of undefined (reading 'id')
Cannot read properties of undefined (reading 'id')
TypeError: Cannot read properties of undefined (reading 'id')
    at Object.up (/kutt/server/migrations/20241223103044_visits_user_id.js:28:41)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Migrator._runBatch (/kutt/node_modules/knex/lib/migrations/migrate/Migrator.js:382:19)
npm notice
npm notice New major version of npm available! 10.9.2 -> 11.0.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.0.0
npm notice To update run: npm install -g [email protected]
npm notice

I'm using PostgreSQL and the application is running as a docker image inside a kubernetes cluster

@poeti8
Copy link
Member

poeti8 commented Jan 9, 2025

Please pull version 3.0.2. This should be fixed now.

@belidzs
Copy link
Author

belidzs commented Jan 9, 2025

This did the trick, thank you for the quick fix

@belidzs belidzs closed this as completed Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants