REST API DoesNotExistError | desk > tools returns Server Error

I was trying to test my whitelisted methods, but whenever I use the URL: http://localhost:8000/api/, it returns the following error:

Server Error
Traceback (most recent call last):
File “/home/ghadeer/frappe/frappe-bench/apps/frappe/frappe/”, line 60, in application
response = frappe.api.handle()
File “/home/ghadeer/frappe/frappe-bench/apps/frappe/frappe/”, line 127, in handle
raise frappe.DoesNotExistError

What is the problem ??

http://localhost:8000/api in the browser returns:

Page missing or moved
We are very sorry for this, but the page you are looking for is missing (this could be because of a typo in the address) or moved.

Any help ?!

Could you share your code?

What are you trying to do?

Actually the problem is not in my code, the same code was working with no errors.

There is another error that appears in the desk, tools >

Traceback (most recent call last):
File “/home/ghadeer/frappe/frappe-bench/apps/frappe/frappe/”, line 55, in application
response = frappe.handler.handle()
File “/home/ghadeer/frappe/frappe-bench/apps/frappe/frappe/”, line 19, in handle
File “/home/ghadeer/frappe/frappe-bench/apps/frappe/frappe/”, line 40, in execute_cmd
ret =, **frappe.form_dict)
File “/home/ghadeer/frappe/frappe-bench/apps/frappe/frappe/”, line 896, in call
return fn(*args, **newargs)
File “/home/ghadeer/frappe/frappe-bench/apps/frappe/frappe/desk/”, line 14, in get
data = get_data(module)
File “/home/ghadeer/frappe/frappe-bench/apps/frappe/frappe/desk/”, line 30, in get_data
data = build_config_from_file(module)
File “/home/ghadeer/frappe/frappe-bench/apps/frappe/frappe/desk/”, line 54, in build_config_from_file
data += get_config(app, module)

I can’t help you unless you share your code or explain what are you trying to do!

OK …

I have for example this method in my project:

def update_product(product_name,product_price,product_image,product_id):
    product = frappe.get_doc("products","%s" % (product_id))
    product.product_name = product_name
    product.product_price = product_price
    product.product_image = product_image

I used to call it using REST API like this:

and it was working very well, but now and after doing bench update, when I try the same link it returns:
404 Not found error

Not Found
Invalid method

and I am sure that the link is correct, so I started testing the api itself typing localhost:8000/api/ and it always give me server error that it does not exist !

The same is happening with all the methods that I am trying to call using REST api !!

Thank you for your help !

Dont use Remote Procedure Calls (RPC) for CRUD
Use REST API instead for update

try this as PUT request:


where is product_id = 000000008 :point_up_2:


data={"product_name": "xxxx","product_price":"yyyyy","product_image":"zzzzz"}

Thank you, it worked.

Glad it is works, you are welcome.