Unable to download forge templates from forge cli

? Enter a name for your app: demo-app

Start with a template. Each template contains the required files to be a valid app.

Getting template list…

Error: request to https://forge-templates.us-west-2.prod.public.atl-paas.net/templates.json failed, reason: read ECONNRESET

FetchError: request to https://forge-templates.us-west-2.prod.public.atl-paas.net/templates.json failed, reason: read ECONNRESET
at ClientRequest. (C:\Users\arupo\AppData\Roaming\npm\node_modules@forge\cli\node_modules\node-fetch\lib\index.js:1501:11)
at ClientRequest.emit (node:events:530:35)
at ClientRequest.emit (node:domain:488:12)
at TLSSocket.socketErrorListener (node:_http_client:495:9)
at TLSSocket.emit (node:events:518:28)
at TLSSocket.emit (node:domain:488:12)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

I have tried to resolve using disabling default windows defender, 3rd party Anti-virus,removing cache /history from browsers…unable to access the template via forgecli…same link works directly from the browser.

Hi @NiranjaniGopalakrish

I’m sorry to hear you’re having a difficult time creating an app using the Forge CLI. Network connectivity issues can be quite a rabbit hole. Are you still having the issue now?

ECONNRESET usually indicates a connection issue which could be a speed or drop out issue, but could also be a firewall / proxy / VPN setting.

I can see you’ve checked that you can reach the resource via your browser - which does lead me to believe this is a configuration issue. I’ve confirmed I’m able to run these commands from both my work and personal computers (a PC and a Mac) without running into this error.

Are you behind a proxy by any chance? Have you tried running the command using a different network connection?

Finally, if you did work out what the issue was it’d be great to hear how you resolved it!
Cheers!
Mel

2 Likes

Hi @mpaisley thanks a lot for the reply.
Below are the troubleshooting steps i have tried so far

  1. disabling windows fw and av
  2. DNS cache removal and added Google servers n dns
  3. Tried the same url using python code too…it fetches the list without any issue
  4. 4.tried directly on node js too .Weird issue…after 3-4 tries, able to fetch the list.Attaching the code and error with this reply.
  5. 5.tried disabling http and https ssl certs
    1. Captured Wireshark too and investigated the packet …I couldn’t get any proper reason from the captures. I could see only RESET s sent by atlassian server to my pc (client)
    1. I am not using any proxy…using only my home wifi connection. I have checked changing the network too like using my mobile hotspot. still same error.

Below s the nodejs code which i have used to check the forge url

const https = require('https');

const url = 'https://forge-templates.us-west-2.prod.public.atl-paas.net/templates.json';
//const url = 'https://www.google.com'

https.get(url, (res) => {
  console.log('statusCode:', res.statusCode);
  console.log('headers:', res.headers);

  res.on('data', (d) => {
    process.stdout.write(d);
  });

}).on('error', (e) => {
  console.error(e);
});

=======================

output with weird behaviour…after 3-4 reset errors, it ll display the list.

