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.

Python 3.8 threading is crashing: `TypeError: run() takes 1 positional argument`

See original GitHub issue

Hi all,

We upgraded to Python 3.8 and the new sentry, and we are seeing this error TypeError: run() takes 1 positional argument but 3 were given We are also seeing it showing sometimes as TypeError: run() takes 1 positional argument but 2 were given

We are also using ddtrace.

Exception ignored in thread started by: <bound method Thread._bootstrap of <Thread(AgentWriter, started daemon 140486491760384)>>
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/threading.py", line 890, in _bootstrap
    self._bootstrap_inner()
  File "/usr/local/lib/python3.8/threading.py", line 924, in _bootstrap_inner
Exception ignored in thread started by: <bound method Thread._bootstrap of <Thread(AgentWriter, started daemon 140486500153088)>>
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/threading.py", line 890, in _bootstrap
    self._bootstrap_inner()
  File "/usr/local/lib/python3.8/threading.py", line 924, in _bootstrap_inner
    del _limbo[self]
KeyError: <Thread(AgentWriter, started daemon 140486500153088)>
    del _limbo[self]
KeyError: <Thread(AgentWriter, started daemon 140486500153088)>
Exception in thread AgentWriter:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.8/site-packages/sentry_sdk/integrations/threading.py", line 69, in run
    reraise(*_capture_exception())
  File "/usr/local/lib/python3.8/site-packages/sentry_sdk/_compat.py", line 57, in reraise
    raise value
  File "/usr/local/lib/python3.8/site-packages/sentry_sdk/integrations/threading.py", line 67, in run
    return old_run_func(self, *a, **kw)
  File "/usr/local/lib/python3.8/site-packages/sentry_sdk/integrations/threading.py", line 69, in run
    reraise(*_capture_exception())
  File "/usr/local/lib/python3.8/site-packages/sentry_sdk/_compat.py", line 57, in reraise
    raise value
  File "/usr/local/lib/python3.8/site-packages/sentry_sdk/integrations/threading.py", line 67, in run
    return old_run_func(self, *a, **kw)
  File "/usr/local/lib/python3.8/site-packages/sentry_sdk/integrations/threading.py", line 69, in run
    reraise(*_capture_exception())
  File "/usr/local/lib/python3.8/site-packages/sentry_sdk/_compat.py", line 57, in reraise
    raise value
  File "/usr/local/lib/python3.8/site-packages/sentry_sdk/integrations/threading.py", line 67, in run
    return old_run_func(self, *a, **kw)
TypeError: run() takes 1 positional argument but 3 were given

Does anyone know why this issue is happening?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:8
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
untitakercommented, Oct 19, 2020

@musterjunk I think this issue is unrelated

0reactions
jcshottcommented, Dec 6, 2021

We’re seeing this error in python 3.7.10 & sentry_sdk-1.5.0 any updates on a fix?

I did find this error log that makes me think there is some conflict with ddtrace and sentry. but we utilize both services so would hope to have a solution for them to work together:

Traceback (most recent call last):
  File "/usr/local/lib64/python3.7/site-packages/ddtrace/span.py", line 153, in finish
    self.tracer.record(self._context)
  File "/usr/local/lib64/python3.7/site-packages/ddtrace/tracer.py", line 526, in record
    self.write(trace)
  File "/usr/local/lib64/python3.7/site-packages/ddtrace/tracer.py", line 543, in write
    self.writer.write(spans=spans)
  File "/usr/local/lib64/python3.7/site-packages/ddtrace/internal/writer.py", line 83, in write
    self.start()
  File "/usr/local/lib64/python3.7/site-packages/ddtrace/_worker.py", line 53, in start
    self._thread.start()
  File "/usr/local/lib/python3.7/site-packages/sentry_sdk/integrations/threading.py", line 54, in sentry_start
    return old_start(self, *a, **kw)  # type: ignore
  File "/usr/lib64/python3.7/threading.py", line 848, in start
    raise RuntimeError("threads can only be started once")
RuntimeError: threads can only be started once
Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError in Threading. function takes x positional argument ...
The args kwarg of threading.Thread expects an iterable, and each element in that iterable is being passed to the target function.
Read more >
multiprocessing breaks when payload fails to unpickle
loads(buf.getbuffer()) TypeError: __init__() takes 1 positional argument but 4 were given After this the worker has crashed and every task ...
Read more >
Positional-Only Arguments - Real Python
float(x="3.8") Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: float() takes no keyword arguments.
Read more >
positional argument follows keyword argument [discord.py]
FFmpegPCMAudio(audio), after=lambda e: asyncio.run_coroutine_threadsafe(tracklooper(ctx, timesPlayedTrack+1)), bot.loop) ^ SyntaxError: positional argument ...
Read more >
Troubleshooting and tips — Numba 0.50.1 documentation
There can be various reasons why Numba cannot compile your code, and raises an error instead. One common reason is that your code...
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