We saw an error show up in our logs earlier when trying to add a tag to an existing customer. The error shows up as a 404 error, which leads me to wonder if the customer was not found, but in this same Flow, we removed a tag from the same customer. Does anyone have any insights into what may have happened here?
Hi @Adam_Weis
I assume your app is performing this update on behalf of a merchant.
Did you double check to make sure that the customer gid is associated with the right merchant account?
That might be one potential cause.
I have seen this behavior before, but with orders if the access token doesn’t have read_all_orders
scope.
The API will respond with a 404 if the order is older than 60 days. But in my experience this doesn’t happen with customer records, you can update tags regardless of age.
I’d suspect a deleted customer. Was the customer deleted?
No the customer is there. In the same Flow, we were able to remove tags without any issues. It only 404’d on the add.
This might be related to an incident (outside Flow), which may have caused the API to return a 404 due to a routing problem. It has since resolved. I’d recommend rerunning, if needed.
Did this just affect one action?
Yes, this was the only action that failed. I reran it, and it was completed without any issues.
Are there any ways to be alerted to these failures or to rerun them automatically?
Yes to getting notified, here’s some error monitoring templates:
https://shopify.com/admin/apps/flow/editor/templates?sort=most_popular&tags=error_monitoring
Flow already reruns on errors, but it’s very unusual for a 404 to be retry-able. Usually that is permanent, and so we do not retry.
edit: fixed link
I don’t think that run code thing is related. Can you provide a link to the workflow run?
One of our engineers found a log for this. Your return type is a string, but you are returning the input object instead of input.customer.note
and that input is a hash not a string.
Not sure I understand here as I tried returning with this, am I missing something else?
export default function main(input) {
return {
input: JSON.stringify(input.customer.note),
};
}
I think you previously just had input: input
.
You don’t need the JSON.stringify. You could just output input.customer.note
The issue still occurs when using that:
export default function main(input) {
return {
input: input.customer.note,
};
}