[TIMOB-13908] CLI: If the analytics config files in .titanium are not writable, the CLI crashes
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-06-05T20:55:21.000+0000 |
Affected Version/s | Release 3.1.0 |
Fix Version/s | 2013 Sprint 12 JS, 2013 Sprint 12, Release 3.2.0 |
Components | CLI |
Labels | qe-closed-3.2.0 |
Reporter | Bryan Hughes |
Assignee | Chris Barber |
Created | 2013-05-17T21:39:34.000+0000 |
Updated | 2013-12-13T19:53:48.000+0000 |
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:
sudo chown root:admin ~/.titanium/analytics.json ~/.titanium/analytics_session.json
PR: https://github.com/appcelerator/node-appc/pull/44 3_1_X: https://github.com/appcelerator/node-appc/pull/45
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:
I am using CLI 3.1.1 alpha
Not required for 3.1.1, since normal usage is not likely to uncover this bug. Moving to 3.2.0.
To test:
*Test analytics not working:*
*Result:* You should not see an exception dump *Check analytics.json is not writable*
*Result:*
*Reset analytics.json owner*
*Check analytics_session.json is not writable*
*Result:*
*Reset analytics_session.json owner*
*Check warnings are off*
*Result:* No warning message since both analytics files are now writable. *Check config file is not writable*
*Result:*
*Reset config.json owner*
*Check warnings are off*
*Result:* user.age saved *Verify again:*
*Result:* 21 *Check auth_session.json not writable*
*Result:*
*Reset auth_session.json owner*
*Logout*
*Result:* Logged out successfully *Change auth_session.json owner to root*
*Login*
*Result*
*Reset auth_session.json owner*
*Login*
*Result:* Logged in successfully
Node-appc master pull request: https://github.com/appcelerator/node-appc/pull/48 Titanium master pull request: https://github.com/appcelerator/titanium/pull/42
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).
Verified fixed on: Mac OSX 10.9 Mavericks Titanium SDK, build: 3.2.0.v20131212122847 CLI: 3.2.0-cr Ran testcases provided in comments. All worked as expected. Closing.