Deploy build failure

Hiya! :wave:

Iโ€™ve verified that the build succeeds locally, and also built successfully with @netlify/build-image.

However, the deploy preview log shows the following error:

$ yarn build
yarn run v1.22.19
$ docusaurus build
[INFO] [en] Creating an optimized production buildโ€ฆ
[ERROR] Unable to build website for locale en.
[ERROR] Error: socket hang up
at connResetException (node:internal/errors:717:14)
at TLSSocket.socketOnEnd (node:_http_client:526:23)
at TLSSocket.emit (node:events:525:35)
at endReadableNT (node:internal/streams/readable:1359:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
[INFO] Docusaurus version: 2.2.0
Node version: v18.14.0
error Command failed with exit code 1. (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
info Visit yarn run | Yarn for documentation about this command.

(Full deploy log: Netlify App)

Any help in troubleshooting this issue would be greatly appreciated :slight_smile:

Hi :wave:t6: , what is your site name? Would you mind sharing what your build settings are configured to?

1 Like

Hi, sorry I thought you would be able to get the site name from the deploy log link.

The site name is resoto, and here are the build settings (let me know if you need additional details):
image

It is also worth noting that it is this single PR/branch that is failing to build. It is fetching some JSON documents from https://cdn.some.engineering at build time, resulting in the socket hang up error. However, the build succeeds outside of Netlify.

Since it may be relevant, this is the Docusaurus plugin that was added: docusaurus-extensions/packages/docusaurus-plugin-stored-data at main ยท 1Password/docusaurus-extensions ยท GitHub

Hi, @someengineer. Your repo is public so I cloned it and tested building the exact commit with the error. This is what I get in a local Ubuntu VM (which is not using Netlify in any way):

$ yarn build
yarn run v1.22.5
$ docusaurus build

   โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
   โ”‚                                                                                                                                                                                                                        โ”‚
   โ”‚                                                                                             Update available 2.2.0 โ†’ 2.3.1                                                                                             โ”‚
   โ”‚                                                                                                                                                                                                                        โ”‚
   โ”‚                                                                    To upgrade Docusaurus packages with the latest version, run the following command:                                                                  โ”‚
   โ”‚     `yarn upgrade @docusaurus/core@latest @docusaurus/plugin-pwa@latest @docusaurus/plugin-sitemap@latest @docusaurus/preset-classic@latest @docusaurus/theme-mermaid@latest @docusaurus/module-type-aliases@latest`   โ”‚
   โ”‚                                                                                                                                                                                                                        โ”‚
   โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

[INFO] [en] Creating an optimized production build...
[ERROR] Unable to build website for locale en.
[ERROR] Error: Client network socket disconnected before secure TLS connection was established
    at connResetException (node:internal/errors:717:14)
    at TLSSocket.onConnectEnd (node:_tls_wrap:1595:19)
    at TLSSocket.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1359:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
[INFO] Docusaurus version: 2.2.0
Node version: v18.14.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

This means the error is not being caused by Netlify (because I see it when Netlify is not used). You will need to resolve the issue in your code. Once the issue is resolved for the local builds, we can then troubleshoot if it still occurs at Netlify. Currently, it happens even without Netlify so it isnโ€™t something we can fix ourselves.

Note, our support team cannot debug your code but someone else on this support forum might. It is just that our support team doesnโ€™t have the resources to troubleshoot code unless it is code that Netlify has written.This means that your question is still definitely welcome here but our scope of support does not include debugging the code you write. It might also help to ask about that error on a site which is specific to debugging Docusaurus.

Hi @luke!

The build is succeeding in my local dev env as well as on GitHub. Perhaps itโ€™s a Netlify networking or proxy issue?

At build time, JSON documents are being fetched from https://cdn.some.engineering (e.g., https://cdn.some.engineering/resoto/aws/edge/ResotoOrgList.json).

Any insight you can provide would be much appreciated. Thanks!

GitHub build log: fix(docs): load AWS policy JSON at build time ยท someengineering/resoto.com@0bcb916 ยท GitHub

Hi @luke, I think this may be a Netlify networking/proxy issue.

I tested loading the JSON files from GitHub instead of our CDN hosted on DigitalOcean (cdn.some.engeering), and the build succeeded on Netlify.

Any idea why this might be the case?

Hi, @someengineer. I donโ€™t know why the error was occurring. I know that Netlify wasnโ€™t the cause but that is all I know.

This is how I saw the error:

  • Install Ubuntu 20.04 LTS on a system or VM
  • Install Node 18.14.0 on that system
  • Instal yarn 1.22.19 on that system
  • Install Git
  • Clone the repo and cd into the base directory
  • checkout the commit for the pull request
  • run yarn install
  • run yarn build
  • the error occurs

Now, you may have noticed me using the past-tense above (โ€œwas occurringโ€, โ€œhow I sawโ€, etc.). That is because when I test that above now, the build is successful locally.

So, whatever the error was, you appear to have fixed it now. I would recommend making a new deploy of the same commit as before (as I used the same commit as before and it worked for me).

In the deploy details, you can use this button to retry the same commit again:

So, I do think whatever it was you may have fixed it. If you still see the same error in the Netlify build system, please let us know.

Hi @luke, unfortunately itโ€™s still broken. See here: Netlify App

The build succeeds when loading JSON files from GitHub (raw.githubusercontent.com) but fails when loading from DigitalOcean (cdn.some.engineering or somecdn.ams3.cdn.digitaloceanspaces.com).

It appears that you didnโ€™t build the same commit again, but the same branch (the latest commit at the time of your reply was fetching the JSON from GitHub to illustrate the nature of the build failure, but I have since reverted the unwanted changes).

Other than changing the location of the JSON file, there were no other changes. Again, I think itโ€™s a Netlify networking/proxy issue, as Iโ€™m able to build successfully in my local environment with the DigitalOcean CDN endpoints.

P.S.- Really appreciate your time/help in troubleshoot this!

Since the Netlify build env seems to be unable to access resources from our CDN on DigitalOcean, Iโ€™m going to add a workaround and have GitHub commit these data files so that we can publish these changes.

However, this is less than ideal as we will now be maintaining two copies of the data (one copy on GitHub and another in DigitalOcean). If this Netlify issue can still be resolved, itโ€™d be greatly appreciated.

Hi, @someengineer. There is a false assumption here:

I proved it was not a Netlify issue. You stating โ€œthis Netlify issueโ€ is a false assumption. It isnโ€™t us.

I demonstrated the exact same error which occurred at Netlify also occurs when Netlify is not used in any way. This proves it is an issue on your side.

It is not Netlifyโ€™s issue because, if it was, it would stop happening when Netlify was removed. Because it continues to happen when Netlify is not involved in any way, it proves Netlify is not to blame.

Did you think I ran the test from inside Netlifyโ€™s networks? I did not. I tested from an independent network.

I ran your code on a system not controlled by Netlify, not running any Netlify code, and not on any network associated with or controlled by Netlify. However, I get the exact same error in that local VM. This proves, definitively, that the error is not caused by Netlify.

Finally, you deleted the commits/branch from the repo so I can no longer test the commits which did not work anymore. The repo change prevents me from testing the same commit as before so that option no longer exists.

Here is what I propose:

  1. You tell me a commit that should work and does not at Netlify (a commit which still exists in the repo).
  2. I will again test that independently of Netlify.
  3. If it does not work independently of Netlify, then you debug your code and third-party site configurations until it does work.
  4. Once it works for my local test, only then will we move on to troubleshooting it at Netlify.

Does that sound like an acceptable plan? If not, what do you propose as an alternative?