{"action":"created","issue":{"url":"https://api.github.com/repos/Kong/kong/issues/3394","repository_url":"https://api.github.com/repos/Kong/kong","labels_url":"https://api.github.com/repos/Kong/kong/issues/3394/labels{/name}","comments_url":"https://api.github.com/repos/Kong/kong/issues/3394/comments","events_url":"https://api.github.com/repos/Kong/kong/issues/3394/events","html_url":"https://github.com/Kong/kong/issues/3394","id":314194218,"number":3394,"title":"plugins migration not run for custom plugins installed outside kong's default installation path","user":{"login":"ms5838","id":11638041,"avatar_url":"https://avatars2.githubusercontent.com/u/11638041?v=4","gravatar_id":"","url":"https://api.github.com/users/ms5838","html_url":"https://github.com/ms5838","followers_url":"https://api.github.com/users/ms5838/followers","following_url":"https://api.github.com/users/ms5838/following{/other_user}","gists_url":"https://api.github.com/users/ms5838/gists{/gist_id}","starred_url":"https://api.github.com/users/ms5838/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ms5838/subscriptions","organizations_url":"https://api.github.com/users/ms5838/orgs","repos_url":"https://api.github.com/users/ms5838/repos","events_url":"https://api.github.com/users/ms5838/events{/privacy}","received_events_url":"https://api.github.com/users/ms5838/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-13T17:43:12Z","updated_at":"2018-04-15T18:45:12Z","closed_at":null,"author_association":"NONE","body":"### Summary\r\nMigrations up does not recognize and execute the \"up\" command for a new custom plugin that uses DAO and is being installed in external folder location. The same plugin if installed in Kong's default installation path works fine.\r\n\r\nI see a related old issue but it seems the issue was fixed 0.9. We are using 0.11.2 and experiencing this behavior with that version\r\n\r\nOld similar issue: https://github.com/Kong/kong/issues/1708 \r\n\r\n### Steps To Reproduce\r\n\r\n1. Create a custom plugin that uses DAO and install it in a folder external to Kong's default installation.\r\n    example: /home/janedoe/kong/plugins/myplugin\r\n2. Add the plugin name to custom_plugins setting in kong.conf\r\n3. Add path to external folder to lua_package_path in kong.conf\r\n    example: lua_package_path = /home/janedoe/?.lua;;\r\n4. Restart kong to see that it gives \"Please run `kong migrations up` to update/initialize the database schema.\" error.\r\n5. Run \"kong migrations up\"\r\n6. kong migrations up finishes without error, but there's no migration that gets executed for the custom plugin. There are no errors in error.log\r\n7. Try to start kong again and see kong complains with \"Please run `kong migrations up` to update/initialize the database schema.\" error.\r\n\r\nWorkaround: install the custom plugin in kong's default installation folder kong/luarocks/share/lua/5.1/kong/plugins\r\nWe need the ability to put the custom plugins in external folder and hence workaround is not feasible.\r\n\r\nAm I missing anything? or did the issue reported in the older version resurfaced back again in 0.11.2?\r\n\r\n### Additional Details & Logs\r\n\r\n- Kong version 0.11.2\r\n- Kong error logs: No errors in error.log\r\n- Operating System: Linux xxxxxxxx 2.6.32-696.10.3.el6.x86_64 #1 SMP Thu Sep 21 12:12:50 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux\r\n"},"comment":{"url":"https://api.github.com/repos/Kong/kong/issues/comments/381428565","html_url":"https://github.com/Kong/kong/issues/3394#issuecomment-381428565","issue_url":"https://api.github.com/repos/Kong/kong/issues/3394","id":381428565,"user":{"login":"ms5838","id":11638041,"avatar_url":"https://avatars2.githubusercontent.com/u/11638041?v=4","gravatar_id":"","url":"https://api.github.com/users/ms5838","html_url":"https://github.com/ms5838","followers_url":"https://api.github.com/users/ms5838/followers","following_url":"https://api.github.com/users/ms5838/following{/other_user}","gists_url":"https://api.github.com/users/ms5838/gists{/gist_id}","starred_url":"https://api.github.com/users/ms5838/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ms5838/subscriptions","organizations_url":"https://api.github.com/users/ms5838/orgs","repos_url":"https://api.github.com/users/ms5838/repos","events_url":"https://api.github.com/users/ms5838/events{/privacy}","received_events_url":"https://api.github.com/users/ms5838/received_events","type":"User","site_admin":false},"created_at":"2018-04-15T18:45:12Z","updated_at":"2018-04-15T18:45:12Z","author_association":"NONE","body":"@thibaultcha Thanks for the immediate response, really appreciate it. \r\n\r\nThis worked, but I had to perform one additional step. \r\n\r\nIf I just commented the lua_package_path in kong.conf and exported LUA_PATH as you mentioned, it started giving me this error:\r\n./kong:3: module 'luarocks.loader' not found:\r\n\r\nThe shell from which I am executing kong migrations up never had LUA_PATH set, even before. It appears luarocks internally creates LUA_PATH if it is not already set in the shell.\r\n\r\nSo the additional step I had to perform was to get the current LUA_PATH that's set internally by running \"luarocks path\" command and then take the result of that, and append my custom login plugin path to it and then export that LUA_PATH to get this to work.\r\n\r\nYou mentioned this as a short term solution. Will this be addressed in the longer term to reference lua_package_path in CLI as well? Thanks!"}}
{"actor":{"display_login":"ms5838"}}