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

Fix DAOFactory usage in the migration command #2238

Merged
merged 1 commit into from
Mar 24, 2017
Merged

Fix DAOFactory usage in the migration command #2238

merged 1 commit into from
Mar 24, 2017

Conversation

grantcarver
Copy link
Contributor

Note: new features are to be opened against next, hotfixes against master.

Summary

Migrations will fail during the upgrade process to 0.10.0 with the following error:

Error: 
/usr/local/share/lua/5.1/kong/dao/dao.lua:80: attempt to index field 'TYPES' (a nil value)
stack traceback:
        /usr/local/share/lua/5.1/kong/dao/dao.lua:80: in function 'event'
        /usr/local/share/lua/5.1/kong/dao/dao.lua:302: in function 'update'
        /usr/local/share/lua/5.1/kong/dao/migrations/postgres.lua:359: in function 'up'
        /usr/local/share/lua/5.1/kong/dao/factory.lua:232: in function 'migrate'
        /usr/local/share/lua/5.1/kong/dao/factory.lua:288: in function 'run_migrations'
        /usr/local/share/lua/5.1/kong/cmd/migrations.lua:34: in function 'cmd_exec'
        /usr/local/share/lua/5.1/kong/cmd/init.lua:88: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:88>
        [C]: in function 'xpcall'
        /usr/local/share/lua/5.1/kong/cmd/init.lua:88: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:45>
        /usr/local/bin/kong:5: in function 'file_gen'
        init_worker_by_lua:41: in function <init_worker_by_lua:39>
        [C]: in function 'pcall'
        init_worker_by_lua:48: in function <init_worker_by_lua:46>

This is due to the plugins config being passed in as the second argument to the factory instantiation causing it to think there is an event_handler. The DAOFactory parameters were changed a year ago.

Full changelog

  • Removed the old parameter which allowed the migration command to succeed.

Issues resolved

Fix #XXX

@thibaultcha
Copy link
Member

Thank you!

@thibaultcha thibaultcha merged commit 6a420ec into Kong:master Mar 24, 2017
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

Successfully merging this pull request may close these issues.

2 participants