Version-13 Error: Delivery URL returned response code: 500

I am getting Error: Delivery URL returned response code: 500 on creating webhook on wordpress ,

I have the same issue and here is my log
[Body] => {“exc_type”:“ValidationError”,“exception”:“frappe.exceptions.ValidationError: No changes made because old and new name are the same.”,“exc”:“["Traceback (most recent call last):\n File \"apps/frappe/frappe/app.py\", line 66, in application\n response = frappe.api.handle()\n File \"apps/frappe/frappe/api.py\", line 54, in handle\n return frappe.handler.handle()\n File \"apps/frappe/frappe/handler.py\", line 45, in handle\n data = execute_cmd(cmd)\n File \"apps/frappe/frappe/handler.py\", line 83, in execute_cmd\n return frappe.call(method, **frappe.form_dict)\n File \"apps/frappe/frappe/init.py\", line 1607, in call\n return fn(*args, **newargs)\n File \"apps/erpnext/erpnext/erpnext_integrations/connectors/woocommerce_connection.py\", line 30, in order\n _order(*args, **kwargs)\n File \"apps/erpnext/erpnext/erpnext_integrations/connectors/woocommerce_connection.py\", line 62, in order\n link_customer_and_address(raw_billing_data, raw_shipping_data, customer_name)\n File \"apps/erpnext/erpnext/erpnext_integrations/connectors/woocommerce_connection.py\", line 84, in link_customer_and_address\n frappe.rename_doc(\"Customer\", old_name, customer_name)\n File \"apps/frappe/frappe/init.py\", line 1313, in rename_doc\n return rename_doc(\n File \"apps/frappe/frappe/model/rename_doc.py\", line 154, in rename_doc\n new = validate_rename(\n File \"apps/frappe/frappe/model/rename_doc.py\", line 357, in validate_rename\n frappe.throw((\"No changes made because old and new name are the same.\").format(old, new))\n File \"apps/frappe/frappe/init.py\", line 525, in throw\n msgprint(\n File \"apps/frappe/frappe/init.py\", line 493, in msgprint\n _raise_exception()\n File \"apps/frappe/frappe/init.py\", line 442, in _raise_exception\n raise raise_exception(msg)\nfrappe.exceptions.ValidationError: No changes made because old and new name are the same.\n"]”,“_server_messages”:“["{\"message\": \"No changes made because old and new name are the same.\", \"title\": \"Message\", \"indicator\": \"red\", \"raise_exception\": 1}"]”}

Please Help

Hello, Actually you can ignore this error ,eventually the sync will work , but need to set few config is the erpnext side , like default item group , customer …etc.

1 Like

Thank you my bro

@silocoegypt how did you get the problem fixed? I have the same problem but no idea what i need to configure to make it work… thanks

can you post the log from wordpress

Sure:

            [Response] => Array
                (
                    [Code] => 417
                    [Message] => Expectation Failed
                    [Headers] => WpOrg\Requests\Utility\CaseInsensitiveDictionary Object
                        (
                            [data:protected] => Array
                                (
                                    [date] => Sat, 22 Apr 2023 10:29:18 GMT
                                    [content-type] => application/json
                                    [content-length] => 2247
                                    [set-cookie] => Array
                                        (
                                            [0] => sid=Guest; Expires=Tue, 25 Apr 2023 10:29:17 GMT; Secure; HttpOnly; Path=/; SameSite=Lax
                                            [1] => system_user=no; Secure; Path=/; SameSite=Lax
                                            [2] => full_name=Guest; Secure; Path=/; SameSite=Lax
                                            [3] => user_id=Guest; Secure; Path=/; SameSite=Lax
                                            [4] => user_image=; Secure; Path=/; SameSite=Lax
                                        )

                                    [cf-cache-status] => DYNAMIC
                                    [report-to] => {"endpoints":[{"url":"cloudflare.com...."}],"group":"cf-nel","max_age":604800}
                                    [nel] => {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
                                    [server] => cloudflare
                                    [cf-ray] => 7bbd2f51dcad7a48-DUS
                                    [alt-svc] => h3=":443"; ma=86400, h3-29=":443"; ma=86400
                                )

                        )

                    [Body] => {"exc_type":"ValidationError","exception":"frappe.exceptions.ValidationError: No changes made because old and new name are the same.","exc":"[\"Traceback (most recent call last):\\n  File \\\"apps/frappe/frappe/app.py\\\", line 66, in application\\n    response = frappe.api.handle()\\n  File \\\"apps/frappe/frappe/api.py\\\", line 54, in handle\\n    return frappe.handler.handle()\\n  File \\\"apps/frappe/frappe/handler.py\\\", line 45, in handle\\n    data = execute_cmd(cmd)\\n  File \\\"apps/frappe/frappe/handler.py\\\", line 83, in execute_cmd\\n    return frappe.call(method, **frappe.form_dict)\\n  File \\\"apps/frappe/frappe/__init__.py\\\", line 1607, in call\\n    return fn(*args, **newargs)\\n  File \\\"apps/erpnext/erpnext/erpnext_integrations/connectors/woocommerce_connection.py\\\", line 30, in order\\n    _order(*args, **kwargs)\\n  File \\\"apps/erpnext/erpnext/erpnext_integrations/connectors/woocommerce_connection.py\\\", line 62, in _order\\n    link_customer_and_address(raw_billing_data, raw_shipping_data, customer_name)\\n  File \\\"apps/erpnext/erpnext/erpnext_integrations/connectors/woocommerce_connection.py\\\", line 84, in link_customer_and_address\\n    frappe.rename_doc(\\\"Customer\\\", old_name, customer_name)\\n  File \\\"apps/frappe/frappe/__init__.py\\\", line 1313, in rename_doc\\n    return rename_doc(\\n  File \\\"apps/frappe/frappe/model/rename_doc.py\\\", line 154, in rename_doc\\n    new = validate_rename(\\n  File \\\"apps/frappe/frappe/model/rename_doc.py\\\", line 357, in validate_rename\\n    frappe.throw(_(\\\"No changes made because old and new name are the same.\\\").format(old, new))\\n  File \\\"apps/frappe/frappe/__init__.py\\\", line 525, in throw\\n    msgprint(\\n  File \\\"apps/frappe/frappe/__init__.py\\\", line 493, in msgprint\\n    _raise_exception()\\n  File \\\"apps/frappe/frappe/__init__.py\\\", line 442, in _raise_exception\\n    raise raise_exception(msg)\\nfrappe.exceptions.ValidationError: No changes made because old and new name are the same.\\n\"]","_server_messages":"[\"{\\\"message\\\": \\\"No changes made because old and new name are the same.\\\", \\\"title\\\": \\\"Botschaft\\\", \\\"indicator\\\": \\\"red\\\", \\\"raise_exception\\\": 1}\"]"}
                )

        )

)

for anyone else having this issue,
TLDR; When saving the webhook on woocommerce is returns 500
This is because on the frappe end.It fails the verfication.

Frappe woocommerce endpoint has a method verify_request which compares base64 encode of the secret in woocommerce settings with a header X-Wc-Webhook-Signature which os supposed to be in the headers sent with the request.

Woocommerce doesnt send this header when creating and saving webhooks. So the verification always fails and returns a 500

So you can ignore error and still go ahead to use it the webhook, it sends this header for actual events

Hello

In my case Woocommerce webhook gets a 500 response from the ERPNext server, and no records are updated in ERPNext. API testing suggests it might be OK and the view of the Forum seems to be that the 500 error is anomolous.

But I’m interested in your comments about “config” requirements in ERPNext that are required for the integration to work.

Could you provide details please.