{ "id": "114561", "key": "TIMOB-13908", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "15492", "description": "2013 Sprint 12 JS", "name": "2013 Sprint 12 JS", "archived": true, "released": true, "releaseDate": "2013-06-17" }, { "id": "15110", "description": "2013 Sprint 12", "name": "2013 Sprint 12", "archived": true, "released": true, "releaseDate": "2013-06-17" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-06-05T20:55:21.000+0000", "created": "2013-05-17T21:39:34.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "qe-closed-3.2.0" ], "versions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2013-12-13T19:53:48.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "13103", "name": "CLI", "description": "Node-based command line interface" } ], "description": "if ~/.titanium/analytics.json or ~/.titanium/analytics_session.json are not writable by the user that the node process is running under, the CLI crashes. In practice, these files are mode 644 by default (writable only by the owner), so running node as anything other than the user that installed the CLI will cause a crash. An easy way to replicate:\r\n\r\n{code}\r\nsudo chown root:admin ~/.titanium/analytics.json ~/.titanium/analytics_session.json\r\n{code}", "attachment": [], "flagged": false, "summary": "CLI: If the analytics config files in .titanium are not writable, the CLI crashes", "creator": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "252664", "author": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/node-appc/pull/44\n3_1_X: https://github.com/appcelerator/node-appc/pull/45", "updateAuthor": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-17T22:06:55.000+0000", "updated": "2013-05-17T22:06:55.000+0000" }, { "id": "254649", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "After setting permissions in the \"easy to replicate\" area of the description, I ran \"ti sdk\". This fails. I also tried \"ti create\" which failed as well, here is some output:\r\n\r\n{code}\r\n\r\nemerrimanMBP:.titanium emerriman$ \r\nfs.js:338\r\n return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);\r\n ^\r\nError: EACCES, permission denied '/Users/emerriman/.titanium/analytics_session.json'\r\n at Object.fs.openSync (fs.js:338:18)\r\n at Object.fs.writeFileSync (fs.js:756:15)\r\n at /usr/local/lib/node_modules/titanium/node_modules/node-appc/lib/analytics.js:140:7\r\n at async.parallel (/usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:476:17)\r\n at async.forEach (/usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:94:25)\r\n at async.parallel (/usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:473:21)\r\n at process.on.async.parallel.osinfo (/usr/local/lib/node_modules/titanium/node_modules/node-appc/lib/analytics.js:56:5)\r\n at module.exports.getOSInfo (/usr/local/lib/node_modules/titanium/node_modules/node-appc/lib/environ.js:215:4)\r\n at ChildProcess.exithandler (child_process.js:538:7)\r\n at ChildProcess.EventEmitter.emit (events.js:99:17)\r\n\r\n{code}\r\n\r\nI am using CLI 3.1.1 alpha", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-29T21:06:15.000+0000", "updated": "2013-05-29T21:08:41.000+0000" }, { "id": "255005", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Not required for 3.1.1, since normal usage is not likely to uncover this bug. Moving to 3.2.0.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-30T22:53:52.000+0000", "updated": "2013-05-30T22:53:52.000+0000" }, { "id": "256029", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "To test:\n\n{code}\nsudo chown root:admin ~/.titanium/analytics.json ~/.titanium/analytics_session.json ~/.titanium/config.json ~/.titanium/auth_session.json\n{code}\n\n*Test analytics not working:*\n{code}\ntitanium sdk\n{code}\n*Result:*\nYou should not see an exception dump\n\n*Check analytics.json is not writable*\n{code}\ntitanium\n{code}\n*Result:*\n{code}\n\nRequired file ~/.titanium/analytics.json is not writable.\nPlease ensure the Titanium CLI has access to modify this file.\n\n{code}\n\n*Reset analytics.json owner*\n{code}\nsudo chown `whoami`:staff ~/.titanium/analytics.json\n{code}\n\n*Check analytics_session.json is not writable*\n{code}\ntitanium\n{code}\n*Result:*\n{code}\n\nRequired file ~/.titanium/analytics_session.json is not writable.\nPlease ensure the Titanium CLI has access to modify this file.\n\n{code}\n\n*Reset analytics_session.json owner*\n{code}\nsudo chown `whoami`:staff ~/.titanium/analytics_session.json\n{code}\n\n*Check warnings are off*\n{code}\ntitanium\n{code}\n*Result:*\nNo warning message since both analytics files are now writable.\n\n*Check config file is not writable*\n{code}\ntitanium config user.age 21\n{code}\n*Result:*\n{code}\n[ERROR] Unable to write config file /Users/chris/.titanium/config.json\n[ERROR] Please ensure the Titanium CLI has access to modify this file.\n{code}\n\n*Reset config.json owner*\n{code}\nsudo chown `whoami`:staff ~/.titanium/config.json\n{code}\n\n*Check warnings are off*\n{code}\ntitanium config user.age 21\n{code}\n*Result:*\nuser.age saved\n\n*Verify again:*\n{code}\ntitanium config user.age\n{code}\n*Result:*\n21\n\n*Check auth_session.json not writable*\n{code}\ntitanium logout\n{code}\n*Result:*\n{code}\n[ERROR] Session file \"/Users/chris/.titanium/auth_session.json\" is not writable\n[ERROR] Please ensure the Titanium CLI has access to modify this file.\n[ERROR] You are still logged in\n{code}\n\n*Reset auth_session.json owner*\n{code}\nsudo chown `whoami`:staff ~/.titanium/auth_session.json\n{code}\n\n*Logout*\n{code}\ntitanium logout\n{code}\n*Result:*\nLogged out successfully\n\n*Change auth_session.json owner to root*\n{code}\nsudo chown root:admin ~/.titanium/auth_session.json\n{code}\n\n*Login*\n{code}\ntitanium login\n{code}\n*Result*\n{code}\n[ERROR] Session file \"/Users/chris/.titanium/auth_session.json\" is not writable\n[ERROR] Please ensure the Titanium CLI has access to modify this file.\n[ERROR] You are currently logged out\n{code}\n\n*Reset auth_session.json owner*\n{code}\nsudo chown `whoami`:staff ~/.titanium/auth_session.json\n{code}\n\n*Login*\n{code}\ntitanium login\n{code}\n*Result:*\nLogged in successfully", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2013-06-05T00:41:26.000+0000", "updated": "2013-06-05T00:41:26.000+0000" }, { "id": "256031", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Node-appc master pull request: https://github.com/appcelerator/node-appc/pull/48\nTitanium master pull request: https://github.com/appcelerator/titanium/pull/42", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2013-06-05T01:04:52.000+0000", "updated": "2013-06-05T01:04:52.000+0000" }, { "id": "256252", "author": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Note: the exact errors/messages I got were slightly different at times that the test instructions indicated, but everything worked as I would expect it too (probably due to what analytics were queued up, if any).", "updateAuthor": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-05T20:55:21.000+0000", "updated": "2013-06-05T20:55:21.000+0000" }, { "id": "284248", "author": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed on:\nMac OSX 10.9 Mavericks\nTitanium SDK, build: 3.2.0.v20131212122847\nCLI: 3.2.0-cr\n\nRan testcases provided in comments. All worked as expected.\nClosing.", "updateAuthor": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-13T19:53:27.000+0000", "updated": "2013-12-13T19:53:27.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }