TypeError: object() takes no parameters

hello, i have encounterd some problem on setup sentry on self-hosting.

env

i have installed sentry using source code instead of docker. when i try to send a event by golang-sdk, there is some error found in sentry work process(sentry run worker). the error details is listed below.

06:39:20 [INFO] celery.worker.strategy: Received task: sentry.tasks.store.save_event[6c3541d3-0db4-4ffb-a302-079fa0ce1671]
Traceback (most recent call last):
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry_sdk/serializer.py", line 224, in _serialize_node
    remaining_breadth=remaining_breadth,
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry_sdk/serializer.py", line 285, in _serialize_node_impl
    elif isinstance(obj, Mapping):
  File "/usr/local/python2.7.16/lib/python2.7/abc.py", line 131, in __instancecheck__
    subclass = getattr(instance, '__class__', None)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/django/utils/functional.py", line 238, in inner
    self._setup()
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/utils/services.py", line 97, in _setup
    instance = backend(**self._options)
TypeError: object() takes no parameters
06:39:20 [ERROR] sentry_sdk.errors: Internal error in sentry_sdk
Traceback (most recent call last):
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry_sdk/serializer.py", line 224, in _serialize_node
    remaining_breadth=remaining_breadth,
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry_sdk/serializer.py", line 285, in _serialize_node_impl
    elif isinstance(obj, Mapping):
  File "/usr/local/python2.7.16/lib/python2.7/abc.py", line 131, in __instancecheck__
    subclass = getattr(instance, '__class__', None)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/django/utils/functional.py", line 238, in inner
    self._setup()
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/utils/services.py", line 97, in _setup
    instance = backend(**self._options)
TypeError: object() takes no parameters
06:39:20 [ERROR] sentry_sdk.errors: Internal error in sentry_sdk
Traceback (most recent call last):
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry_sdk/serializer.py", line 224, in _serialize_node
    remaining_breadth=remaining_breadth,
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry_sdk/serializer.py", line 285, in _serialize_node_impl
    elif isinstance(obj, Mapping):
  File "/usr/local/python2.7.16/lib/python2.7/abc.py", line 131, in __instancecheck__
    subclass = getattr(instance, '__class__', None)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/django/utils/functional.py", line 238, in inner
    self._setup()
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/utils/services.py", line 97, in _setup
    instance = backend(**self._options)
TypeError: object() takes no parameters
06:39:20 [ERROR] sentry_sdk.errors: Internal error in sentry_sdk
Traceback (most recent call last):
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/celery/app/trace.py", line 412, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/celery/app/trace.py", line 704, in __protected_call__
    return self.run(*args, **kwargs)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry_sdk/integrations/celery.py", line 186, in _inner
    reraise(*exc_info)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry_sdk/integrations/celery.py", line 181, in _inner
    return f(*args, **kwargs)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/tasks/base.py", line 48, in _wrapped
    result = func(*args, **kwargs)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/tasks/store.py", line 845, in save_event
    _do_save_event(cache_key, data, start_time, event_id, project_id, **kwargs)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/tasks/store.py", line 759, in _do_save_event
    project_id, assume_normalized=True, start_time=start_time, cache_key=cache_key
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/utils/metrics.py", line 193, in inner
    return f(*args, **kwargs)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/event_manager.py", line 472, in save
    _eventstream_insert_many(jobs)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/utils/metrics.py", line 193, in inner
    return f(*args, **kwargs)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/event_manager.py", line 762, in _eventstream_insert_many
    skip_consume=job.get("raw", False),
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/utils/services.py", line 105, in <lambda>
    context[key] = (lambda f: lambda *a, **k: getattr(self, f)(*a, **k))(key)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/utils/services.py", line 73, in __getattr__
    self._setup()
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/utils/services.py", line 97, in _setup
    instance = backend(**self._options)
