SOLFIND
Web Lens
Portal home

Troubleshooting prebuilds - GitHub Docs

https://docs.github.com/en/codespaces/troubleshooting/troubleshooting-prebuilds • 223 KB fetched
Open original page


Troubleshooting prebuilds - GitHub Docs Skip to main content GitHub Docs Version: Free, Pro, & Team Search or ask Copilot Search or ask Copilot Select language: current language is English Search or ask Copilot Search or ask Copilot Open menu Collapse sidebar Expand sidebar Scroll breadcrumbs left * Home * Codespaces * Troubleshooting * Codespaces prebuilds Scroll breadcrumbs right Codespaces * * * Quickstart * Getting started * What are Codespaces? * Codespaces features * The codespace lifecycle * Deep dive into Codespaces * Developing in a codespace * Develop in a codespace * Create a codespace for a repo * Create a codespace from a template * Delete a codespace * Open an existing codespace * Work collaboratively * Source control * Pull requests * Stop a codespace * Forward ports * Rebuilding a container * Default environment variables * Persist variables and files * Connecting to a private network * Machine learning * Visual Studio Code * GitHub CLI * Customizing your codespace * Rename a codespace * Change your shell * Change the machine type * Setting your user preferences * Personalize your codespaces * Set the default editor * Set the default region * Set the timeout * Configure automatic deletion * Choose the host image * Setting up your project * Adding a dev container configuration * Introduction to dev containers * Setting up a Node.js project * Setting up a C# (.NET) project * Setting up a Java project * Setting up a PHP project * Setting up a Python project * Configuring dev containers * Set a minimum machine spec * Adding features * Automatically opening files * Specifying recommended secrets * Setting up your repository * Facilitating codespace creation * Set up a template repo * Prebuilding your codespaces * About prebuilds * Configure prebuilds * Allow external repo access * Manage prebuilds * Test dev container changes * Managing your codespaces * Codespaces secrets * Repository access * Security logs * GPG verification * Managing your organization * Enable or disable Codespaces * Billing and ownership * List organization codespaces * Manage Codespaces costs * Manage secrets * Audit logs * Restrict machine types * Restrict codespace creation * Restrict base image * Restrict port visibility * Restrict timeout periods * Restrict the retention period * Reference * Access a private registry * Copilot in Codespaces * VS Code Command Palette * Security in Codespaces * Disaster recovery * Troubleshooting * Codespaces logs * Codespaces clients * Included usage * Exporting changes * Creation and deletion * Authenticating to repositories * Connection * Codespaces prebuilds * Personalization * Port forwarding * GPG verification * Working with support * github.dev editor Troubleshooting prebuilds You can use prebuilds to speed up the creation of codespaces. This article provides troubleshooting steps for common issues with prebuilds. Copy as Markdown In this article * Checking whether a codespace was created from a prebuild? * Checking prebuild usage * The "Prebuild Ready" label is sometimes missing * Some resources cannot be accessed in codespaces created using a prebuild * Troubleshooting failed workflow runs for prebuilds * Further reading For more information about GitHub Codespaces prebuilds, see Prebuilding your codespaces . Checking whether a codespace was created from a prebuild? When you create a codespace, you can choose the type of the virtual machine you want to use. If a prebuild is available for the type of virtual machine, " Prebuild ready" is shown next to it. If you have your GitHub Codespaces editor preference set to "Visual Studio Code for Web" then the "Setting up your codespace" page will show the message "Prebuilt codespace found" if a prebuild is being used. Similarly, if your editor preference is "VS Code" then the integrated terminal will contain the message "You are on a prebuilt codespace defined by the prebuild configuration for your repository" when you create a new codespace. For more information, see Setting your default editor for GitHub Codespaces . After you have created a codespace you can check whether it was created from a prebuild by running the following GitHub CLI command in the terminal: Shell gh api /user/codespaces/$CODESPACE_NAME --jq .prebuild gh api /user/codespaces/$CODESPACE_NAME --jq .prebuild This returns true if the codespace was created using a prebuild. Alternatively, if GitHub CLI ( gh ) is not installed, you can use the following command, which returns createFromPrebuild if the codespace was created from a prebuild: Shell cat /workspaces/.codespaces/shared/environment-variables.json | jq '.ACTION_NAME' cat /workspaces/.codespaces/shared/environment-variables.json | jq '.ACTION_NAME' Checking prebuild usage You can check whether a repository is using prebuilds in the "Codespaces" page of the repository's settings. You can check how much storage space has been consumed by prebuilds in your current billing cycle by reviewing the billing data for your personal or organization account. You can also generate a usage report to see which repositories have been using prebuilds. For more information, see Viewing your usage of metered products and licenses . The "Prebuild Ready" label is sometimes missing You may notice that sometimes, when you create a new codespace from a prebuild-enabled branch, the " Prebuild Ready" label is not displayed in the dialog box for choosing a machine type. This means that prebuilds are not currently available. By default, each time you push to a prebuild-enabled branch, the prebuild is updated. If the push involves a change to the dev container configuration then, while the update is in progress, the " Prebuild Ready" label is removed from the list of machine types. During this time you can still create codespaces without a prebuild. If required, you can reduce the occasions on which prebuilds are unavailable for a repository by setting the prebuild to be updated only when you make a change to your dev container configuration files, or only on a custom schedule. For more information, see Configuring prebuilds . If your branch is not specifically enabled for prebuilds it may still benefit from prebuilds if it was branched from a prebuild-enabled branch. However, if the dev container configuration is changed on your branch, so that it's not the same as the configuration on the base branch, prebuilds will no longer be available on your branch. Here are things to check if the " Prebuild Ready" label is not displayed for a particular branch: * Confirm that a prebuild configuration exists for this branch. If you’re not a repository administrator, you'll need to reach out to one to confirm this. * Confirm that the prebuild configuration includes your region. * Check whether a change to the dev container configuration was pushed to the prebuild-enabled branch recently. If so, you will typically have to wait until the prebuild workflow run for this push completes before prebuilds are available again. * If no configuration changes were recently made, go to the Actions tab of your repository, click Codespaces Prebuilds in the workflows list, and check that prebuild workflow runs for the branch are succeeding. If latest runs of a workflow failed, and one or more of these failed runs contained changes to the dev container configuration, then there will be no available prebuilds for the associated branch. Some resources cannot be accessed in codespaces created using a prebuild If the devcontainer.json configuration file for a prebuild configuration specifies that permissions for access to other repositories are required, then the repository administrator is prompted to authorize these permissions when they create or update the prebuild configuration. If the administrator does not grant all of the requested permissions there's a chance that problems may occur in the prebuild, and in codespaces created from this prebuild. This is true even if the user who creates a codespace based on this prebuild does grant all of the permissions when they are prompted to do so. Troubleshooting failed workflow runs for prebuilds Increasing the GitHub Actions spending limit Prebuilds are created and updated using GitHub Actions. Your prebuild workflows will fail if you have used all of your GitHub Actions minutes and have reached your spending limit. If this occurs you can increase your GitHub Actions spending limit to allow the workflows to run. For more information, see Setting up budgets to control spending on metered products . Authorizing access permissions If the devcontainer.json configuration file for a prebuild configuration is updated to specify that permissions for access to other repositories are required, and a repository administrator has not been prompted to authorize these permissions for the prebuild configuration, then the prebuild workflow may fail. Try updating the prebuild configuration, without making any changes. If, when you click Update , the authorization page is displayed, check that the requested permissions are appropriate and, if so, authorize the request. For more information, see Managing prebuilds and Managing access to other repositories within your codespace . If the workflow runs for a prebuild configuration are failing, you can temporarily disable the prebuild configuration while you investigate. For more information, see Managing prebuilds . Preventing out-of-date prebuilds being used By default, if the latest prebuild workflow has failed, then a previous prebuild for the same combination of repository, branch, and devcontainer.json configuration file will be used to create new codespaces. This behavior is called prebuild optimization. We recommend keeping prebuild optimization enabled, because it helps ensure that codespaces can still be created quickly if an up-to-date prebuild is not available. However, as a repository administrator, you can disable prebuild optimization if you run into problems with prebuilt codespaces being behind the current state of the branch. If you disable prebuild optimization, codespaces for the relevant combination of repository, branch, and devcontainer.json file will be created without a prebuild if the latest prebuild workflow has failed or is currently running. * On GitHub, navigate to the main page of the repository. * Under your repository name, click Settings . If you cannot see the "Settings" tab, select the dropdown menu, then click Settings . * In the sidebar, under "Code, planning, and automation", click Codespaces . * To the right of the affected prebuild configuration, select the ellipsis ( ... ), then click Edit . * Scroll to the bottom of the "Edit configuration" page and click Show advanced options . * If you're sure you want to disable the default setting, select Disable prebuild optimization . * To save your change, click Update . Further reading * Configuring prebuilds * Managing prebuilds Back to top Help and support Was this Doc helpful? Yes No Help us make GitHub Docs great! All Docs are open source. See something that's wrong or unclear? Submit a pull request. Make a contribution Still need help? Provide GitHub Feedback Contact support Expert services Blog GitHub Inc. © 2026 Terms Privacy Status Pricing

