Sentry in kubernetes

hi,
i need help to install sentry in kubernetes cluster.
i have a redis container and a aws rds postgresql, these services have a dns, so i need only configurate de container sentry.

i dont want to install from helm.

Hi,

Based on what you shared, I’m guessing this is for v9.1.2 (since for v10+ you’d need a bunch more services). If that’s the case, you can check out our official repo to guide you: https://github.com/getsentry/onpremise/tree/9.1.2

You’d need to adapt this configuration for your specific k8s setup but that should be quite straightforward.

i have deployed the version https://github.com/getsentry/onpremise/blob/84861509ae097c11892d29da4739a4758bcc8a84/Dockerfile

i have run sentry upgrade and in my database i can see 153 tables

but i get de error:

5:55:24 [WARNING] sentry.utils.geo: settings.GEOIP_PATH_MMDB not configured.

22/05/2020 12:55:32 15:55:32 [INFO] sentry.plugins.github: apps-not-configured

22/05/2020 12:55:32 *** Starting uWSGI 2.0.18 (64bit) on [Fri May 22 15:55:32 2020] ***

22/05/2020 12:55:32 compiled with version: 6.3.0 20170516 on 19 October 2019 09:00:01

22/05/2020 12:55:32 os: Linux-4.15.0-1051-aws #53-Ubuntu SMP Wed Sep 18 13:35:53 UTC 2019

22/05/2020 12:55:32 nodename: sentry-5cff6cd6f-mz8zl

22/05/2020 12:55:32 machine: x86_64

22/05/2020 12:55:32 clock source: unix

22/05/2020 12:55:32 detected number of CPU cores: 4

22/05/2020 12:55:32 current working directory: /usr/src/sentry

22/05/2020 12:55:32 detected binary path: /usr/local/bin/uwsgi

22/05/2020 12:55:32 !!! no internal routing support, rebuild with pcre support !!!

22/05/2020 12:55:32 your memory page size is 4096 bytes

22/05/2020 12:55:32 detected max file descriptor number: 1048576

22/05/2020 12:55:32 lock engine: pthread robust mutexes

22/05/2020 12:55:32 thunder lock: enabled

22/05/2020 12:55:32 uwsgi socket 0 bound to TCP address 0.0.0.0:9000 fd 3

22/05/2020 12:55:32 Python version: 2.7.16 (default, Oct 17 2019, 07:46:47) [GCC 6.3.0 20170516]

22/05/2020 12:55:32 Set PythonHome to /usr/local

22/05/2020 12:55:33 Python main interpreter initialized at 0x55769c5070f0

22/05/2020 12:55:33 python threads support enabled

22/05/2020 12:55:33 your server socket listen backlog is limited to 100 connections

22/05/2020 12:55:33 your mercy for graceful operations on workers is 60 seconds

22/05/2020 12:55:33 setting request body buffering size to 65536 bytes

22/05/2020 12:55:33 mapped 1924480 bytes (1879 KB) for 12 cores

22/05/2020 12:55:33 *** Operational MODE: preforking+threaded ***

22/05/2020 12:55:33 spawned uWSGI master process (pid: 16)

22/05/2020 12:55:33 spawned uWSGI worker 1 (pid: 20, cores: 4)

22/05/2020 12:55:33 spawned uWSGI worker 2 (pid: 21, cores: 4)

22/05/2020 12:55:33 spawned uWSGI worker 3 (pid: 22, cores: 4)

22/05/2020 12:55:39 15:55:39 [WARNING] sentry.utils.geo: settings.GEOIP_PATH_MMDB not configured.

22/05/2020 12:55:39 15:55:39 [WARNING] sentry.utils.geo: settings.GEOIP_PATH_MMDB not configured.

22/05/2020 12:55:40 15:55:40 [WARNING] sentry.utils.geo: settings.GEOIP_PATH_MMDB not configured.

22/05/2020 12:56:08 15:56:08 [INFO] sentry.plugins.github: apps-not-configured

