Internal error on customerActivateByUrl mutation - ID: 0c59365b-34e4-49f7-bae9-e6b

Hevoluta
Tourist
3 0 0

Internal error. Looks like something went wrong on our end on:

customerActivateByUrl

 

i have an headless ecommerce built with next.js and shopify graphql api. I have an error when i try to active by url a regiested customer.

 

this is the code i run on the submit of the new password:

 

 

// set new password after activating the registration
  const registerConfirm = async ({ syclid, discount, password }) => {
    'use server'

    console.log(String(process.env.SHOPIFY_STORE_DOMAIN + '/?syclid=' + syclid + '&discount=' + discount))
    console.log(password)

    const res = registerConfirmCustomer({
      activationUrl: String(process.env.SHOPIFY_STORE_DOMAIN + '/?syclid=' + syclid + '&discount=' + discount),
      password
    });
    
    return res
  }

 

 

 

and i get this log (and the right password):

https://hevoluta.vercel.app/?syclid=......&discount=OFF15

 

but the error i got is:

 

 

 ⨯ {
  error: {
  message: 'Internal error. Looks like something went wrong on our end.\nRequest ID: 0c59365b-34e4-49f7-bae9-e6bbb11fc3ec (include this in support requests).',
  extensions: {
  code: 'INTERNAL_SERVER_ERROR',
  requestId: '0c59365b-34e4-49f7-bae9-e6bbb11fc3ec'
}
},
  query: '\n  mutation customerActivateByUrl($activationUrl: URL!, $password: String!) {\n    customerActivateByUrl(activationUrl: $activationUrl, password: $password) {\n      customer {\n        ...customer\n      }\n      customerAccessToken {\n        ...customerAccessToken\n      }\n      customerUserErrors {\n        ...customerUserError\n      }\n    }\n  }\n  \n  fragment customer on Customer {\n    acceptsMarketing\n    createdAt\n    displayName\n    email\n    firstName\n    id\n    lastName\n    numberOfOrders\n    phone\n    tags\n    updatedAt\n    defaultAddress {\n      address1\n      address2\n      city\n      company\n      country\n      countryCodeV2\n      firstName\n      formatted(withName: true, withCompany: true)\n      formattedArea\n      id\n      lastName\n      latitude\n      longitude\n      name\n      phone\n      province\n      provinceCode\n      zip\n    }\n    orders: orders(first: 250) {\n      edges {\n        node {\n          ...order\n        }\n      }\n    }\n  }\n  \n  fragment order on Order {\n    id\n    name\n    orderNumber\n    fulfillmentStatus\n    totalPrice {\n      amount\n      currencyCode\n    }\n    currencyCode\n    statusUrl\n    processedAt\n    lineItems(first: 250) {\n      edges {\n        node {\n          title\n          quantity\n        }\n      }\n    }\n  }\n\n\n  \n  fragment customerAccessToken on CustomerAccessToken {\n    accessToken\n    expiresAt\n  }\n\n  \n  fragment customerUserError on CustomerUserError {\n    code\n    field\n    message\n  }\n\n'
}

 

 

 

The request ID is: 0c59365b-34e4-49f7-bae9-e6bbb11fc3ec.

 

What can i do? I don't think i'm making something wrong...

 

Thanks. Leonardo.

Replies 5 (5)

Liam
Shopify Staff
2723 289 743

Hi Hevoluta,

 

Is it possible there's an issue with how you might be managing a store URL? I can see on our side that there is an issue with routing, related to a `.myshopify.com` url - there could be a variable (like process.env.SHOPIFY_STORE_DOMAIN) that is not being managed correctly?

Liam | Developer Advocate @ 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

Hevoluta
Tourist
3 0 0

The problem could be if my active domain where i call the api is hevoluta.vercel.app or localhost:3000 but the domain is "[].myshopify.com"? because it's headless... 

and i just thought if calling customerUpdate to update the new password would be better than calling customerActivateByUrl...

Liam
Shopify Staff
2723 289 743

There is something failing due to the domain not being recognised as a valid route - so that will need to be reviewed and fixed on your side. 

Liam | Developer Advocate @ 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

Hevoluta
Tourist
3 0 0
Liam
Shopify Staff
2723 289 743

The error message on our backend is: ActionController::RoutingError No route matches \"https://879c32-2.myshopify.com\"

Liam | Developer Advocate @ 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