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

Improve IPC messaging to make errors more visible #1201

Closed
ErisDS opened this issue May 22, 2020 · 5 comments
Closed

Improve IPC messaging to make errors more visible #1201

ErisDS opened this issue May 22, 2020 · 5 comments
Assignees

Comments

@ErisDS
Copy link
Member

ErisDS commented May 22, 2020

Problem:

Frequently, Ghost fails to start with nothing more than an error code to show for itself, and the error code is often just "0". This makes debugging really difficult, people new to the tool don't have a chance, and even when they do make it to the forum it's really hard for seasoned Ghost-CLI users to determine where to go looking.

Here's a handful of examples from issues and the forum:

This seems to happen mostly on local installs, but I'm not convinced that's entirely true. Other commands can sometimes surface a partial error:

But still not enough to debug an issue.

Background:

Whenever anyone runs ghost start either manually, or as the last step in ghost install, 3 separate processes are created:

  • ghost start
  • ghost run
  • node index (Ghost itself)

Often, the error happens in Ghost or the ghost run command, and isn't passed up. Therefore ghost run -D can sometimes show the error, but sometimes you have to go digging in the Ghost logs!

Solution:

We need to make sure that any and all relevant error messages are passed to the top level process and displayed, no matter which process they occurred in.

Ideally we also need to output which process the error occurred in, and if possible the debug info from that process.

Ghost was recently updated so that it passes additional debug info: https://github.com/TryGhost/Ghost/blob/21d38b2d37d9dd1797a40f5d14bfa600b183581f/core/server/ghost-server.js#L346

The ghost run process may need a similar update to provide some more debug info.

This is a somewhat nebulous and hard-to-reproduce problem, but we see it all the time. I think the first step is to assess how the IPC is working, make sure errors are passed around, and then iterate on improving the output.

@vikaspotluri123
Copy link
Member

The change that was published over the weekend seems to be on the right path. If people are still running into the exit code 0 issue, we'll hopefully have more debug information to improve the CLI.

More references:

https://forum.ghost.org/t/ghost-error-occurred-knex-sqlite/14669

@daniellockyer
Copy link
Member

We also randomly see this in the Ghost-CLI tests in Core. I've updated the repo to use the latest version and asked the team to keep their eye out for any instances.

@ErisDS
Copy link
Member Author

ErisDS commented May 28, 2020

@daniellockyer what do you mean by "this"?

@daniellockyer
Copy link
Member

@ErisDS The error code 0 issue. Wanted to weigh in here to say we've also seen it and the error output addition coming from this issue should be useful.

From https://github.com/TryGhost/Ghost/pull/11862/checks?check_run_id=716617549 (this log might not last forever so pic below. Unable to download the log mentioned):

2020-05-28-15:50:02

@github-actions
Copy link

github-actions bot commented May 3, 2021

Our bot has automatically marked this issue as stale because there has not been any activity here in some time. The issue will be closed soon if there are no further updates, however we ask that you do not post comments to keep the issue open if you are not actively working on a PR. We keep the issue list minimal so we can keep focus on the most pressing issues. Closed issues can always be reopened if a new contributor is found. Thank you for understanding 🙂

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

No branches or pull requests

3 participants