Kombu Exception Content Disallowed - celery

Whenever celery is getting a task to run I am getting an exception
Pool callback raised exception: ContentDisallowed('Refusing to deserialize untrusted content of type pickle (application/x-python-serialize)',)
Traceback (most recent call last):
File "/Users/fulfil/venv/lib/python3.5/site-packages/kombu/utils/objects.py", line 42, in __get__
return obj.__dict__[self.__name__]
KeyError: 'chord'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/fulfil/venv/lib/python3.5/site-packages/kombu/utils/objects.py", line 42, in __get__
return obj.__dict__[self.__name__]
KeyError: '_payload'
I am using Celery==4.1.1 (latentcall) and kombu==4.2.1 version
can someone please help me out.

Related

error >>> (most likely due to a circular import)

C:\Users\Lenovo>python next.py
Traceback (most recent call last):
File "C:\Users\Lenovo\next.py", line 1, in <module>
import pywhatkit
File "C:\Users\Lenovo\pywhatkit.py", line 2, in <module>
pywhatkit.sendwhatmsg("+917878807006", "Hi", 10, 24)
AttributeError: partially initialized module 'pywhatkit' has no attribute 'sendwhatmsg' (most likely due to a circular import)
tell me how to resolve it
and my file name is not same as module name

'ValueError' object has no attribute '_render_traceback_'

While using dpkt to parser a UDP pcap file, got the following error message:
with open('file.pcap', 'rb') as fopen:
pcap = dpkt.pcap.Reader(fopen)
for timestamp, buf in pcap:
print (timestamp)
ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.
Traceback (most recent call last):
ValueError: read of closed file
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
AttributeError: 'ValueError' object has no attribute 'render_traceback'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
AssertionError
The file is automatically closed when leaving the with open(...) ... block:
with open('file.pcap', 'rb') as fopen:
# still open here
pcap = dpkt.pcap.Reader(fopen)
# automatically closed here
for timestamp, buf in pcap:
print (timestamp)
Thus, you need to put your pcap reading into the same block where the file was opened:
with open('file.pcap', 'rb') as fopen:
pcap = dpkt.pcap.Reader(fopen)
for timestamp, buf in pcap:
print (timestamp)

Syntax Error while building ns3.29 on ubuntu 18.04.4

I've installed all per-requisites from. Build fails with the following error by using ./waf command.
Traceback (most recent call last):
File "/usr/lib/python3.6/py_compile.py", line 125, in compile
_optimize=optimize)
File "<frozen importlib._bootstrap_external>", line 741, in source_to_code
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/local/lib/python3/dist-packages/visualizer/visualizer/svgitem.py", line 123
raise AttributeError, 'unknown property %s' % pspec.name
^
SyntaxError: invalid syntax
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "/usr/lib/python3.6/py_compile.py", line 129, in compile
raise py_exc
py_compile.PyCompileError: File "/usr/local/lib/python3/dist-packages/visualizer/visualizer/svgitem.py", line 123
raise AttributeError, 'unknown property %s' % pspec.name
^
SyntaxError: invalid syntax
I will appreciate any help. Thank you.
You can disable python. First you need to clean your previous failed build and then configure by disabling the python.
./waf distclean
./waf --disable-python configure
./waf

regarding a py4j exception

I have installed Java 11 and Python 3 on CentOS. Trying to run a code that worked perfectly fine on a Windows environment. Getting this exception:
ERROR:root:Exception while sending command.
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/py4j/java_gateway.py", line 1188, in
send_command
raise Py4JNetworkError("Answer from Java side is empty")
py4j.protocol.Py4JNetworkError: Answer from Java side is empty
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/py4j/java_gateway.py", line 1014, in send_command
response = connection.send_command(command)
File "/usr/lib/python3.4/site-packages/py4j/java_gateway.py", line 1193, in send_command
"Error while receiving", e, proto.ERROR_ON_RECEIVE)
py4j.protocol.Py4JNetworkError: Error while receiving
Traceback (most recent call last):
File "WordInformation.py", line 493, in
status = read_from_source("../Corpora/Bhandarkar Oriental Research Books")
File "WordInformation.py", line 473, in read_from_source
author, year)
File "WordInformation.py", line 381, in fetch_from_hwn
return read_store_properties(word, file, sentence, source, category, author,
year);
File "WordInformation.py", line 79, in read_store_properties
properties["synsets"] = get_other_props(word)
File "WordInformation.py", line 226, in get_other_props
output = gateway.jvm.Properties.getProperties(word)
File "/usr/lib/python3.4/site-packages/py4j/java_gateway.py", line 1286, in
call
answer, self.gateway_client, self.target_id, self.name)
File "/usr/lib/python3.4/site-packages/py4j/protocol.py", line 336, in
get_return_value
format(target_id, ".", name))
py4j.protocol.Py4JError: An error occurred while calling
z:in.ac.iitb.cfilt.jhwnl.examples.Properties.getProperties
Initialised the gateway as follows:
gateway = JavaGateway.launch_gateway(classpath="/home/gayatri/Code/hindiwn.jar")
Is this because of some dependency? I have set the JAVA_HOME and updated the PATH variable.
I don't have the reputation to comment, but
Answer from Java side is empty
But this error indicates that the Java code is not reachable.
Just to verify basic steps
1) Be sure that the java program is running
2) Be sure that you run the Python script after the java code is running
3) The java program is running the entire time.
If you are doing those two things, then an issue may be that the operating system may be already using a port.
You can try
Java
'GatewayServerBuilder server = new GatewayServerBuilder().javaPort(1001).build()'
'server.start()'
Python
java = JavaGateway(gateway_parameters=GatewayParameters(port=1001))

Updating rows of a column with list of values in PostgreSQL by psychopg2

I have a table environment with a column noise, I need to update all rows in the noise column, with a list of values, new_dB_values_list with len(new_dB_values_list) = no. of rows.
My code is this:
PsqlCon = psycopg2.connect(host="xx.xxx.xxx.xx", dbname='all_green', user='xxxx' , password='yzzxxx')
con = PsqlCon.cursor()
con.execute("""UPDATE environment SET noise new_dB_values_list;""")
What am I doing wrong, what is the correct method. Thanks.
Getting error:
ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.
Traceback (most recent call last):
psycopg2.ProgrammingError: syntax error at or near "new_dB_values_list"
LINE 1: UPDATE environment SET noise new_dB_values_list;
^
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
AttributeError: 'ProgrammingError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
AssertionError