Solved

New GraphiQL Error - on productVariantsBulkCreate (Most Likely A Bug)

corl
Shopify Partner
8 1 5

Yesterday, my app broke after working fine for a number of months. I have tracked it down to a failed Graph QL call, and I'm able to replicate the issue on the Shopify GraphiQL App. It errors out anytime I include the "inventoryQuantities" property for a variant on a productVariantsBulkCreate mutation. I can include the entire response, but the message I get back is "message": "The server responded with invalid JSON, this is probably a server-side error".

 

If I remove the "inventoryQuantities" property from the variants in my payload, I get a proper response back. I know yesterday was a release day for the new API version, but I did not see any changes related to my issue, and changing versions of the API seems to be of no help. One interesting thing is that it seems to create the variants, but gives back a response indicating an error. If I view my variants afterwards, the new variants are there, with inventory values set properly. When the "inventoryQuantities" property is included, the call takes a few minutes to return, as if it is waiting for something to time out before responding with an error message.

 

Any information regarding this issue would be much appreciated. I have attached an example request that causes the error.

Accepted Solution (1)

corl
Shopify Partner
8 1 5

This is an accepted solution.

Well I never heard back on this - but it does seem like Shopify has fixed the bug. Glad about that.

View solution in original post

Replies 7 (7)

corl
Shopify Partner
8 1 5

For some reason, it won't let me upload the response as a text file. So, I'm just going to post it here.

 

{
"message": "The server responded with invalid JSON, this is probably a server-side error",
"response": "<!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 type=\"text/css\">\n *{box-sizing:border-box;margin:0;padding:0}html{font-family:\"Helvetica Neue\",Helvetica,Arial,sans-serif;background:#F1F1F1;font-size:62.5%;color:#303030;min-height:100%}body{padding:0;margin:0;line-height:2.7rem}a{color:#303030;border-bottom:1px solid #303030;text-decoration:none;padding-bottom:1rem;transition:border-color 0.2s ease-in}a:hover{border-bottom-color:#A9A9A9}h1{font-size:1.8rem;font-weight:400;margin:0 0 1.4rem 0}p{font-size:1.5rem;margin:0}.page{padding:4rem 3.5rem;margin:0;display:flex;min-height:100vh;flex-direction:column}.text-container--main{flex:1;display:flex;align-items:start;margin-bottom:1.6rem}.action{border:1px solid #A9A9A9;padding:1.2rem 2.5rem;border-radius:6px;text-decoration:none;margin-top:1.6rem;display:inline-block;font-size:1.5rem;transition:border-color 0.2s ease-in}.action:hover{border-color:#000}@media all and (min-width:500px){.text-container--main{align-items:center}.page{padding:7.5rem 10.5rem}}\n </style>\n</head>\n\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\">Something went wrong</h1>\n <p data-i18n=\"try-refreshing\">There was a problem loading this website</p>\n <p data-i18n=\"try-again\">Try refreshing the page.</p>\n <a href=\".\" class=\"action\" data-i18n=\"refresh-page\">Refresh Page</a>\n </div>\n </div>\n</div>\n</body>\n\n</html>\n\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 \"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 \"th\": {\n \"title\": \"เกิดข้อผิดพลาดขึ้น\",\n \"content-title\": \"เกิดปัญหาในการโหลดเว็บไซต์นี้\",\n \"try-refreshing\": \"โปรดรีเฟรชหน้านี้อีกครั้ง\",\n \"try-again\": \"หากเว็บไซต์ยังไม่โหลด โปรดลองอีกครั้งในอีกสักครู่\",\n \"refresh-page\": \"รีเฟรชหน้า\"\n },\n \"pt-BR\": {\n \"title\": \"Houve um erro.\",\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 \"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 \"ko\": {\n \"title\": \"문제가 발생했습니다.\",\n \"content-title\": \"이 페이지를 로드하는 중 문제가 발생했습니다.\",\n \"try-refreshing\": \"페이지를 새로 고침해 보십시오.\",\n \"try-again\": \"그래도 사이트가 로드되지 않으면 몇 분 후에 다시 시도하십시오.\",\n \"refresh-page\": \"페이지 새로 고침\"\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 \"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 \"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 \"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 \"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 \"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 \"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 \"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 \"hi\": {\n \"title\": \"कुछ गलत हुआ\",\n \"content-title\": \"इस वेबसाइट को लोड करने में समस्या हुई\",\n \"try-refreshing\": \"पृष्ठ रीफ़्रेश करके देखें.\",\n \"try-again\": \"यदि साइट अभी तक लोड नहीं हुई है, तो कृपया कुछ मिनटों में फिर से कोशिश करें.\",\n \"refresh-page\": \"पेज को रीफ़्रेश करें\"\n },\n \"ja\": {\n \"title\": \"問題が発生しているようです\",\n \"content-title\": \"このウェブサイトを読み込む際に問題が発生しました\",\n \"try-refreshing\": \"ページを更新してみてください。\",\n \"try-again\": \"サイトが読み込まれない場合は、数分後にもう一度お試しください。\",\n \"refresh-page\": \"ページを更新する\"\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 \"zh-TW\": {\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 \"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 \"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 };\n var language = navigator.languages && navigator.languages[0] || // Chrome / Firefox\n navigator.language || // All browsers\n navigator.userLanguage || // IE <= 10\n \"en\";\n language = language.split(\"-\")[0]; // Strip country code\n translations = t[language] || t[\"en\"];\n // Replace content on screen\n for (var id in translations) {\n target = document.querySelector(\"[data-i18n=\" + id + \"]\");\n if (target != undefined) {\n target.innerHTML = translations[id];\n }\n }\n // Replace title tage\n document.title = translations[\"title\"];\n // Replace language tag\n if (t[language]) { document.getElementsByTagName('html')[0].setAttribute('lang', language); };\n</script>\n"
}