Links found on this page

  1. Skip to main content [direct]
  2. GitHub Docs [direct]
  3. Codespaces [direct]
  4. Troubleshooting [direct]
  5. Quickstart [direct]
  6. What are Codespaces? [direct]
  7. Codespaces features [direct]
  8. The codespace lifecycle [direct]
  9. Deep dive into Codespaces [direct]
  10. Develop in a codespace [direct]
  11. Create a codespace for a repo [direct]
  12. Create a codespace from a template [direct]
  13. Delete a codespace [direct]
  14. Open an existing codespace [direct]
  15. Work collaboratively [direct]
  16. Source control [direct]
  17. Pull requests [direct]
  18. Stop a codespace [direct]
  19. Forward ports [direct]
  20. Rebuilding a container [direct]
  21. Default environment variables [direct]
  22. Persist variables and files [direct]
  23. Connecting to a private network [direct]
  24. Machine learning [direct]
  25. Visual Studio Code [direct]
  26. GitHub CLI [direct]
  27. Rename a codespace [direct]
  28. Change your shell [direct]
  29. Change the machine type [direct]
  30. Personalize your codespaces [direct]
  31. Set the default editor [direct]
  32. Set the default region [direct]
  33. Set the timeout [direct]
  34. Configure automatic deletion [direct]
  35. Choose the host image [direct]
  36. Introduction to dev containers [direct]
  37. Setting up a Node.js project [direct]
  38. Setting up a C# (.NET) project [direct]
  39. Setting up a Java project [direct]
  40. Setting up a PHP project [direct]
  41. Setting up a Python project [direct]
  42. Set a minimum machine spec [direct]
  43. Adding features [direct]
  44. Automatically opening files [direct]
  45. Specifying recommended secrets [direct]
  46. Facilitating codespace creation [direct]
  47. Set up a template repo [direct]
  48. About prebuilds [direct]
  49. Configure prebuilds [direct]
  50. Allow external repo access [direct]
  51. Manage prebuilds [direct]
  52. Test dev container changes [direct]
  53. Codespaces secrets [direct]
  54. Repository access [direct]
  55. Security logs [direct]
  56. GPG verification [direct]
  57. Enable or disable Codespaces [direct]
  58. Billing and ownership [direct]
  59. List organization codespaces [direct]
  60. Manage Codespaces costs [direct]
  61. Manage secrets [direct]
  62. Audit logs [direct]
  63. Restrict machine types [direct]
  64. Restrict codespace creation [direct]
  65. Restrict base image [direct]
  66. Restrict port visibility [direct]
  67. Restrict timeout periods [direct]
  68. Restrict the retention period [direct]
  69. Access a private registry [direct]
  70. Copilot in Codespaces [direct]
  71. VS Code Command Palette [direct]
  72. Security in Codespaces [direct]
  73. Disaster recovery [direct]
  74. Codespaces logs [direct]
  75. Codespaces clients [direct]
  76. Included usage [direct]
  77. Exporting changes [direct]
  78. Creation and deletion [direct]
  79. Authenticating to repositories [direct]
  80. Connection [direct]