22/05/2020 12:56:09 WSGI app 0 (mountpoint='') ready in 36 seconds on interpreter 0x55769c5070f0 pid: 20 (default app)

22/05/2020 12:56:10 15:56:10 [INFO] sentry.plugins.github: apps-not-configured

22/05/2020 12:56:10 15:56:10 [INFO] sentry.plugins.github: apps-not-configured

22/05/2020 12:56:10 WSGI app 0 (mountpoint='') ready in 37 seconds on interpreter 0x55769c5070f0 pid: 22 (default app)

22/05/2020 12:56:10 WSGI app 0 (mountpoint='') ready in 37 seconds on interpreter 0x55769c5070f0 pid: 21 (default app)

22/05/2020 12:56:29 10.53.110.163 - - [22/May/2020:15:56:28 +0000] "GET / HTTP/1.1" 302 470 "-" "kube-probe/1.16"

22/05/2020 12:56:30 Traceback (most recent call last):

22/05/2020 12:56:30 File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 112, in get_response

22/05/2020 12:56:30 response = wrapped_callback(request, *callback_args, **callback_kwargs)

22/05/2020 12:56:30 File "/usr/local/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in view

22/05/2020 12:56:30 return self.dispatch(request, *args, **kwargs)

22/05/2020 12:56:30 File "/usr/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 57, in wrapped_view

22/05/2020 12:56:30 return view_func(*args, **kwargs)

22/05/2020 12:56:30 File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/base.py", line 225, in dispatch

22/05/2020 12:56:30 return self.handle(request, *args, **kwargs)

22/05/2020 12:56:30 File "/usr/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 52, in _wrapped_view_func

22/05/2020 12:56:30 response = view_func(request, *args, **kwargs)

22/05/2020 12:56:30 File "/usr/local/lib/python2.7/site-packages/django/db/transaction.py", line 371, in inner

22/05/2020 12:56:30 return func(*args, **kwargs)

22/05/2020 12:56:30 File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/auth_login.py", line 193, in handle

22/05/2020 12:56:30 return super(AuthLoginView, self).handle(request, *args, **kwargs)

22/05/2020 12:56:30 File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/base.py", line 238, in handle

22/05/2020 12:56:30 return super(BaseView, self).dispatch(request, *args, **kwargs)

22/05/2020 12:56:30 File "/usr/local/lib/python2.7/site-packages/django/views/generic/base.py", line 87, in dispatch

22/05/2020 12:56:30 return handler(request, *args, **kwargs)

22/05/2020 12:56:30 File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/auth_login.py", line 211, in get

22/05/2020 12:56:30 org = Organization.get_default()

22/05/2020 12:56:30 File "/usr/local/lib/python2.7/site-packages/sentry/models/organization.py", line 164, in get_default

22/05/2020 12:56:30 )[0]

22/05/2020 12:56:30 File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 132, in __getitem__

22/05/2020 12:56:30 return list(qs)[0]

22/05/2020 12:56:30 IndexError: list index out of range

22/05/2020 12:56:30 15:56:30 [ERROR] django.request: Internal Server Error: /auth/login/ (status_code=500 request=<WSGIRequest: GET u'/auth/login/'>)

22/05/2020 12:56:30 10.53.110.163 - - [22/May/2020:15:56:29 +0000] "GET /auth/login/ HTTP/1.1" 500 5583 "http://10.42.224.81:9000/" "kube-probe/1.16"

I think you don’t have the default user created, have you?

i have run sentry createuser
and i see this user in database but this error occurs:

Email: adm@gmail.com
Password: 
Repeat for confirmation: 
Should this user be a superuser? [y/N]: y
User created: adm@gmail.com
Traceback (most recent call last):
  File "/usr/local/bin/sentry", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/sentry/runner/__init__.py", line 162, in main
    cli(prog_name=get_prog(), obj={}, max_content_width=100)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/runner/decorators.py", line 36, in inner
    return ctx.invoke(f, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/runner/commands/createuser.py", line 95, in createuser
    org = Organization.get_default()
  File "/usr/local/lib/python2.7/site-packages/sentry/models/organization.py", line 164, in get_default
    )[0]
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 132, in __getitem__
    return list(qs)[0]
