question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on saving of `Event Producer` : Server Error : frappe.exceptions.PermissionError: Not permitted

See original GitHub issue

Description of the issue

Event streaming doesnot work. As on save of Event Producer exception is thrown

Context information (for bug reports)

Output of bench version

erpnext 13.2.1
frappe 13.2.1

Steps to reproduce the issue

  1. Go to http://localhost:8002/app/event-producer/new-event-producer-1
  2. Fill up all the required fields
  3. Click onn save. It throws exception

Observed result

frappe.exceptions.PermissionError: Not permitted

Expected result

No error should be thrown on saving

Stacktrace / full error message

Traceback (most recent call last): File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 21, in savedocs doc.save() File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 284, in save return self._save(*args, **kwargs) File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 306, in _save self.insert() File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 230, in insert self.run_method(“before_insert”) File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 858, in run_method out = Document.hook(fn)(self, *args, **kwargs) File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1147, in composer return composed(self, method, *args, **kwargs) File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1130, in runner add_to_return_value(self, fn(self, *args, **kwargs)) File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 852, in <lambda> fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs) File “/home/frappe/frappe-bench/apps/frappe/frappe/event_streaming/doctype/event_producer/event_producer.py”, line 25, in before_insert self.create_event_consumer() File “/home/frappe/frappe-bench/apps/frappe/frappe/event_streaming/doctype/event_producer/event_producer.py”, line 77, in create_event_consumer params={‘data’: json.dumps(self.get_request_data())} File “/home/frappe/frappe-bench/apps/frappe/frappe/frappeclient.py”, line 299, in post_api return self.post_process(res) File “/home/frappe/frappe-bench/apps/frappe/frappe/frappeclient.py”, line 333, in post_process raise FrappeException(exc) frappe.frappeclient.FrappeException: FrappeClient Request Failed

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 54, 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 64, in execute_cmd is_whitelisted(method) File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 588, in is_whitelisted throw(_(“Not permitted”), PermissionError) File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 427, 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 406, in msgprint _raise_exception() File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 360, in _raise_exception raise raise_exception(msg) frappe.exceptions.PermissionError: Not permitted

request.js:387 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 54, 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 1169, in call return fn(*args, **newargs) File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 21, in savedocs doc.save() File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 284, in save return self._save(*args, **kwargs) File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 306, in _save self.insert() File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 230, in insert self.run_method(“before_insert”) File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 858, in run_method out = Document.hook(fn)(self, *args, **kwargs) File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1147, in composer return composed(self, method, *args, **kwargs) File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1130, in runner add_to_return_value(self, fn(self, *args, **kwargs)) File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 852, in <lambda> fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs) File “/home/frappe/frappe-bench/apps/frappe/frappe/event_streaming/doctype/event_producer/event_producer.py”, line 25, in before_insert self.create_event_consumer() File “/home/frappe/frappe-bench/apps/frappe/frappe/event_streaming/doctype/event_producer/event_producer.py”, line 77, in create_event_consumer params={‘data’: json.dumps(self.get_request_data())} File “/home/frappe/frappe-bench/apps/frappe/frappe/frappeclient.py”, line 299, in post_api return self.post_process(res) File “/home/frappe/frappe-bench/apps/frappe/frappe/frappeclient.py”, line 333, in post_process raise FrappeException(exc) frappe.frappeclient.FrappeException: FrappeClient Request Failed

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 54, 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 64, in execute_cmd is_whitelisted(method) File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 588, in is_whitelisted throw(_(“Not permitted”), PermissionError) File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 427, 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 406, in msgprint _raise_exception() File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 360, in _raise_exception raise raise_exception(msg) frappe.exceptions.PermissionError: Not permitted

(paste here)

Additional information

OS version / distribution, ERPNext install method, etc.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ascorbic-acidcommented, Jan 22, 2022

Hello, this issue is not related to Event Streaming but to FrappeClient, it got fixed recently, more info: https://github.com/frappe/frappe/pull/12998

0reactions
ruchamahabalcommented, Jan 19, 2022

Not able to replicate this issue locally. Seems to be production-specific. Will investigate. Does your event subscriber user have permission to create an Event Producer on the consumer site?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Permission Error Problems - ERPNext Documentation
To resolve this issue, I have assigned Account User permission to Read Territory master. Permission Manager. As per this permission update, User should...
Read more >
Sites volume permission error · Issue #803 · frappe ... - GitHub
I guess this happens when I try to setup a server as root user directly instead of using non-root user with docker permission....
Read more >
Fix list for IBM WebSphere Application Server V8.5
IBM WebSphere Application Server provides periodic fixes for the base and Network Deployment editions of release V8.5. The following is a complete listing ......
Read more >
Git - OpenForge
except Exception, e: print "--Error in:" + f + "--". print frappe.get_traceback(). @@ -119,10 +132,10 @@ def pack(target, sources, no_compress):. if not ......
Read more >
npm ERR! Error: EPERM: operation not permitted, rename
For me, I had another node process running, json-server in my case. Once I stopped that the package installed without error. – EddieB....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found