Shopify / shopify-app-template-node

MIT License
889 stars 400 forks source link

How do I handle/catch error @shopify/shopify-api? #1326

Open jvc-1902 opened 6 months ago

jvc-1902 commented 6 months ago

Shopify internal error

[shopify-app/INFO] Running validateAuthenticatedSession
[shopify-app/INFO] Running validateAuthenticatedSession
/app/node_modules/@shopify/shopify-api/lib/clients/http_client/http_client.js:185
                throw new ShopifyErrors.HttpInternalError({
                      ^

HttpInternalError: Shopify internal error:
If you report this error, please include this id: 56336db4-0792-407a-b04a-c99878ca98d4-1714115478
    at NewHttpClient.throwFailedRequest (/app/node_modules/@shopify/shopify-api/lib/clients/http_client/http_client.js:185:23)
    at NewHttpClient.<anonymous> (/app/node_modules/@shopify/shopify-api/lib/clients/http_client/http_client.js:220:22)
    at Generator.next (<anonymous>)
    at fulfilled (/app/node_modules/tslib/tslib.js:164:62)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  response: {
    code: 503,
    statusText: 'Service Unavailable',
    body: '<!--\n' +
      '  The source of truth for this generic error page is https://github.com/Shopify/error-pages.\n' +
      '  Please do not edit this file directly.\n' +
      '-->\n' +
      '<!DOCTYPE html>\n' +
      '<html lang="en">\n' +
      '  <head>\n' +
      '    <meta charset="utf-8">\n' +
      '    <meta name="referrer" content="never">\n' +
      '    <meta name="viewport" content="width=device-width, initial-scale=1">\n' +
      '    <title>Something went wrong</title>\n' +
      '    <style>\n' +
      '      * {\n' +
      '        box-sizing: border-box;\n' +
      '        margin: 0;\n' +
      '        padding: 0;\n' +
      '      }\n' +
      '      html {\n' +
      '        font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;\n' +
      '        background: #F1F1F1;\n' +
      '        font-size: 62.5%;\n' +
      '        color: #303030;\n' +
      '        min-height: 100%;\n' +
      '      }\n' +
      '      body {\n' +
      '        padding: 0;\n' +
      '        margin: 0;\n' +
      '        line-height: 2.7rem;\n' +
      '      }\n' +
      '      a {\n' +
      '        color: #303030;\n' +
      '        border-bottom: 1px solid #303030;\n' +
      '        text-decoration: none;\n' +
      '        padding-bottom: 1rem;\n' +
      '        transition: border-color 0.2s ease-in;\n' +
      '      }\n' +
      '      a:hover {\n' +
      '        border-bottom-color: #A9A9A9;\n' +
      '      }\n' +
      '      h1 {\n' +
      '        font-size: 1.8rem;\n' +
      '        font-weight: 400;\n' +
      '        margin: 0 0 1.4rem 0;\n' +
      '      }\n' +
      '      p {\n' +
      '        font-size: 1.5rem;\n' +
      '        margin: 0;\n' +
      '      }\n' +
      '      .page {\n' +
      '        padding: 4rem 3.5rem;\n' +
      '        margin: 0;\n' +
      '        display: flex;\n' +
      '        min-height: 100vh;\n' +
      '        flex-direction: column;\n' +
      '      }\n' +
      '      .text-container--main {\n' +
      '        flex: 1;\n' +
      '        display: flex;\n' +
      '        align-items: start;\n' +
      '        margin-bottom: 1.6rem;\n' +
      '      }\n' +
      '      .action {\n' +
      '        background: transparent;\n' +
      '        cursor: pointer;\n' +
      '        border: 1px solid #A9A9A9;\n' +
      '        padding: 1.2rem 2.5rem;\n' +
      '        border-radius: 6px;\n' +
      '        text-decoration: none;\n' +
      '        margin-top: 1.6rem;\n' +
      '        display: inline-block;\n' +
      '        font-size: 1.5rem;\n' +
      '        transition: border-color 0.2s ease-in;\n' +
      '      }\n' +
      '      .action:hover {\n' +
      '        border-color: #000;\n' +
      '      }\n' +
      '      @media all and (min-width:500px) {\n' +
      '        .text-container--main {\n' +
      '          align-items: center;\n' +
      '        }\n' +
      '        .page {\n' +
      '          padding: 7.5rem 10.5rem;\n' +
      '        }\n' +
      '      }\n' +
      '    </style>\n' +
      '  </head>\n' +
      '  <body class="status-error status-code-500">\n' +
      '    <div class="page">\n' +
      '      <div class="text-container text-container--main">\n' +
      '        <div>\n' +
      '          <h1 data-i18n="content-title">There was a problem loading this website</h1>\n' +
      '          <p data-i18n="try-refreshing">Try refreshing the page.</p>\n' +
      `          <p data-i18n="try-again">If the site still doesn't load, please try again in a few minutes.</p>\n` +
      '          <a onclick="window.location.reload();" href="" class="action" data-i18n="refresh-page">Refresh Page</a>\n' +
      '        </div>\n' +
      '      </div>\n' +
      '    </div>\n' +
      '    <script>\n' +
      '      var t = {\n' +
      '        "cs": {\n' +
      '          "title": "Něco se pokazilo",\n' +
      '          "content-title": "Při načítání této webové stránky došlo k chybě",\n' +
      '          "try-refreshing": "Zkuste stránku obnovit.",\n' +
      '          "try-again": "Pokud se stránka ani přesto nenačte, zkuste to znovu za pár minut.",\n' +
      '          "refresh-page": "Obnovit stránku"\n' +
      '        },\n' +
      '        "da": {\n' +
      '          "title": "Der opstod en fejl",\n' +
      '          "content-title": "Der opstod en fejl under indlæsning af dette website",\n' +
      '          "try-refreshing": "Prøv at opdatere siden.",\n' +
      '          "try-again": "Hvis websitet ikke indlæses, kan du prøve igen om nogle få minutter.",\n' +
      '          "refresh-page": "Opdatér siden"\n' +
      '        },\n' +
      '        "de": {\n' +
      '          "title": "Irgendetwas ist schiefgelaufen.",\n' +
      '          "content-title": "Beim Laden dieser Website ist ein Fehler aufgetreten.",\n' +
      '          "try-refreshing": "Versuche, die Seite zu aktualisieren.",\n' +
      '          "try-again": "Wenn die Seite immer noch nicht geladen wird, versuche es bitte in ein paar Minuten erneut.",\n' +
      '          "refresh-page": "Seite neu laden"\n' +
      '        },\n' +
      '        "en": {\n' +
      '          "title": "Something went wrong",\n' +
      '          "content-title": "There was a problem loading this website",\n' +
      '          "try-refreshing": "Try refreshing the page.",\n' +
      `          "try-again": "If the site still doesn't load, please try again in a few minutes.",\n` +
      '          "refresh-page": "Refresh Page"\n' +
      '        },\n' +
      '        "es": {\n' +
      '          "title": "Algo salió mal.",\n' +
      '          "content-title": "Se ha producido un error al descargar el sitio",\n' +
      '          "try-refreshing": "Intenta actualizar la página.",\n' +
      '          "try-again": "Si el sitio no se descarga, por favor, inténtalo en unos minutos.",\n' +
      '          "refresh-page": "Actualizar la página"\n' +
      '        },\n' +
      '        "fi": {\n' +
      '          "title": "Jotain meni pieleen",\n' +
      '          "content-title": "Tämän verkkosivuston lataamisessa oli ongelma",\n' +
      '          "try-refreshing": "Yritä päivittää sivu.",\n' +
      '          "try-again": "Jos sivusto ei vieläkään lataudu, yritä uudelleen muutaman minuutin kuluttua.",\n' +
      '          "refresh-page": "Päivitä sivu"\n' +
      '        },\n' +
      '        "fr": {\n' +
      `          "title": "Une erreur s'est produite",\n` +
      '          "content-title": "Un problème est survenu lors du chargement de ce site",\n' +
      `          "try-refreshing": "Essayez d'actualiser la page.",\n` +
      '          "try-again": "Si le site ne charge toujours pas, veuillez réessayer dans quelques minutes.",\n' +
      '          "refresh-page": "Rafraîchir la page"\n' +
      '        },\n' +
      '        "hi": {\n' +
      '          "title": "कुछ गलत हुआ",\n' +
      '          "content-title": "इस वेबसाइट को लोड करने में समस्या हुई",\n' +
      '          "try-refreshing": "पृष्ठ रीफ़्रेश करके देखें.",\n' +
      '          "try-again": "यदि साइट अभी तक लोड नहीं हुई है, तो कृपया कुछ मिनटों में फिर से कोशिश करें.",\n' +
      '          "refresh-page": "पेज को रीफ़्रेश करें"\n' +
      '        },\n' +
      '        "it": {\n' +
      '          "title": "Si è verificato un errore",\n' +
      '          "content-title": "Si è verificato un problema nel caricamento di questo sito web",\n' +
      '          "try-refreshing": "Prova ad aggiornare la pagina.",\n' +
      '          "try-again": "Se il sito ancora non si carica, per favore riprova tra qualche minuto.",\n' +
      '          "refresh-page": "Aggiorna pagina"\n' +
      '        },\n' +
      '        "ja": {\n' +
      '          "title": "問題が発生しているようです",\n' +
      '          "content-title": "このウェブサイトを読み込む際に問題が発生しました",\n' +
      '          "try-refreshing": "ページを更新してみてください。",\n' +
      '          "try-again": "サイトが読み込まれない場合は、数分後にもう一度お試しください。",\n' +
      '          "refresh-page": "ページを更新する"\n' +
      '        },\n' +
      '        "ko": {\n' +
      '          "title": "문제가 발생했습니다.",\n' +
      '          "content-title": "이 페이지를 로드하는 중 문제가 발생했습니다.",\n' +
      '          "try-refreshing": "페이지를 새로 고침해 보십시오.",\n' +
      '          "try-again": "그래도 사이트가 로드되지 않으면 몇 분 후에 다시 시도하십시오.",\n' +
      '          "refresh-page": "페이지 새로 고침"\n' +
      '        },\n' +
      '        "ms": {\n' +
      '          "title": "Sesuatu tidak kena",\n' +
      '          "content-title": "Terdapat masalah memuatkan laman web ini",\n' +
      '          "try-refreshing": "Cuba segarkan semula halaman.",\n' +
      '          "try-again": "Jika laman web ini masih tidak memuatkan, sila cuba lagi dalam beberapa minit.",\n' +
      '          "refresh-page": "Segarkan semula Halaman"\n' +
      '        },\n' +
      '        "nb": {\n' +
      '          "title": "Noe gikk galt",\n' +
      '          "content-title": "Det oppsto et problem ved lasting av denne nettsiden",\n' +
      '          "try-refreshing": "Prøv å oppdatere siden.",\n' +
      '          "try-again": "Hvis nettstedet fortsatt ikke lastes inn, kan du prøve igjen om noen minutter.",\n' +
      '          "refresh-page": "Oppdater siden"\n' +
      '        },\n' +
      '        "nl": {\n' +
      '          "title": "Er ging iets mis",\n' +
      '          "content-title": "Er is een probleem opgetreden bij het laden van deze website",\n' +
      '          "try-refreshing": "Laad de pagina opnieuw.",\n' +
      '          "try-again": "Als de site nog steeds niet laadt, probeer het over een paar minuten opnieuw.",\n' +
      '          "refresh-page": "Pagina opnieuw laden"\n' +
      '        },\n' +
      '        "pl": {\n' +
      '          "title": "Coś poszło nie tak",\n' +
      '          "content-title": "Podczas ładowania tej strony internetowej wystąpił problem",\n' +
      '          "try-refreshing": "Spróbuj odświeżyć stronę.",\n' +
      '          "try-again": "Jeśli strona nadal się nie ładuje, spróbuj ponownie za kilka minut.",\n' +
      '          "refresh-page": "Odśwież stronę"\n' +
      '        },\n' +
      '        "pt-BR": {\n' +
      '          "title": "Algo deu errado.",\n' +
      '          "content-title": "Houve um problema ao carregar este site",\n' +
      '          "try-refreshing": "Tente atualizar a página.",\n' +
      '          "try-again": "Se o site ainda não carregar, tente novamente dentro de alguns minutos.",\n' +
      '          "refresh-page": "Atualizar a página"\n' +
      '        },\n' +
      '        "pt-PT": {\n' +
      '          "title": "Ocorreu um erro",\n' +
      '          "content-title": "Ocorreu um erro ao carregar este site",\n' +
      '          "try-refreshing": "Experimente atualizar esta página.",\n' +
      '          "try-again": "Se o site continua a não carregar, tente novamente dentro de alguns minutos.",\n' +
      '          "refresh-page": "Atualizar página"\n' +
      '        },\n' +
      '        "sv": {\n' +
      '          "title": "Ett fel uppstod",\n' +
      '          "content-title": "Det gick inte att ladda den här webbplatsen",\n' +
      '          "try-refreshing": "Försök att uppdatera sidan.",\n' +
      '          "try-again": "Försök igen om några minuter om webbplatsen fortfarande inte har laddats.",\n' +
      '          "refresh-page": "Uppdatera sida"\n' +
      '        },\n' +
      '        "th": {\n' +
      '          "title": "เกิดข้อผิดพลาดขึ้น",\n' +
      '          "content-title": "เกิดปัญหาในการโหลดเว็บไซต์นี้",\n' +
      '          "try-refreshing": "โปรดรีเฟรชหน้านี้อีกครั้ง",\n' +
      '          "try-again": "หากเว็บไซต์ยังไม่โหลด โปรดลองอีกครั้งในอีกสักครู่",\n' +
      '          "refresh-page": "รีเฟรชหน้า"\n' +
      '        },\n' +
      '        "tr": {\n' +
      '          "title": "Bir sorun oluştu",\n' +
      '          "content-title": "Bu web sitesi yüklenirken sorun oluştu",\n' +
      '          "try-refreshing": "Sayfayı yenilemeyi deneyin.",\n' +
      '          "try-again": "Sayfa hâlâ yüklenmiyorsa lütfen birkaç dakika sonra tekrar deneyin.",\n' +
      '          "refresh-page": "Sayfayı Yenile"\n' +
      '        },\n' +
      '        "vi": {\n' +
      '          "title": "Đã xảy ra lỗi",\n' +
      '          "content-title": "Đã xảy ra sự cố khi tải trang web này",\n' +
      '          "try-refreshing": "Thử làm mới trang.",\n' +
      '          "try-again": "Nếu trang web vẫn không tải được, vui lòng thử lại sau ít phút.",\n' +
      '          "refresh-page": "Tải lại trang"\n' +
      '        },\n' +
      '        "zh-CN": {\n' +
      '          "title": "出现错误",\n' +
      '          "content-title": "加载此网站时出现问题",\n' +
      '          "try-refreshing": "请尝试刷新页面。",\n' +
      '          "try-again": "如果网站仍未加载,请在几分钟后重试。",\n' +
      '          "refresh-page": "刷新页面"\n' +
      '        },\n' +
      '        "zh-TW": {\n' +
      '          "title": '... 1010 more characters,
    headers: {
      'Alt-Svc': [ 'h3=":443"; ma=86400' ],
      'Cf-Cache-Status': [ 'DYNAMIC' ],
      'Cf-Ray': [ '87a4c20c19173a73-FRA' ],
      Connection: [ 'close' ],
      'Content-Length': [ '12194' ],
      'Content-Type': [ 'text/html; charset=UTF-8' ],
      Date: [ 'Fri, 26 Apr 2024 07:11:18 GMT' ],
      Nel: [
        '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}'
      ],
      'Report-To': [
        '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=vnsX96CUm8YaFvWZ1X%2FS3BxG40sQWvi3GM%2BDrzolPTvyHhOuKQV7Dn1mh6CC%2BkAHzWLH6BVRtxW3CTxjUONS38p6UlBlFHuJUFs2Zz%2BGukEl8By5eI%2FTd415NFkh76DrE7fNPjLgqYn%2F1WP1%2FWLyVzIFXU1cGPcsaD5AHjDT0uzxT6WfZkArgksG"}],"group":"cf-nel","max_age":604800}'
      ],
      Server: [ 'cloudflare' ],
      'Server-Timing': [ 'cfRequestDuration;dur=187.000036, ipv6' ],
      'X-Content-Type-Options': [ 'nosniff' ],
      'X-Dc': [ 'gcp-europe-west3,gcp-us-east1,gcp-us-east1' ],
      'X-Download-Options': [ 'noopen' ],
      'X-Permitted-Cross-Domain-Policies': [ 'none' ],
      'X-Request-Id': [ '56336db4-0792-407a-b04a-c99878ca98d4-1714115478' ],
      'X-Sorting-Hat-Podid': [ '305' ],
      'X-Sorting-Hat-Shopid': [ '77252886834' ],
      'X-Xss-Protection': [ '1; mode=block' ]
    }
  }
}
paulomarg commented 6 months ago

Hi, unfortunately, there is nothing we can do without the full context of what triggered that error. It seems you're using a very outdated version of the shopify-api package. I'd recommend updating all of your Shopify packages and trying again to see if the error still persists.

If it does, please provide a little more detail on what causes this error, like the steps you took to reach it. If you can provide reproduction steps that show there's a bug in our code, we'll be happy to fix it!