IndexError: list index out of range
root@sentry-786b4dfdf-8d4l6:/usr/src/sentry#

Yeah, I think your migrations did not complete properly. Have you successfully run sentry upgrade?

Btw. can you please wrap your logs in code blocks (surround them with ```) so they become easier to read?

i think that i have sucessfully completed sentry upgrade,

root@sentry-69bd7c645c-mgzkp:/usr/src/sentry# sentry upgrade
19:30:17 [WARNING] sentry.utils.geo: settings.GEOIP_PATH_MMDB not configured.
19:30:29 [INFO] sentry.plugins.github: apps-not-configured
Syncing…
Creating tables …
Installing custom SQL …
Installing indexes …
Installed 0 object(s) from 0 fixture(s)
Migrating…
Running migrations for sentry:

  • Nothing to migrate.
    Running migrations for sentry.nodestore:
  • Nothing to migrate.
    Running migrations for sentry.search:
  • Nothing to migrate.
    Running migrations for social_auth:
  • Nothing to migrate.
    Running migrations for sentry.tagstore:
  • Nothing to migrate.
    Running migrations for sentry_plugins.hipchat_ac:
  • Nothing to migrate.
    Running migrations for sentry_plugins.jira_ac:
  • Nothing to migrate.

Synced:

django.contrib.admin
django.contrib.auth
django.contrib.contenttypes
django.contrib.messages
django.contrib.sessions
django.contrib.sites
django.contrib.staticfiles
crispy_forms
debug_toolbar
rest_framework
sentry.plugins.sentry_interface_types
sentry.plugins.sentry_mail
sentry.plugins.sentry_urls
sentry.plugins.sentry_useragents
sentry.plugins.sentry_webhooks
sudo
south

Migrated:

  • sentry
  • sentry.nodestore
  • sentry.search
  • social_auth
  • sentry.tagstore
  • sentry_plugins.hipchat_ac
  • sentry_plugins.jira_ac
    Creating missing DSNs
    Correcting Group.num_comments counter
    root@sentry-69bd7c645c-mgzkp:/usr/src/sentry#

how i can verify in database if all data is correct?

hy BYK,

declaring ENV SENTRY_SINGLE_ORGANIZATION = false, an application started.

user creation returns a message:
User created: user@teste.com.br
Unhandled exception in the thread started by <Thread chaining method .__ bootstrap of <Thread (Thread-1, stopped daemon 139886471210752) >>
Error in sys.excepthook:
Traceback (most recent last call):
File “/usr/local/lib/python2.7/site-packages/sentry_sdk/integrations/excepthook.py”, line 53, at sentry_sdk_excepthook
hub = Hub.current
File “/usr/local/lib/python2.7/site-packages/sentry_sdk/hub.py”, line 113, in the current version
rv = _local.get (none)
root @ sentry-65844f76cb-t5h2z: / usr / src / sentry #

I think something went wrong during your initial migration, causing certain signals to not work, hence the absence of the default organization.

I recommend starting over from a clean slate. If you want to try, you may try running this command in sentry shell: https://github.com/getsentry/sentry/blob/0fffc30f1455a23f98e76240fb1bf9de7ef81e71/src/sentry/receivers/core.py#L46-L51

from django.conf import settings
from sentry.receivers.core import create_default_project

create_default_project(id=settings.SENTRY_PROJECT, name='Internal', slug='internal', verbosity=2)

thanks BYK,

how i can resolve that error;
[Background workers haven’t checked in recently. This is likely an issue with your configuration or the workers aren’t running]

i run (sentry run worker and sentry run cron) but de error persist.

They should go away in 5-10 minutes as the workers and cron start communicating with Sentry.