New Post-Purchase Checkout Extension: Changeset 500 Error

Solved
lucasharvey
Tourist
5 0 6

I have followed the tutorial here to create an Upsell App using the new Post-Purchase Checkout Extension. I am able to get the page to load after payment, but the Changeset functions applyChangeset and calculateChangeset are both returning 500 Internal Server Errors from Shopify's APIs (see image). 

Has anyone else encountered these errors? I am wondering if this is a bug since the API is quite new and still in the works. This is currently affecting my app development so I would appreciate any insight about how to fix this.

 

500 Internal Server Error for calculateChangeset500 Internal Server Error for calculateChangeset

 

 

 

 

Accepted Solution (1)

Accepted Solutions
denislins
Shopify Staff
Shopify Staff
5 1 1

This is an accepted solution.

Hi Lucas,

We identified the issue, and it should be fixed now.

Thank you for reporting it, and please let us know if you find any other issue.

Cheers!

View solution in original post

Replies 19 (19)
lyxsus
New Member
1 0 0

I'm experiencing the same problem. Did you find solution?

haripraneshHP
New Member
6 0 0

I'm also facing Internal server issue while applyChangeset call. 

 

denislins
Shopify Staff
Shopify Staff
5 1 1

This is an accepted solution.

Hi Lucas,

We identified the issue, and it should be fixed now.

Thank you for reporting it, and please let us know if you find any other issue.

Cheers!

haripraneshHP
New Member
6 0 0

Hi Denis,

Thanks for your reply on this issue.

I have tried calculateChangeset and applyChangeset functions now.

I'm facing the same error (500 - Internal server error) on calculateChangeset, new error (400 - unprocessed) on applyChangeset.  I have attached a screenshot of the errors below for your reference.

Note - Package version that I'm currently using is

 "@shopify/post-purchase-ui-extensions": "^0.11.0",
"@shopify/post-purchase-ui-extensions-react": "^0.11.0",

 

Error screenshotError screenshot

 

denislins
Shopify Staff
Shopify Staff
5 1 1

Hi! Can you post what you're passing to both methods when calling them, please?

haripraneshHP
New Member
6 0 0

Hi Denis,

I just found out that I'm passing wrong inputs to the functions. Now it's working. 

Thank you for your support.

 

 

lucasharvey
Tourist
5 0 6

Can you please let me know what the fix for this was? I'm currently getting the "400 - Changes must be supplied" error. Thanks!

lucasharvey
Tourist
5 0 6

Edit: RESOLVED. Was calling 

 

await calculateChangeset({newChanges});

 

instead of calling:

 

await calculateChangeset({changes: newChanges});

 

 

****************************************************

Hi, I am still getting a 400 error for calculateChangeset. See below for a screenshot of the changes I'm passing and the error I'm getting.

Screen Shot 2021-07-29 at 10.19.35 AM.png

liamhey
Tourist
8 0 3

Hi Denis

I am getting what appears to be this exact error in my post puchase checkout when I call the applyChangeset method. See below:

Screen Shot 2021-08-05 at 10.27.18 PM.png

 

Do you have any pointers or ideas on how to fix it?

 

Cheers

Liam

liamhey
Tourist
8 0 3

I figured out the problem... The payload I encoded in the JWT token has "escaped" JSON as I was using the .to_json method in Rails.

 

I changed it to payload.as_json and it works fine now!

 

Happy to help anyone else using Rails if they have problems.

mr-easy
Shopify Partner
10 0 3

This was working fine since about 2 weeks ago, then I started experiencing this error today, nothing changed in the code, the error is happening for the applyChanges function. Does anyone experience the same thing. I think this is an internal issue from Shopify.

liamhey
Tourist
8 0 3

Hi yes I am experiencing the same issue now. My extension was working fine and now all of a sudden it has stopped.

Let me know if you find a resolution, otherwise I guess we have to wait for Shopify to fix it...

mr-easy
Shopify Partner
10 0 3

Yeah, I guess so. Please I want to ask, since you are also working on a Post-purchase extension, how do you test the extension? Right now, I am using the Chrome developer's extension but I am looking for a cleaner way to test it. Do you have any idea how we can deploy this extension and test it on a development store?

denislins
Shopify Staff
Shopify Staff
5 1 1

@mr-easy @liamhey you are right, I've just identified an issue affecting post-purchase extensions. The team will have a look at it, but at this point we will need to wait until Monday, unfortunately.

I will update you as soon as I can. Thank you for reporting it!

liamhey
Tourist
8 0 3

@denislins thanks for the update! Looking forward to the fix.

@mr-easy I too am using the chrome extension... However this works with my development store so that is how I have been testing it so far.

denislins
Shopify Staff
Shopify Staff
5 1 1

We shipped a fix earlier today, and everything appears to be working on our side. Could you please confirm it's working on your side as well?

mr-easy
Shopify Partner
10 0 3

@denislins Yeah, I just checked it and it's working as normal. Thanks.

By the way, please do you know how to test the post purchase extension on a development store without using the Google Chrome or Firefox extension provided by Shopify.

denislins
Shopify Staff
Shopify Staff
5 1 1

It's possible to test it without the extension by just appending the same values the extension appends to the url yourself. However, I must say it's something I don't suggest, if you can avoid - the extension makes that process much easier.

mr-easy
Shopify Partner
10 0 3

Oh, I see, thanks.