Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when counting commits in multiple repos #47

Open
AndiDog opened this issue Apr 22, 2017 · 16 comments
Open

Crash when counting commits in multiple repos #47

AndiDog opened this issue Apr 22, 2017 · 16 comments
Labels
🚨 bug Something is broken 🙏 help wanted With a little help from my friends...

Comments

@AndiDog
Copy link

AndiDog commented Apr 22, 2017

Node Version: v7.2.1
tiny-core-terminal version: 1.0.8
Shell: bash
Terminal Program: iTerm2
Operating System: macOS

I have quite a few repos in ~/dev. The dashboard starts up, starts counting commits for a second and then crashes. Using TTC_REPOS=/single/repo works fine for the ones I tried. Didn't try very hard to debug into the blessed library since I don't know what the code is doing. What I can tell you that at that given code location in blessed (/usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/program.js:2543), we have part == "cpp" and val == "cpp".

Unsetting env vars other than TTC_REPOS doesn't make a difference.

$ set | grep TTC
TTC_APIKEYS=false
TTC_BOTS=tinycarebot,selfcare_bot
TTC_REPOS='~/dev'
TTC_WEATHER=Munich
$ tiny-care-terminal
TypeError: Cannot read property 'slice' of null
    at /usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/program.js:2543:35
    at Array.forEach (native)
    at Program._attr (/usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/program.js:2542:11)
    at Box.Element._parseTags (/usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/widgets/element.js:498:26)
    at Box.Element.parseContent (/usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/widgets/element.js:393:22)
    at Box.Element.render (/usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/widgets/element.js:1839:8)
    at /usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/widgets/screen.js:738:8
    at Array.forEach (native)
    at Screen.render (/usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/widgets/screen.js:735:17)
    at Socket.week.stdout.on.data (/usr/local/lib/node_modules/tiny-care-terminal/care.js:120:12)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at Pipe.onread (net.js:551:20)
@notwaldorf
Copy link
Owner

It looks like you only have 2 bots in TTC_BOTS -- i think that's where the slice is failing, maybe. Might adding a third?

@notwaldorf notwaldorf added the ⏳ pending-response What are you waiting for? Christmas? label Apr 22, 2017
@AndiDog
Copy link
Author

AndiDog commented Apr 23, 2017

I also tried with the default TTC_BOTS and an empty value. As mentioned, only the TTC_REPOS variable affects this issue.

@notwaldorf
Copy link
Owner

I really can't repro this, nor have heard of anyone else having problems in this way :(

@AndiDog
Copy link
Author

AndiDog commented Apr 27, 2017

Then I'm happy for everyone else 👍 I'll leave this open and try to debug myself.

@notwaldorf
Copy link
Owner

As of version 1.2.0 there's a new way to use the terminal that doesn't involve the bash script/ Would you mind updating to that and setting the TTC_GITBOT environment variable to gitlog, to see if that fixes your problems?

@AndiDog
Copy link
Author

AndiDog commented May 16, 2017

The problem resolved on its own recently. Hard to find out afterwards what the real reason was (such as the state of my 200+ Git repos)... 1.2.0 is also working fine for me. We can close this and hope it doesn't happen anymore ;) Thanks!

@AndiDog AndiDog closed this as completed May 16, 2017
@jarednorman
Copy link

I'm also getting this error, and it's caused by a specific one of my git repos, it seems. 😢

@notwaldorf
Copy link
Owner

@jarednorman I've noticed I couldn't use a git repo with a dot in the name. Maybe it's that? :(

@jarednorman
Copy link

No dot or any other weird characters. It's just of the format "fooBar".

@mojoaxel
Copy link
Collaborator

I've noticed I couldn't use a git repo with a dot in the name. Maybe it's that? :(

@notwaldorf Is this a git-log or an git-standup issue? I think this should be fixed!

@jarednorman
Copy link

Changing between git-log/git-standup has no effect on the error for me. The only thing that changes whether I get this error is whether I include this one repo I have in TTC_REPOS.

@jarednorman
Copy link

Mysteriously just started working today. 😖

@cfinucane
Copy link

I had the same problem, and traced it to curly braces in the commit messages wreaking havoc with the "tag parser" implemented in the blessed library. The simplest fix is to set tags: false in makeBox(), but I'm not sure if there is an unrelated reason it needs to be set to true. The alternative is to do something like content = content.replace(/[{}]/g, m => m === '{' ? '{open}' : '{close}'); inside getCommits(). Happy to submit a tiny-PR if you let me know which solution you think would be more appropriate :)

@timbeadle
Copy link
Contributor

I also had this problem with just one repo, which had curly braces in commit messages. I applied @cfinucane's patch and it works. 😀

@LeoniePhiline
Copy link

LeoniePhiline commented Jun 13, 2018

Having the same issue:

TypeError: Cannot read property 'slice' of null
    at /usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/program.js:2543:35
    at Array.forEach (<anonymous>)
    at Program._attr (/usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/program.js:2542:11)
    at Box.Element._parseTags (/usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/widgets/element.js:498:26)
    at Box.Element.parseContent (/usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/widgets/element.js:393:22)
    at Box.Element.render (/usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/widgets/element.js:1839:8)
    at /usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/widgets/screen.js:738:8
    at Array.forEach (<anonymous>)
    at Screen.render (/usr/local/lib/node_modules/tiny-care-terminal/node_modules/blessed/lib/widgets/screen.js:735:17)
    at gitbot.getCommitsFromRepos (/usr/local/lib/node_modules/tiny-care-terminal/care.js:207:16)
    at async.each.err (/usr/local/lib/node_modules/tiny-care-terminal/gitbot.js:88:5)
    at /usr/local/lib/node_modules/tiny-care-terminal/node_modules/async/lib/async.js:52:16
    at done (/usr/local/lib/node_modules/tiny-care-terminal/node_modules/async/lib/async.js:246:17)
    at /usr/local/lib/node_modules/tiny-care-terminal/node_modules/async/lib/async.js:44:16
    at gitlog (/usr/local/lib/node_modules/tiny-care-terminal/gitbot.js:82:9)
    at /usr/local/lib/node_modules/tiny-care-terminal/node_modules/gitlog/index.js:132:5
> node -v
v8.11.2
> npm -v
5.6.0

Probably also due to commits titled like

Rename ./build{,-dev}.sh to ./webpack-build{,-dev}.sh

For me it was also "fixed" by changing the tags: option in function makeBox(label) to false. (In /usr/local/bin/tiny-care-terminal)

@AndiDog Would you reopen and apply @cfinucane 's patch? :)

@mojoaxel mojoaxel reopened this Jun 14, 2018
@mojoaxel mojoaxel added 🚨 bug Something is broken 🙏 help wanted With a little help from my friends... and removed ⏳ pending-response What are you waiting for? Christmas? labels Jun 14, 2018
@mojoaxel
Copy link
Collaborator

I won't find the time in the near future to work on this issue. Maybe somebody can create a pull-request? It shouldn't be that hard. 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 bug Something is broken 🙏 help wanted With a little help from my friends...
Projects
None yet
Development

No branches or pull requests

8 participants
@jarednorman @cfinucane @mojoaxel @timbeadle @notwaldorf @AndiDog @LeoniePhiline and others