TypeError: object() takes no parameters
06:39:21 [ERROR] celery.app.trace: Task sentry.tasks.store.save_event[6c3541d3-0db4-4ffb-a302-079fa0ce1671] raised unexpected: TypeError('object() takes no parameters',) (data={u'internal': False, u'traceback': u'Traceback (most recent call last):\n  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/celery/app/trace.py", line 412, in trace_task\n    R = retval = fun(*args, **kwargs)\n  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/celery/app/trace.py", line 704, in __protected_call__\n    return self.run(*args, **kwargs)\n  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry_sdk/integrations/celery.py", line 186, in _inner\n    reraise(*exc_info)\n  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry_sdk/integrations/celery.py", line 181, in _inner\n    return f(*args, **kwargs)\n  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/tasks/base.py", line 48, in _wrapped\n    result = func(*args, **kwargs)\n  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/tasks/store.py", line 845, in save_event\n    _do_save_event(cache_key, data, start_time, event_id, project_id, **kwargs)\n  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/tasks/store.py", line 759, in _do_save_event\n    project_id, assume_normalized=True, start_time=start_time, cache_key=cache_key\n  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/utils/metrics.py", line 193, in inner\n    return f(*args, **kwargs)\n  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/event_manager.py", line 472, in save\n    _eventstream_insert_many(jobs)\n  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/utils/metrics.py", line 193, in inner\n    return f(*args, **kwargs)\n  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/event_manager.py", line 762, in _eventstream_insert_many\n    skip_consume=job.get("raw", False),\n  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/utils/services.py", line 105, in <lambda>\n    context[key] = (lambda f: lambda *a, **k: getattr(self, f)(*a, **k))(key)\n  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/utils/services.py", line 73, in __getattr__\n    self._setup()\n  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/utils/services.py", line 97, in _setup\n    instance = backend(**self._options)\nTypeError: object() takes no parameters\n', u'name': 'sentry.tasks.store.save_event', u'args': '()', u'kwargs': "{'event_id': 'bb717a2e5f1a407ba338c137ef02f612', 'project_id': 4L, 'start_time': 1604299159.0, 'cache_key': u'e:bb717a2e5f1a407ba338c137ef02f612:4', 'data': None}", u'description': u'raised unexpected', u'hostname': '3.gather.sentry.tt.bjs.p1staff.com', u'id': '6c3541d3-0db4-4ffb-a302-079fa0ce1671', u'exc': "TypeError('object() takes no parameters',)"})
06:39:21 [ERROR] sentry_sdk.errors: Unexpected status code: 403 (body:









<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta name="robots" content="NONE,NOARCHIVE">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="icon" type="image/png" href="https://sentry-web.tantanapp.com/_static/1604284096/sentry/images/favicon.png">

  <link rel="apple-touch-icon" href="https://sentry-web.tantanapp.com/_static/1604284096/sentry/images/logos/apple-touch-icon.png">
  <link rel="apple-touch-icon" sizes="76x76" href="https://sentry-web.tantanapp.com/_static/1604284096/sentry/images/logos/apple-touch-icon-76x76.png">
  <link rel="apple-touch-icon" sizes="120x120" href="https://sentry-web.tantanapp.com/_static/1604284096/sentry/images/logos/apple-touch-icon-120x120.png">
  <link rel="apple-touch-icon" sizes="152x152" href="https://sentry-web.tantanapp.com/_static/1604284096/sentry/images/logos/apple-touch-icon-152x152.png">

  <link rel="mask-icon" sizes="any" href="https://sentry-web.tantanapp.com/_static/1604284096/sentry/images/logos/logo-sentry.svg" color="#FB4226">

  <link href="/_static/1604284096/sentry/dist/sentry.css" rel="stylesheet"/>



  <title>CSRF Verification Failed | Sentry</title>

  <script>
    window.__initialData = {"languageCode":"en","csrfCookieName":"sc","features":[],"urlPrefix":"https://sentry-web.tantanapp.com","needsUpgrade":false,"privacyUrl":null,"isOnPremise":true,"gravatarBaseUrl":"https://secure.gravatar.com","dsn":"https://eda4cb1a7fc542589a0727a4f2614b77@sentry-web.tantanapp.com/1","version":{"current":"20.10.1","build":"20.10.1","upgradeAvailable":false,"latest":"20.10.1"},"termsUrl":null,"sentryConfig":{"dsn":"https://eda4cb1a7fc542589a0727a4f2614b77@sentry-web.tantanapp.com/1","release":null,"whitelistUrls":[],"environment":"production"},"apmSampling":0.0,"singleOrganization":true,"user":null,"invitesEnabled":true,"dsn_requests":"","lastOrganization":null,"messages":[],"userIdentity":{"ip_address":"106.75.70.10"},"isAuthenticated":false,"statuspage":null,"supportEmail":"chenchen@p1.com","distPrefix":"/_static/1604284096/sentry/dist/"};
  </script>



  <script src="/_static/1604284096/sentry/dist/vendor.js"></script>
  <script src="/_static/1604284096/sentry/dist/app.js" data-entry="true"></script>

  <script>
    // if the ads.js file loads below it will mark this variable as false
    window.adblockSuspected = true;
  </script>
  <script src="/_static/1604284096/sentry/js/ads.js"></script>

</head>

<body class=" narrow">

  <div class="app">




<div id="blk_alerts" class="messages-container"></div>
<script>
$(function(){
  ReactDOM.render(React.createFactory(SentryApp.SystemAlerts)({
     className: "alert-list"
  }), document.getElementById('blk_alerts'));
});
</script>
<div id="blk_indicators"></div>
<script>
$(function(){
  ReactDOM.render(React.createFactory(SentryApp.Indicators)({
     className: "indicators-container"
  }), document.getElementById('blk_indicators'));
});
</script>




    <div class="container">
      <div class="content">

<div class="pattern-bg"></div>
<section class="org-login">
  <div class="box box-modal">
    <div class="box-header">




        <a class="logo-with-action" href="/">

            <span class="icon-sentry-logo-full"></span>


        </a>

    </div>
    <div class="box-content with-padding">

    <section class="body">
        <div class="page-header">
            <h2>CSRF Verification Failed</h2>
        </div>

        <p>A required security token was not found or was invalid.</p>

        <p>If you're continually seeing this issue, try the following:</p>

        <ol>
          <li>Clear cookies (at least for Sentry's domain).</li>
          <li>Reload the page you're trying to submit (don't re-submit data).</li>
          <li>Re-enter the information, and submit the form again.</li>
        </ol>



        <p>Read more about <a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery">CSRF on Wikipedia</a>.</p>
    </section>

    </div>
  </div>
</section>

      </div>
    </div>
    <footer>
      <div class="container">

        <div class="pull-right">
          <a href="https://docs.sentry.io/api/">API</a>
          <a href="https://docs.sentry.io">Docs</a>
          <a href="https://github.com/getsentry/sentry" rel="noreferrer">Contribute</a>
          <a href="/out/">Migrate to SaaS</a>
        </div>
        <div class="version pull-left">Sentry 20.10.1 (20.10.1) </div>
        <a href="/" class="icon-sentry-logo"></a>

      </div>
    </footer>
  </div>



</body>
</html>
)

