No permission for DocType after bench update

Hi All,

I did a ‘bench update’ for my ERPNext instance and I am getting the message ‘No permission for DocType’ for some doc types. For example, I tried creating a Payment entry and when Party Type Customer or Supplier is selected I am getting the message No permission for DocType.

I am on ERPNext: v13.14.0 (version-13) and Frappe Framework: v13.14.0 (version-13)

This user had the permissions before and no changes to the user permissions. All I did was a bench update.

Following is the info I am seeing in the browser.

Failed to load resource: the server responded with a status of 403 (FORBIDDEN) request.js:418 Traceback (most recent call last): File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 68, in application response = frappe.api.handle() File "/home/frappe/frappe-bench/apps/frappe/frappe/api.py", line 55, in handle return frappe.handler.handle() File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 31, in handle data = execute_cmd(cmd) File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 67, in execute_cmd return frappe.call(method, **frappe.form_dict) File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1207, in call return fn(*args, **newargs) File "/home/frappe/frappe-bench/apps/frappe/frappe/client.py", line 86, in get_value frappe.throw(_("No permission for {0}").format(doctype), frappe.PermissionError) File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 438, in throw msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable, wide=wide, as_list=as_list) File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 417, in msgprint _raise_exception() File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 371, in _raise_exception raise raise_exception(msg) frappe.exceptions.PermissionError: No permission for DocType

The HTTP 403 Forbidden message above is for following endpoint.
/api/method/frappe.client.get_value?doctype=DocType&fieldname=%5B"name"%5D&filters=Customer&_=1636618582590

As a solution I tried bench reset-perms but the issue still remains.

Please help.

I’m also experiencing the same issue. I believe its a bug that came with updating to v13.14.0.

I guess so, tried many ways and no luck. Anyone?

I was able to fix the issue by downgrading to v13.13.0. Following are the steps I followed.

  1. Moved both frappe and erpnext apps to v13.13.0 tag
    cd frappe-bench/apps/frappe
    git fetch --all --tags --prune
    git checkout tags/v13.13.0
    cd frappe-bench/apps/erpnext
    git fetch --all --tags --prune
    git checkout tags/v13.13.0

  2. cd ../..
    bench build

  3. Restarted all services
    sudo supervisorctl restart all

Hope this helps anyone who has the issue.

3 Likes

v13.14 - Seeing No Permission on Doctype (specifically for payment entry - when trying to select Party-Type - Supplier or Customer in drop-down list).Strangely same user is able to select supplier for posting purchase invoice and customer for posting sales invoice…they have permission for Supplier and Customer - I double checked numerous times. So strange - permission error for Supplier or Customer - seems specific to Payment Entry - and only change is the version update.

Our Payment Entry doctype does not have any linked documents in section below. We have not modified it - Will appreciate it if someone can check if their payment entry doctype has linked documents below? (under customization - doctype - payment entry). Appreciate your help.

My advice is to downgrade to 13.13 for now. I did and it worked.

New update just pushed - 13.14.1 - will test it out first.

v13.14.1 - issue seems fixed - based on my initial test. actual user will test and reconfirm.

Thanks!

Dear @tglk,

Thank you for the help.
I executed your commands and received the user permissions successfully.
But I’m not able to update bench or requirements.
Request your help. Thanks.

1 Like

Yes, once you checkout an old tag, you won’t be able to proceed with the bench update path. All, I know is that I have to pull changes for each and every app manually using git pull then run a bench build and finally, migrate whatever the sites using bench --site your.sitename.com migrate

I am not using bench update anymore. Even for Frappe and ERPNext apps, I would do the same.

1 Like