{"action":"created","issue":{"url":"https://api.github.com/repos/tomatpasser/gpio-buttons/issues/11","repository_url":"https://api.github.com/repos/tomatpasser/gpio-buttons","labels_url":"https://api.github.com/repos/tomatpasser/gpio-buttons/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/tomatpasser/gpio-buttons/issues/11/comments","events_url":"https://api.github.com/repos/tomatpasser/gpio-buttons/issues/11/events","html_url":"https://github.com/tomatpasser/gpio-buttons/issues/11","id":189464557,"number":11,"title":"Volumio restarts when editing button config","user":{"login":"macmpi","id":16296055,"avatar_url":"https://avatars.githubusercontent.com/u/16296055?v=3","gravatar_id":"","url":"https://api.github.com/users/macmpi","html_url":"https://github.com/macmpi","followers_url":"https://api.github.com/users/macmpi/followers","following_url":"https://api.github.com/users/macmpi/following{/other_user}","gists_url":"https://api.github.com/users/macmpi/gists{/gist_id}","starred_url":"https://api.github.com/users/macmpi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macmpi/subscriptions","organizations_url":"https://api.github.com/users/macmpi/orgs","repos_url":"https://api.github.com/users/macmpi/repos","events_url":"https://api.github.com/users/macmpi/events{/privacy}","received_events_url":"https://api.github.com/users/macmpi/received_events","type":"User","site_admin":false},"labels":[{"id":407809416,"url":"https://api.github.com/repos/tomatpasser/gpio-buttons/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-15T18:06:20Z","updated_at":"2016-11-16T06:23:15Z","closed_at":null,"body":"Hi,\r\n\r\nInstalled latest gpio-buttons on rpi0 running Volumio 2.016.\r\nWhen editing settings, Volumio fails and restarts, as per below:\r\n```\r\nNov 15 17:28:24 volumio volumio[1338]: info: [{\"prettyName\":\"GPIO Buttons\",\"name\":\"gpio-buttons\",\"category\":\"miscellanea\",\"version\":\"0.7.5\",\"icon\":\"fa fa-cube\",\"enabled\":true,\"active\":true},{\"prettyName\":\"Spotify\",\"name\":\"spop\",\"category\":\"music_service\",\"version\":\"1.2.0\",\"icon\":\"fa-spotify\",\"enabled\":false,\"active\":true},{\"prettyName\":\"Volumio Spotify Connect\",\"name\":\"volspotconnect\",\"category\":\"music_service\",\"version\":\"1.3.8\",\"icon\":\"fa-spotify\",\"enabled\":true,\"active\":true}]\r\nNov 15 17:29:54 volumio volumio[1338]: info: CoreCommandRouter::getUIConfigOnPlugin\r\nNov 15 17:29:54 volumio volumio[1338]: info: GPIO-Buttons: Getting UI config\r\nNov 15 17:29:54 volumio volumio[1338]: info: GPIO-Buttons: Empty config, loading defaults...\r\nNov 15 17:29:59 volumio volumio[1338]: info: CALLMETHOD: miscellanea gpio-buttons saveTriggers [object Object]\r\nNov 15 17:29:59 volumio volumio[1338]: info: CoreCommandRouter::executeOnPlugin: gpio-buttons , saveTriggers\r\nNov 15 17:29:59 volumio volumio[1338]: info: GPIO-Buttons: Applying config file...\r\nNov 15 17:29:59 volumio volumio[1338]: info: GPIO-Buttons: Play/pause on pin 2\r\nNov 15 17:30:00 volumio volumio[1338]: fs.js:640\r\nNov 15 17:30:00 volumio volumio[1338]: return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);\r\nNov 15 17:30:00 volumio volumio[1338]: ^\r\nNov 15 17:30:00 volumio volumio[1338]: Error: EACCES: permission denied, open '/data/configuration/miscellanea/gpio-buttons/config.json'\r\nNov 15 17:30:00 volumio volumio[1338]: at Error (native)\r\nNov 15 17:30:00 volumio volumio[1338]: at Object.fs.openSync (fs.js:640:18)\r\nNov 15 17:30:00 volumio volumio[1338]: at Object.fs.writeFileSync (fs.js:1333:33)\r\nNov 15 17:30:00 volumio volumio[1338]: at Object.writeFileSync (/data/plugins/miscellanea/gpio-buttons/node_modules/jsonfile/index.js:110:13)\r\nNov 15 17:30:00 volumio volumio[1338]: at GPIOButtons.setConf (/data/plugins/miscellanea/gpio-buttons/index.js:151:5)\r\nNov 15 17:30:00 volumio volumio[1338]: at GPIOButtons.saveTriggers (/data/plugins/miscellanea/gpio-buttons/index.js:208:7)\r\nNov 15 17:30:00 volumio volumio[1338]: at CoreCommandRouter.executeOnPlugin (/volumio/app/index.js:818:29)\r\nNov 15 17:30:00 volumio volumio[1338]: at Socket.<anonymous> (/volumio/app/plugins/user_interface/websocket/index.js:479:38)\r\nNov 15 17:30:00 volumio volumio[1338]: at emitTwo (events.js:106:13)\r\nNov 15 17:30:00 volumio volumio[1338]: at Socket.emit (events.js:191:7)\r\nNov 15 17:30:00 volumio mpd[609]: client: [2] closed\r\nNov 15 17:30:00 volumio systemd[1]: volumio.service: main process exited, code=exited, status=1/FAILURE\r\nNov 15 17:30:00 volumio systemd[1]: Unit volumio.service entered failed state.\r\nNov 15 17:30:00 volumio systemd[1]: Starting dynamicswap.service...\r\nNov 15 17:30:00 volumio systemd[1]: Started dynamicswap.service.\r\nNov 15 17:30:00 volumio volumio[1496]: 512 MB or less RAM Detected, need to enable swap\r\nNov 15 17:30:00 volumio volumio[1496]: Enabling Swap\r\nNov 15 17:30:00 volumio volumio[1496]: swapon: /data/swapfile: swapon failed: Device or resource busy\r\nNov 15 17:30:00 volumio systemd[1]: dynamicswap.service: main process exited, code=exited, status=255/n/a\r\nNov 15 17:30:00 volumio systemd[1]: Unit dynamicswap.service entered failed state.\r\nNov 15 17:30:00 volumio systemd[1]: volumio.service holdoff time over, scheduling restart.\r\nNov 15 17:30:00 volumio systemd[1]: Starting dynamicswap.service...\r\nNov 15 17:30:00 volumio systemd[1]: Started dynamicswap.service.\r\nNov 15 17:30:00 volumio systemd[1]: Stopping Volumio Backend Module...\r\nNov 15 17:30:00 volumio systemd[1]: Starting Volumio Backend Module...\r\nNov 15 17:30:00 volumio systemd[1]: Started Volumio Backend Module.\r\nNov 15 17:30:00 volumio volumio[1504]: 512 MB or less RAM Detected, need to enable swap\r\nNov 15 17:30:00 volumio volumio[1504]: Enabling Swap\r\nNov 15 17:30:00 volumio volumio[1504]: swapon: /data/swapfile: swapon failed: Device or resource busy\r\nNov 15 17:30:00 volumio systemd[1]: dynamicswap.service: main process exited, code=exited, status=255/n/a\r\nNov 15 17:30:00 volumio systemd[1]: Unit dynamicswap.service entered failed state.\r\nNov 15 17:30:09 volumio volumio[1505]: info: -------------------------------------------\r\nNov 15 17:30:09 volumio volumio[1505]: info: -----            Volumio2              ----\r\nNov 15 17:30:09 volumio volumio[1505]: info: -------------------------------------------\r\nNov 15 17:30:09 volumio volumio[1505]: info: -----          System startup          ----\r\nNov 15 17:30:09 volumio volumio[1505]: info: -------------------------------------------\r\n```\r\nThought config.json may not have proper rights as error message suggests, indeed:\r\n`-rwxr-xr-x  1 volumio volumio   796 Nov 15 17:11 config.json\r\n`\r\nbut chmoding it 777 did not fix the issue.\r\nThanks for any tip.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/tomatpasser/gpio-buttons/issues/comments/260864447","html_url":"https://github.com/tomatpasser/gpio-buttons/issues/11#issuecomment-260864447","issue_url":"https://api.github.com/repos/tomatpasser/gpio-buttons/issues/11","id":260864447,"user":{"login":"macmpi","id":16296055,"avatar_url":"https://avatars.githubusercontent.com/u/16296055?v=3","gravatar_id":"","url":"https://api.github.com/users/macmpi","html_url":"https://github.com/macmpi","followers_url":"https://api.github.com/users/macmpi/followers","following_url":"https://api.github.com/users/macmpi/following{/other_user}","gists_url":"https://api.github.com/users/macmpi/gists{/gist_id}","starred_url":"https://api.github.com/users/macmpi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macmpi/subscriptions","organizations_url":"https://api.github.com/users/macmpi/orgs","repos_url":"https://api.github.com/users/macmpi/repos","events_url":"https://api.github.com/users/macmpi/events{/privacy}","received_events_url":"https://api.github.com/users/macmpi/received_events","type":"User","site_admin":false},"created_at":"2016-11-16T06:23:15Z","updated_at":"2016-11-16T06:23:15Z","body":"Yes fixes it.\r\nI think if you had pre-existing config files, you would not see the bug, as they are not cleared with uninstall.\r\nIndeed, you may want to have an `uninstall.sh` that removes configuration folder on script uninstall for complete cleanup.\r\n"}}
{"actor":{"display_login":"macmpi"}}