on the other hand, a 403 response found at sentry web,

Nov 02 14:39:21  sentry[74628]: 06:39:21 [WARNING] django.security.csrf: Forbidden (CSRF cookie not set.): /api/1/store/ (status_code=403 request=<WSGIRequest: POST u'/api/1/store/'>)
Nov 02 14:39:21  sentry[74628]: 10.189.31.77 - - [02/Nov/2020:06:39:21 +0000] "POST /api/1/store/ HTTP/1.1" 403 4937 "-" "sentry.python/0.17.8"

i really don’t known how to solve this and hope to get your help.

Thanks

the same error occured in post-process-forwarder start.

[root]$ /data/pyenv/venv2.7.16/bin/sentry --config /app/sentry/conf run post-process-forwarder --loglevel INFO


08:02:26 [WARNING] sentry.utils.geo: settings.GEOIP_PATH_MMDB not configured.
/data/pyenv/venv2.7.16/lib/python2.7/site-packages/OpenSSL/crypto.py:12: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
  from cryptography import x509
08:02:28 [INFO] sentry.plugins.github: apps-not-configured
Traceback (most recent call last):
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry_sdk/serializer.py", line 224, in _serialize_node
    remaining_breadth=remaining_breadth,
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry_sdk/serializer.py", line 285, in _serialize_node_impl
    elif isinstance(obj, Mapping):
  File "/usr/local/python2.7.16/lib/python2.7/abc.py", line 131, in __instancecheck__
    subclass = getattr(instance, '__class__', None)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/django/utils/functional.py", line 238, in inner
    self._setup()
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/utils/services.py", line 97, in _setup
    instance = backend(**self._options)