awwdam
Shopify Staff
249 42 36

Hey @corl 

Thanks for sharing so much info here, I was able to look at the examples you shared, however in order for us to get a better idea of what is happening we would require a bit more info. If you are able replicate this behaviour, please share back an x-request-id response header value from a request where the error was returned.

I can attempt to locate logs, pass back insights or next steps moving forward, and will keep an eye out here for the time being - Cheers! 

awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

corl
Shopify Partner
8 1 5

@awwdam 

Thank you for the response:

x-request-id
094de29d9b1cd1f6376150eb9bbe990d
awwdam
Shopify Staff
249 42 36

Hey @corl 

I was unable to locate any request logs related to the id value shared above. Could you try replicating the original request with your app or an API client such as Insomnia to provide another x-request-id to investigate - an example of the mutation body, input, and response body would also be greatly appreciated.

No rush, and happy to take a look once we have that info - Thanks! 


awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

corl
Shopify Partner
8 1 5

Could it be because the x-request-id is for a development store? I can generate another x-request-id, but I have made a temporary workaround for my client & do not want to trigger the error on the live store.

corl
Shopify Partner
8 1 5

This is an accepted solution.

Well I never heard back on this - but it does seem like Shopify has fixed the bug. Glad about that.

awwdam
Shopify Staff
249 42 36

Hey @corl,

Happy to hear the behavior you outlined is no longer present. Just wanted to connect again to offer a quick summary and some insights moving forward. 

While our team can't provide authenticated supported through these community forums, details such as an x-request-id provide a means of locating logs we can investigate. It's understandable not wanting to attempt replicate something unexpected in a 'live' senario, but is worth noting that this header value will be returned regardless of being on a merchants store or development store. When a behavior can't be replicated, we usually suggest keeping an eye out for persistence or additional occurrences.

I did have an eye out for any related reports, but wasn't able to replicate or find any other instances of what was initially described. Lastly, while I can't confirm potential changes that would be specifically related, our developer are always actively making platform improvements and fixes.

In the future, when facing a potential bug or unexpected API behavior, don't hesitate to use the Shopify Partner support - Report an issue option that was recently added.

- Cheers 

awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog