diff --git a/assets/images/help/codespaces/vs-code-building-codespace.png b/assets/images/help/codespaces/vs-code-building-codespace.png new file mode 100644 index 0000000000..2aefbb164a Binary files /dev/null and b/assets/images/help/codespaces/vs-code-building-codespace.png differ diff --git a/assets/images/help/codespaces/web-ui-view-logs.png b/assets/images/help/codespaces/web-ui-view-logs.png new file mode 100644 index 0000000000..0d7048348e Binary files /dev/null and b/assets/images/help/codespaces/web-ui-view-logs.png differ diff --git a/content/codespaces/troubleshooting/troubleshooting-creation-and-deletion-of-codespaces.md b/content/codespaces/troubleshooting/troubleshooting-creation-and-deletion-of-codespaces.md index b0d92d091d..e029c962f6 100644 --- a/content/codespaces/troubleshooting/troubleshooting-creation-and-deletion-of-codespaces.md +++ b/content/codespaces/troubleshooting/troubleshooting-creation-and-deletion-of-codespaces.md @@ -30,6 +30,38 @@ If you create a codespace and it does not open: If you still cannot create a codespace for a repository where {% data variables.product.prodname_github_codespaces %} is available, {% data reusables.codespaces.contact-support %} +### Codespace creation fails + +If the creation of a codespace fails, it's likely to be due to a temporary infrastructure issue in the cloud - for example, a problem provisioning a virtual machine for the codespace. A less common reason for failure is if it takes longer than an hour to build the container. In this case, the build is cancelled and codespace creation will fail. + +{% note %} + +**Note:** A codespace that was not successfully created is never going to be usable and should be deleted. For more information, see "[Deleting a codespace](/codespaces/developing-in-codespaces/deleting-a-codespace)." + +{% endnote %} + +If you create a codespace and the creation fails: + +1. Check {% data variables.product.prodname_dotcom %}'s [Status page](https://githubstatus.com) for any active incidents. +1. Go to [your {% data variables.product.prodname_github_codespaces %} page](https://github.com/codespaces), delete the codespace, and create a new codespace. +1. If the container is building, look at the logs that are streaming and make sure the build is not stuck. A container build that takes longer than one hour will be canceled, resulting in a failed creation. + + One common scenario where this could happen is if you have a script running that is prompting for user input and waiting for an answer. If this is the case, remove the interactive prompt so that the build can complete non-interactively. + + {% note %} + + **Note**: To view the logs during a build: + * In the browser, click **View logs.** + + ![Screenshot of the Codespaces web UI with the View logs link emphasized](/assets/images/help/codespaces/web-ui-view-logs.png) + + * In the VS Code desktop application, click **Building codespace** in the "Setting up remote connection" that's displayed. + + ![Screenshot of VS Code with the Building codespace link emphasized](/assets/images/help/codespaces/vs-code-building-codespace.png) + + {% endnote %} +2. If you have a container that takes a long time to build, consider using prebuilds to speed up codespace creations. For more information, see "[Configuring prebuilds](/codespaces/prebuilding-your-codespaces/configuring-prebuilds#configuring-a-prebuild)." + ## Deleting codespaces The owner of a codespace has full control over it and only they can delete their codespaces. You cannot delete a codespace created by another user.