TypeError: object() takes no parameters
08:02:28 [ERROR] sentry_sdk.errors: Internal error in sentry_sdk
Traceback (most recent call last):
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry_sdk/serializer.py", line 224, in _serialize_node
    remaining_breadth=remaining_breadth,
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry_sdk/serializer.py", line 285, in _serialize_node_impl
    elif isinstance(obj, Mapping):
  File "/usr/local/python2.7.16/lib/python2.7/abc.py", line 131, in __instancecheck__
    subclass = getattr(instance, '__class__', None)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/django/utils/functional.py", line 238, in inner
    self._setup()
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/utils/services.py", line 97, in _setup
    instance = backend(**self._options)
TypeError: object() takes no parameters
08:02:28 [ERROR] sentry_sdk.errors: Internal error in sentry_sdk
Traceback (most recent call last):
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry_sdk/serializer.py", line 224, in _serialize_node
    remaining_breadth=remaining_breadth,
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry_sdk/serializer.py", line 285, in _serialize_node_impl
    elif isinstance(obj, Mapping):
  File "/usr/local/python2.7.16/lib/python2.7/abc.py", line 131, in __instancecheck__
    subclass = getattr(instance, '__class__', None)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/django/utils/functional.py", line 238, in inner
    self._setup()
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/utils/services.py", line 97, in _setup
    instance = backend(**self._options)
TypeError: object() takes no parameters
08:02:28 [ERROR] sentry_sdk.errors: Internal error in sentry_sdk
Traceback (most recent call last):
  File "/data/pyenv/venv2.7.16/bin/sentry", line 8, in <module>
    sys.exit(main())
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/runner/__init__.py", line 166, in main
    cli(prog_name=get_prog(), obj={}, max_content_width=100)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/runner/decorators.py", line 68, in inner
    return ctx.invoke(f, *args, **kwargs)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/runner/decorators.py", line 30, in inner
    return ctx.invoke(f, *args, **kwargs)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/runner/commands/run.py", line 294, in post_process_forwarder
    initial_offset_reset=options["initial_offset_reset"],
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/utils/services.py", line 105, in <lambda>
    context[key] = (lambda f: lambda *a, **k: getattr(self, f)(*a, **k))(key)
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/utils/services.py", line 73, in __getattr__
    self._setup()
  File "/data/pyenv/venv2.7.16/lib/python2.7/site-packages/sentry/utils/services.py", line 97, in _setup
    instance = backend(**self._options)
TypeError: object() takes no parameters

Regarding the 403 errors, seems like you are not running relay or have an issue forwarding relevant requests to relay as these calls should not be handled by sentry web.

Regarding the TypeError: object() takes no parameters error, seems like you have a configuration issue in your sentry.conf.py.