PS D:\Atlassian_projects> node .\newfeb26.js
Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) {
  errno: -4077,
  code: 'ECONNRESET',
  syscall: 'read'
}
PS D:\Atlassian_projects> node .\newfeb26.js
Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) {
  errno: -4077,
  code: 'ECONNRESET',
  syscall: 'read'
}
PS D:\Atlassian_projects> node .\newfeb26.js
Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) {
  errno: -4077,
  code: 'ECONNRESET',
  syscall: 'read'
}
PS D:\Atlassian_projects> node .\newfeb26.js
Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) {
  errno: -4077,
  code: 'ECONNRESET',
  syscall: 'read'
}
PS D:\Atlassian_projects> node .\newfeb26.js
Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) {
  errno: -4077,
  code: 'ECONNRESET',
  syscall: 'read'
}
PS D:\Atlassian_projects> node .\newfeb26.js
Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) {
  errno: -4077,
  code: 'ECONNRESET',
  syscall: 'read'
}
PS D:\Atlassian_projects> node .\newfeb26.js
Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) {
  errno: -4077,
  code: 'ECONNRESET',
  syscall: 'read'
}
PS D:\Atlassian_projects> node .\newfeb26.js
Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) {
  errno: -4077,
  code: 'ECONNRESET',
  syscall: 'read'
}
PS D:\Atlassian_projects> node .\newfeb26.js
Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) {
  errno: -4077,
  code: 'ECONNRESET',
  syscall: 'read'
}
PS D:\Atlassian_projects> node .\newfeb26.js
statusCode: 200
headers: {
  'content-type': 'application/json',
  'content-length': '7825',
  connection: 'keep-alive',
  'last-modified': 'Tue, 27 Feb 2024 06:50:45 GMT',
  'x-amz-version-id': '3xNvFksmU7Ugxo6YUjX2h0MvQmKNZjzJ',
  server: 'AmazonS3',
  date: 'Tue, 27 Feb 2024 23:51:37 GMT',
  'cache-control': 'public, no-cache',
  etag: '"8223647735f3eb5340c5a4ac7e8db545"',
  'x-cache': 'RefreshHit from cloudfront',
  via: '1.1 17d480d3bd7f151759117c0805d90a7a.cloudfront.net (CloudFront)',
  'x-amz-cf-pop': 'ATL59-P6',
  'x-amz-cf-id': 'mSC-oSEdXzPmaQZPxQg5O79j7NpPgW3-0BHAWD8ZjfUPCWqnKUnsjA=='
}
[
  {
    "name": "bitbucket-merge-check"
  },
  {
    "name": "bitbucket-pull-request-action-csuik"
  },
  {
    "name": "bitbucket-pull-request-card-csuik"
  },
  {
    "name": "bitbucket-repository-code-overview-action-csuik"
  },
  {
    "name": "bitbucket-repository-code-overview-card-csuik"
  },
  {
    "name": "bitbucket-repository-main-menu-page-csuik"
  },
  {
    "name": "bitbucket-repository-settings-menu-page-csuik"
  },
  {
    "name": "bitbucket-workspace-settings-menu-page-csuik"
  },
  {
    "name": "blank"
  },
  {
    "name": "compass-admin-page-csuik"
  },
  {
    "name": "compass-admin-page-custom-ui"
  },
  {
    "name": "compass-admin-page-ui-kit"
  },
  {
    "name": "compass-component-page-csuik"
  },
  {
    "name": "compass-component-page-custom-ui"
  },
  {
    "name": "compass-component-page-ui-kit"
  },
  {
    "name": "compass-data-provider"
  },
  {
    "name": "compass-global-page-csuik"
  },
  {
    "name": "compass-global-page-custom-ui"
  },
  {
    "name": "compass-global-page-ui-kit"
  },
  {
    "name": "compass-team-page-csuik"
  },
  {
    "name": "compass-team-page-custom-ui"
  },
  {
    "name": "compass-team-page-ui-kit"
  },
  {
    "name": "confluence-content-action-csuik"
  },
  {
    "name": "confluence-content-action-custom-ui"
  },
  {
    "name": "confluence-content-action-ui-kit"
  },
  {
    "name": "confluence-content-byline-csuik"
  },
  {
    "name": "confluence-content-byline-custom-ui"
  },
  {
    "name": "confluence-content-byline-ui-kit"
  },
  {
    "name": "confluence-context-menu-csuik"
  },
  {
    "name": "confluence-context-menu-custom-ui"
  },
  {
    "name": "confluence-context-menu-ui-kit"
  },
  {
    "name": "confluence-global-page-csuik"
  },
  {
    "name": "confluence-global-page-custom-ui"
  },
  {
    "name": "confluence-global-page-ui-kit"
  },
  {
    "name": "confluence-global-settings-csuik"
  },
  {
    "name": "confluence-global-settings-custom-ui"
  },
  {
    "name": "confluence-global-settings-ui-kit"
  },
  {
    "name": "confluence-homepage-feed-csuik"
  },
  {
    "name": "confluence-homepage-feed-custom-ui"
  },
  {
    "name": "confluence-homepage-feed-ui-kit"
  },
  {
    "name": "confluence-macro-csuik"
  },
  {
    "name": "confluence-macro-custom-ui"
  },
  {
    "name": "confluence-macro-typescript-ui-kit"
  },
  {
    "name": "confluence-macro-ui-kit"
  },
  {
    "name": "confluence-space-page-csuik"
  },
  {
    "name": "confluence-space-page-custom-ui"
  },
  {
    "name": "confluence-space-page-ui-kit"
  },
  {
    "name": "confluence-space-settings-csuik"
  },
  {
    "name": "confluence-space-settings-custom-ui"
  },
  {
    "name": "confluence-space-settings-ui-kit"
  },
  {
    "name": "jira-admin-page-csuik"
  },
  {
    "name": "jira-admin-page-custom-ui"
  },
  {
    "name": "jira-admin-page-ui-kit"
  },
  {
    "name": "jira-custom-field-custom-ui"
  },
  {
    "name": "jira-custom-field-type-custom-ui"
  },
  {
    "name": "jira-custom-field-type-ui-kit"
  },
  {
    "name": "jira-custom-field-ui-kit"
  },
  {
    "name": "jira-dashboard-background-script-custom-ui"
  },
  {
    "name": "jira-dashboard-gadget-custom-ui"
  },
  {
    "name": "jira-dashboard-gadget-ui-kit"
  },
  {
    "name": "jira-entity-property"
  },
  {
    "name": "jira-global-page-csuik"
  },
  {
    "name": "jira-global-page-custom-ui"
  },
  {
    "name": "jira-global-page-ui-kit"
  },
  {
    "name": "jira-global-permission"
  },
  {
    "name": "jira-issue-action-csuik"
  },
  {
    "name": "jira-issue-action-custom-ui"
  },
  {
    "name": "jira-issue-action-ui-kit"
  },
  {
    "name": "jira-issue-activity-csuik"
  },
  {
    "name": "jira-issue-activity-custom-ui"
  },
  {
    "name": "jira-issue-activity-ui-kit"
  },
  {
    "name": "jira-issue-context-csuik"
  },
  {
    "name": "jira-issue-context-custom-ui"
  },
  {
    "name": "jira-issue-context-ui-kit"
  },
  {
    "name": "jira-issue-glance-csuik"
  },
  {
    "name": "jira-issue-glance-custom-ui"
  },
  {
    "name": "jira-issue-glance-ui-kit"
  },
  {
    "name": "jira-issue-panel-csuik"
  },
  {
    "name": "jira-issue-panel-custom-ui"
  },
  {
    "name": "jira-issue-panel-ui-kit"
  },
  {
    "name": "jira-issue-view-background-script-custom-ui"
  },
  {
    "name": "jira-jql-function"
  },
  {
    "name": "jira-project-page-csuik"
  },
  {
    "name": "jira-project-page-custom-ui"
  },
  {
    "name": "jira-project-page-ui-kit"
  },
  {
    "name": "jira-project-permission"
  },
  {
    "name": "jira-project-settings-page-csuik"
  },
  {
    "name": "jira-project-settings-page-custom-ui"
  },
  {
    "name": "jira-project-settings-page-ui-kit"
  },
  {
    "name": "jira-service-management-assets-import-type-csuik"
  },
  {
    "name": "jira-service-management-assets-import-type-ui-kit"
  },
  {
    "name": "jira-service-management-organization-panel-csuik"
  },
  {
    "name": "jira-service-management-organization-panel-custom-ui"
  },
  {
    "name": "jira-service-management-organization-panel-ui-kit"
  },
  {
    "name": "jira-service-management-portal-footer-csuik"
  },
  {
    "name": "jira-service-management-portal-footer-custom-ui"
  },
  {
    "name": "jira-service-management-portal-footer-ui-kit"
  },
  {
    "name": "jira-service-management-portal-header-csuik"
  },
  {
    "name": "jira-service-management-portal-header-custom-ui"
  },
  {
    "name": "jira-service-management-portal-header-ui-kit"
  },
  {
    "name": "jira-service-management-portal-profile-panel-csuik"
  },
  {
    "name": "jira-service-management-portal-profile-panel-custom-ui"
  },
  {
    "name": "jira-service-management-portal-profile-panel-ui-kit"
  },
  {
    "name": "jira-service-management-portal-request-create-property-panel-csuik"
  },
  {
    "name": "jira-service-management-portal-request-create-property-panel-custom-ui"
  },
  {
    "name": "jira-service-management-portal-request-create-property-panel-ui-kit"
  },
  {
    "name": "jira-service-management-portal-request-detail-csuik"
  },
  {
    "name": "jira-service-management-portal-request-detail-custom-ui"
  },
  {
    "name": "jira-service-management-portal-request-detail-panel-csuik"
  },
  {
    "name": "jira-service-management-portal-request-detail-panel-custom-ui"
  },
  {
    "name": "jira-service-management-portal-request-detail-panel-ui-kit"
  },
  {
    "name": "jira-service-management-portal-request-detail-ui-kit"
  },
  {
    "name": "jira-service-management-portal-request-view-action-csuik"
  },
  {
    "name": "jira-service-management-portal-request-view-action-custom-ui"
  },
  {
    "name": "jira-service-management-portal-request-view-action-ui-kit"
  },
  {
    "name": "jira-service-management-portal-subheader-csuik"
  },
  {
    "name": "jira-service-management-portal-subheader-custom-ui"
  },
  {
    "name": "jira-service-management-portal-subheader-ui-kit"
  },
  {
    "name": "jira-service-management-portal-user-menu-action-csuik "
  },
  {
    "name": "jira-service-management-portal-user-menu-action-custom-ui"
  },
  {
    "name": "jira-service-management-portal-user-menu-action-ui-kit"
  },
  {
    "name": "jira-service-management-queue-page-csuik"
  },
  {
    "name": "jira-service-management-queue-page-custom-ui"
  },
  {
    "name": "jira-service-management-queue-page-ui-kit"
  },
  {
    "name": "jira-ui-modifications-custom-ui"
  },
  {
    "name": "jira-workflow-condition"
  },
  {
    "name": "jira-workflow-condition-custom-ui"
  },
  {
    "name": "jira-workflow-postfunction"
  },
  {
    "name": "jira-workflow-postfunction-custom-ui"
  },
  {
    "name": "jira-workflow-validator"
  },
  {
    "name": "jira-workflow-validator-custom-ui"
  },
  {
    "name": "product-trigger"
  },
  {
    "name": "scheduled-trigger"
  },
  {
    "name": "webtrigger"
  }
]

