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

TypeError: resp.reverse is not a function #4

Open
Wooza42 opened this issue Sep 11, 2018 · 12 comments
Open

TypeError: resp.reverse is not a function #4

Wooza42 opened this issue Sep 11, 2018 · 12 comments

Comments

@Wooza42
Copy link

Wooza42 commented Sep 11, 2018

Hello,

I tried installing the trellobot on my debian 9 machine but I am not able to run it. After setting up the config and starting the bot, this shows up:

== Bot logged in as @Trellobot#2254. Ready for action! ==
/home/sargon/trellobot/node_modules/trello-events/index.js:71
var boardActions = resp.reverse();
^

TypeError: resp.reverse is not a function
at /home/sargon/trellobot/node_modules/trello-events/index.js:71:27
at Request._callback (/home/sargon/trellobot/node_modules/node-trello/lib/node-trello.coffee:60:16)
at Request.self.callback (/home/sargon/trellobot/node_modules/request/main.js:122:22)
at Request.emit (events.js:182:13)
at Request. (/home/sargon/trellobot/node_modules/request/main.js:661:16)
at Request.emit (events.js:187:15)
at IncomingMessage. (/home/sargon/trellobot/node_modules/request/main.js:623:14)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1092:12)
at process._tickCallback (internal/process/next_tick.js:63:19)

@midnightlovell
Copy link

same problem here. I dont know what to do.

@guilhermeurnau
Copy link

Same, waiting for too :(

@Angush
Copy link
Owner

Angush commented Sep 28, 2018

@midnightlovell @guilhermeurnau are you both on Linux as well?

@mauzao9
Copy link

mauzao9 commented Oct 7, 2018

@midnightlovell @guilhermeurnau are you both on Linux as well?

Same with me, and yes, but the bot runs smoothly for a while it just crashed once or twice with that same error.

@Wooza42
Copy link
Author

Wooza42 commented Oct 9, 2018

I would love to getting this bot running but in my case it doesn't even run longer than some seconds before crashing with the above message. If there is more I can do to help troubleshooting, let me know.

@Angush
Copy link
Owner

Angush commented Dec 4, 2018

I wasn't able to recreate this, but a friend of mine did bump into it. She managed to fix it by limiting the number of actions Trellobot fetches from the API. So, @midnightlovell @guilhermeurnau @mauzao9 @Wooza42, if you guys are still trying to get it going, you might be able to fix it by doing the same.

To do so, head into /node_modules/trello-events/index.js and edit the first line of the getBoardActivity function to add ?limit=n to the end (so it reads trello.get('/1/boards/' + boardId + '/actions?limit=n', function(err, resp){) where n is the action limit. I'd recommend setting it to something moderately high, like 30 or 50.

The caveat to this is that if the bot isn't running constantly (eg. it crashes or your host machine goes down or internet drops or whatever else), and there's a lot of activity going on in your Trello board, it will only log the 30/50/n most recent actions, and not any before that.

@JakeyPrime
Copy link

JakeyPrime commented Jan 10, 2019

Sorry for the late post to this, but I'm also getting this error on Ubuntu 18.04. Followed the steps to a tee, followed your steps in the previous reply (set it to 30) and it's crashing on startup.

Any other pointers?

Edit: I managed to get it to post like 20 messages by lowering it to like 25, but before it got to the last 5, it crashed with the same error.

@mauzao9
Copy link

mauzao9 commented Jan 23, 2019

@Angush sadly it still constantly crashes, there is deff something wonky as to how the script is trying to get data and Trello doesn't like it heh

@fallengravity
Copy link

So I did everything mentioned in the thread and it worked perfectly for about 2 weeks, Then all hell broke loose one night and it had connected to discord API over 1000 Times in under 10 min needless to say the rest my token now whenever I try and connect it they almost instantly reset the token and email me. Something is definitely not right!

BUT

The bot is awesome when it does work, thank you for your hard work @Angush

@mauzao9
Copy link

mauzao9 commented Jan 26, 2019

Yes this bot is the best bot I have seen, the way it can connect the discord accs to trello accs and the ease to customize the card embeds is better than anything else I've seen, but it really needs that fix, something is messing up and both Trello and Discord seem to not like it as I also got the token revoked once haha

@jackalyst
Copy link

jackalyst commented Sep 12, 2019

I seem to get the json truncated, which is why it would have trouble

,"type":"updateCard","d
/home/qrlbutler/trellobot/node_modules/trello-events/index.js:76
		var boardActions = resp.reverse();
		                        ^

The last three times it happened, I threw the output into a bytecounter and found they were right around 14,966 bytes. Not sure if that's related.

@orhalimi
Copy link

Yea happened to me too.
Ran it on 512kb machine ^^"
anyway using @Angush suggestion and reduce it to like 15 solved the issue. Really great bot.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants