Unable to access project due to problematic package.json

I accidentally added "start": "yes" to package.json, and the server seems to be running yes command. After that change, the edit page is taking forever to load, so I can’t do anything on it (e.g. edit out the offending line, remove package.json entirely, or even change the project settings). Didn’t try the VSCode plugin, but I don’t think it’ll help either since it seems to be a server-side issue.

The project name is phaser-scratchpad, and it’s currently private. Can anyone help fixing it? (Maybe this is another reason to add “restart server manually” or “kill server” option.)

“yes” is supposed to run without end, lol!

How to kill a runaway process.

Assuming logged into Glitch, open a browser tab to this url, putting in your project name at the end …

https://glitch.com/edit/console.html?myproject

This opens a console, do the following

$ ps -aux

Should show something like this, with lots more rows …

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
app        204  0.0  0.0  19956  3732 pts/2    S    08:50   0:00 -su
app        217  0.0  0.0   6008   652 pts/1    R+   08:51   0:01 yes
app        218  0.0  0.0  36084  3192 pts/2    R+   08:51   0:00 ps -aux

Find the offending process, read its process id (PID) from the second column, then tell it to be killed …

$ kill -9 217

If there is no error message, just another prompt, then it worked.

That’s it, the editor will hopefully recover. You can check its status from Tools > Container Status.

Warning like most linux commands, kill can mess up your server if you use it incorrectly, and can damage your hearing if you put it in your ear.

I tried to open the following URL

https://glitch.com/edit/console.html?phaser-scratchpad

but it throws “ping timeout”. Looking at the console, all the socket.io requests are emitting 504 error (gateway timeout).

Sounds like it needs intervention from Glitch support, hopefully @cori can help.

Hey @Bubbler, sorry for the bother! All I can do here is to restore your project from a backup, unfortunately. Here are a couple of backup candidate timestamps to choose from that seem the most likely to be appropriate (all times UTC):

  1. 2019-09-11 08:02:06.000
  2. 2019-09-11 11:51:40.000

If you believe neither of those are the appropriate one (or if we pick one and it turns out not to be the right one) there are a few others we can choose from.

The one where the package.json doesn’t have yes will do. Probably the one right before #1, I guess.

Hey @Bubbler We can’t easily see the contents of the backup without restoring it - I ended up walking back through a few backups to find one that seemed to work - please take a look and let us know how it goes!

1 Like

The project is now working, thanks a lot!

1 Like