Snazzah / slash-up

💻 CLI to view Discord commands and sync commands with slash-create
https://slash-create.js.org
MIT License
15 stars 0 forks source link

`slash-up sync` hangs forever during Heroku deployment #289

Open linuswillner opened 9 months ago

linuswillner commented 9 months ago

Déja vù, I'm here again with mystic hanging issues.

As titled, slash-up sync does nothing for at least 40 minutes (didn't bother waiting any longer) when trying to deploy to Heroku. I have positive confirmation that the command is started by NPM, but after that, nothing happens. Adding the --debug flag still prints nothing. Tried updating to latest slash-up and slash-create, neither had any effect.

We last deployed successfully with slash-up@v1.3.0 and slash-create@v5.13.0 on October 10th. This breakage has therefore happened somewhere between then and now. I will try again tomorrow to rule out Discord platform issues.

The only clue I have to go on at this stage is that the sync command never gets as far https://github.com/Snazzah/slash-up/blob/master/src/commands/sync.ts#L134, since I tried adding beforeSync: 'block' to the config, but still nothing would happen. It seems reasonable to assume it never makes it as far as https://github.com/Snazzah/slash-up/blob/master/src/commands/sync.ts#L126 either. I have a non-zero amount of commands, and it not stopping on "no commands" seems to suggest it doesn't make it as far as https://github.com/Snazzah/slash-up/blob/master/src/commands/sync.ts#L116 either. I have neither disableDelete nor globalToGuild enabled in the production environment (latter is enabled in dev, but I'm running slash-up sync, which should mean it does not go into that branch), so it therefore stands to reason the script never enters neither https://github.com/Snazzah/slash-up/blob/master/src/commands/sync.ts#L108 nor https://github.com/Snazzah/slash-up/blob/master/src/commands/sync.ts#L99.

Summarily, bar the handler() function not running at all, it seems the script is liable to hang somewhere here: https://github.com/Snazzah/slash-up/blob/master/src/commands/sync.ts#L95-L96

The strangest thing is that this works just fine locally.

That's all I've got to go on at this stage; happy to provide more help where I can. Thank you in advance for any help!

linuswillner commented 8 months ago

Tried deploying again today, issue still persists.

Snazzah commented 8 months ago

There could be an underlying issue when creating the SlashCreator in the first place. Assuming the project uses slash-create v5, there might've been an issue when loading commands. Not sure how it would lead to the command hanging though. Does rolling back slash-up versions potentially fix issues, just to rule out other potential issues?

linuswillner commented 8 months ago

We are on slash-create@v6.0.1 and slash-up@v1.4.2 now. We attempted upgrading as the first step towards a resolution, but sadly that did not appear to make a difference.

Snazzah commented 8 months ago

So this works okay locally but hangs for Heroku? I could try and add more debug statements on when the creator is made just in case. Do you know what Node version Heroku deploys with? I'm not too familiar with Heroku.

linuswillner commented 8 months ago

Correct, this only happens in Heroku - locally it works fine (that's also our workaround for now).

Heroku deploys with Node 18 in our configuration, the exact version is configurable. Local deployments are similarly run with Node 18.