I am using Visual studio as my editor

I can’t reproduce this error either (although on macOS and Linux machines). One possible problem I can see is that the host you are trying to reach has both IPv4 and IPv6 connectivity, and some Internet providers and routers don’t configure IPv6 properly.

Browsers have encountered this problem a lot and silently handle a lot of errors, so you might not notice anything wrong when opening this URL in the browser, but Node.js which Forge runs on doesn’t do it by default (yet).

Can you please try the following:

  • Run your script with node --dns-result-order=ipv4first script.js and see if it improves the reliability.
  • Disable IPv6 in system settings and see if this makes the script run reliably.
  • Look at the captured Wireshark packets to see which IP version are successful and failing ones using.
3 Likes

No words to express my thanks for the 100% solution. I have disabled IPV6 n my windows and it worked like a charm. Kudos Atlassian Group!

3 Likes

This is happening to me on macOS. IPv6 isn’t enabled in network settings, I also ran networksetup -setv6off Wi-Fi in my terminal and tried the forge create command again but the template still wouldn’t download.

running the script that @NiranjaniGopalakrish posted using both node script.js and node --dns-result-order=ipv4first script.js show the list on templates without an errors as originally reported by OP.

If I run the create command with the --verbose flag I don’t see any additional logs the script will seem as if it is complete by all the is generated is any empty directory.