FredrikNoren / ungit

The easiest way to use git. On any platform. Anywhere.
MIT License
10.45k stars 638 forks source link

ungit exits at startup on ubuntu 14.04 #901

Closed ghost closed 7 years ago

ghost commented 7 years ago

ubuntu 14.04 node v4.8.2 npm 2.15.11 ungit 1.1.14

Latest version of ungit fails to launch correctly:

developer@devMachine:~$ ungit
Setting log level to warn
Browse to http://localhost:8448/#/repository?path=%2Fhome%2Fdeveloper
Took 1478ms to start server.
## Ungit started ##
2017-04-06T07:48:53.692Z - error: Stop at reading ~/.ungitrc because SyntaxError: Unexpected end of input
Setting log level to warn
## Ungit started ##
2017-04-06T07:48:55.175Z - error: Stop at reading ~/.ungitrc because SyntaxError: Unexpected end of input
Stopped keeping ungit alive
Exit: killed children
developer@devMachine:~$

Are there any logs for me to look at to debug the issue?

Installation of version 1.1.14 shows warnings as follows:

developer@devMachine:~$ sudo -H npm install -g ungit
npm WARN engine forever-monitor@1.1.0: wanted: {"node":"0.8.x"} (current: {"node":"4.8.2","npm":"2.15.11"})
npm WARN deprecated minimatch@0.0.5: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"4.8.2","npm":"2.15.11"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"4.8.2","npm":"2.15.11"})
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"4.8.2","npm":"2.15.11"})
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"4.8.2","npm":"2.15.11"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"4.8.2","npm":"2.15.11"})
/usr/bin/0ungit-credentials-helper -> /usr/lib/node_modules/ungit/bin/credentials-helper
/usr/bin/ungit -> /usr/lib/node_modules/ungit/bin/ungit
ungit@1.1.14 /usr/lib/node_modules/ungit
├── os-homedir@1.0.2
├── ignore@3.2.6
├── blueimp-md5@2.6.0
├── semver@5.3.0
├── open@0.0.5
├── crossroads@0.12.2
├── knockout@3.4.2
├── signals@1.0.0
├── cookie-parser@1.4.3 (cookie-signature@1.0.6, cookie@0.3.1)
├── node-cache@4.1.1 (clone@2.1.1)
├── passport-local@1.0.0 (passport-strategy@1.0.0)
├── passport@0.3.2 (pause@0.0.1, passport-strategy@1.0.0)
├── keen.io@0.1.3 (underscore@1.5.2)
├── temp@0.8.3 (os-tmpdir@1.0.2, rimraf@2.2.8)
├── rc@1.2.1 (ini@1.3.4, strip-json-comments@2.0.1, deep-extend@0.4.1, minimist@1.2.0)
├── getmac@1.2.1 (extract-opts@3.3.1)
├── mkdirp@0.5.1 (minimist@0.0.8)
├── express-session@1.15.2 (utils-merge@1.0.0, cookie-signature@1.0.6, on-headers@1.0.1, parseurl@1.3.1, cookie@0.3.1, depd@1.1.0, crc@3.4.4, uid-safe@2.1.4, debug@2.6.3)
├── serve-static@1.12.1 (escape-html@1.0.3, encodeurl@1.0.1, parseurl@1.3.1, send@0.15.1)
├── bluebird@3.4.7
├── color@1.0.3 (color-convert@1.9.0, color-string@1.5.2)
├── body-parser@1.15.2 (content-type@1.0.2, bytes@2.4.0, depd@1.1.0, qs@6.2.0, on-finished@2.3.0, http-errors@1.5.1, raw-body@2.1.7, debug@2.2.0, iconv-lite@0.4.13, type-is@1.6.15)
├── winston@2.3.1 (cycle@1.0.3, stack-trace@0.0.9, eyes@0.1.8, isstream@0.1.2, async@1.0.0, colors@1.0.3)
├── rimraf@2.6.1 (glob@7.1.1)
├── express@4.15.2 (setprototypeof@1.0.3, escape-html@1.0.3, array-flatten@1.1.1, cookie-signature@1.0.6, utils-merge@1.0.0, content-type@1.0.2, encodeurl@1.0.1, methods@1.1.2, merge-descriptors@1.0.1, parseurl@1.3.1, range-parser@1.2.0, fresh@0.5.0, path-to-regexp@0.1.7, etag@1.8.0, vary@1.1.1, content-disposition@0.5.2, cookie@0.3.1, statuses@1.3.1, depd@1.1.0, on-finished@2.3.0, qs@6.4.0, proxy-addr@1.1.4, debug@2.6.1, send@0.15.1, type-is@1.6.15, accepts@1.3.3, finalhandler@1.0.1)
├── raven@1.2.0 (cookie@0.3.1, lsmod@1.0.0, stack-trace@0.0.9, json-stringify-safe@5.0.1, uuid@3.0.0)
├── superagent@0.21.0 (extend@1.2.1, cookiejar@2.0.1, methods@1.0.1, mime@1.2.11, component-emitter@1.1.2, reduce-component@1.0.1, qs@1.2.0, debug@2.6.3, readable-stream@1.0.27-1, form-data@0.1.3, formidable@1.0.14)
├── async@2.1.5
├── socket.io@1.7.3 (object-assign@4.1.0, socket.io-adapter@0.5.0, has-binary@0.1.7, debug@2.3.3, socket.io-parser@2.3.1, engine.io@1.8.3, socket.io-client@1.7.3)
├── yargs@7.0.2 (get-caller-file@1.0.2, which-module@1.0.0, decamelize@1.2.0, camelcase@3.0.0, y18n@3.2.1, set-blocking@2.0.0, yargs-parser@5.0.0, require-main-filename@1.0.1, require-directory@2.1.1, string-width@1.0.2, cliui@3.2.0, os-locale@1.4.0, read-pkg-up@1.0.1)
├── octicons@3.5.0
├── hasher@1.2.0
├── snapsvg@0.5.1 (eve@0.5.3)
├── diff2html@2.3.0 (whatwg-fetch@2.0.3, diff@3.2.0, hogan.js@3.0.2)
├── npm-registry-client@8.1.0 (graceful-fs@4.1.11, slide@1.1.6, once@1.4.0, retry@0.10.1, npm-package-arg@4.2.1, concat-stream@1.6.0, npmlog@4.0.2, normalize-package-data@2.3.6, request@2.81.0)
├── forever-monitor@1.1.0 (watch@0.5.1, pkginfo@0.4.0, minimatch@0.0.5, utile@0.1.7, ps-tree@0.0.3, broadway@0.2.10)
├── moment@2.18.1
├── lodash@4.17.4
└── npm@4.5.0
developer@devMachine:~$
campersau commented 7 years ago

Can you please share the contents of your ~/.ungitrc file?

ghost commented 7 years ago

my ~/.ungitrc is currently a blank - it consists of two empty lines

I have since deleted the file and ungit 1.1.14 launches correctly.

I can recreate the issue when launching ungit after calling:

developer@devMachine:~$ touch ~/.ungitrc

bes-internal commented 7 years ago

Yes, now ungit expects ~/.ungitrc syntactically correct JSON. A minimally correct JSON is:

{}

I think it's #wontfix

ghost commented 7 years ago

@bes-internal - I can confirm that using the minimal JSON allows ungit to launch without issue.

for now I have just removed the ~/.ungitrc file as I use command-line options to launch ungit.

I think this issue can be closed now

jung-kim commented 7 years ago

Wow I would imagine this is kind of stuff that would be handled at at the rc file import, we may have to add "is file exist", and "is file valid Json" check for .ungitrc file before we import it...

bes-internal commented 7 years ago

@codingtwinky Yes, but look at the line (server.js:310) that confused me