Event streaming is really BUGGY!!
In another case my domains is https://mydomain.com
For some reason erpnext thinks its http://mydomain.com
according to this error
Traceback with variables (most recent call last):
File "apps/frappe/frappe/utils/background_jobs.py", line 162, in execute_job
method(**kwargs)
site = '104.237.128.00'
method = <function pull_from_node at 0x7ff02de30310>
event = None
job_name = 'frappe.event_streaming.doctype.event_producer.event_producer.pull_from_node'
kwargs = {'event_producer': 'http://mydomain.com'}
user = 'systemuser@thebantoo.com'
is_async = True
retry = 0
method_name = 'frappe.event_streaming.doctype.event_producer.event_producer.pull_from_node'
File "apps/frappe/frappe/event_streaming/doctype/event_producer/event_producer.py", line 234, in pull_from_node
event_producer = frappe.get_doc("Event Producer", event_producer)
event_producer = 'http://mydomain.com'
File "apps/frappe/frappe/__init__.py", line 1179, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
args = ('Event Producer', 'http://mydomain.com')
kwargs = {}
frappe = <module 'frappe' from 'apps/frappe/frappe/__init__.py'>
File "apps/frappe/frappe/model/document.py", line 74, in get_doc
return controller(*args, **kwargs)
args = ('Event Producer', 'http://mydomain.com')
kwargs = {}
doctype = 'Event Producer'
controller = <class 'frappe.event_streaming.doctype.event_producer.event_producer.EventProducer'>
File "apps/frappe/frappe/model/document.py", line 106, in __init__
self.load_from_db()
self = <EventProducer: http://mydomain.com>
args = ('Event Producer', 'http://mydomain.com')
kwargs = {}
__class__ = <class 'frappe.model.document.Document'>
File "apps/frappe/frappe/model/document.py", line 149, in load_from_db
frappe.throw(
self = <EventProducer: http://mydomain.com>
d = None
__class__ = <class 'frappe.model.document.Document'>
File "apps/frappe/frappe/__init__.py", line 525, in throw
msgprint(
msg = 'Event Producer http://mydomain.com not found'
exc = <class 'frappe.exceptions.DoesNotExistError'>
title = None
is_minimizable = False
wide = False
as_list = False
File "apps/frappe/frappe/__init__.py", line 493, in msgprint
_raise_exception()
title = None
as_table = False
as_list = False
indicator = 'red'
alert = False
primary_action = None
is_minimizable = False
wide = False
sys = <module 'sys' (built-in)>
out = {'message': 'Event Producer http://mydomain.com not found', 'title': 'Message', 'indicator': 'red', 'raise_exception': 1}
_raise_exception = <function msgprint.<locals>._raise_exception at 0x7ff02f11f2e0>
_strip_html_tags = <functools._lru_cache_wrapper object at 0x7ff02dd2b320>
inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'>
msg = 'Event Producer http://mydomain.com not found'
raise_exception = <class 'frappe.exceptions.DoesNotExistError'>
strip_html_tags = <function strip_html_tags at 0x7ff03080ac20>
File "apps/frappe/frappe/__init__.py", line 442, in _raise_exception
raise raise_exception(msg)
inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'>
msg = 'Event Producer http://mydomain.com not found'
raise_exception = <class 'frappe.exceptions.DoesNotExistError'>
frappe.exceptions.DoesNotExistError: Event Producer http://mydomain.com not found
So I’ll manually change this
apps/frappe/frappe/event_streaming/doctype/event_producer/event_producer.py
line 234, the last line below I’m changing http to https
@frappe.whitelist()
def pull_from_node(event_producer):
"""pull all updates after the last update timestamp from event producer site"""
event_producer = frappe.get_doc("Event Producer", event_producer.replace("http://", "https://"))