Enhancement-configs not found on latest branches

Hi, I’m having the following error when trying the web upgrade command.

Traceback (most recent call last):
  File "/usr/local/bin/sentry", line 10, 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 35, in inner
    configure()
  File "/usr/local/lib/python2.7/site-packages/sentry/runner/__init__.py", line 125, in configure
    configure(ctx, py, yaml, skip_service_validation)
  File "/usr/local/lib/python2.7/site-packages/sentry/runner/settings.py", line 156, in configure
    skip_service_validation=skip_service_validation
  File "/usr/local/lib/python2.7/site-packages/sentry/runner/initializer.py", line 319, in initialize_app
    register_plugins(settings)
  File "/usr/local/lib/python2.7/site-packages/sentry/runner/initializer.py", line 23, in register_plugins
    from sentry.plugins import plugins
  File "/usr/local/lib/python2.7/site-packages/sentry/plugins/__init__.py", line 20, in <module>
    from sentry.plugins.base import *  # NOQA
  File "/usr/local/lib/python2.7/site-packages/sentry/plugins/base/__init__.py", line 10, in <module>
    from .bindings import BindingManager
  File "/usr/local/lib/python2.7/site-packages/sentry/plugins/base/bindings.py", line 5, in <module>
    from sentry.plugins import providers
  File "/usr/local/lib/python2.7/site-packages/sentry/plugins/providers/__init__.py", line 5, in <module>
    import_submodules(globals(), __name__, __path__)
  File "/usr/local/lib/python2.7/site-packages/sentry/utils/imports.py", line 62, in import_submodules
    module = __import__(module_name, globals(), locals(), ['__name__'])
  File "/usr/local/lib/python2.7/site-packages/sentry/plugins/providers/dummy/__init__.py", line 5, in <module>
    import_submodules(globals(), __name__, __path__)
  File "/usr/local/lib/python2.7/site-packages/sentry/utils/imports.py", line 62, in import_submodules
    module = __import__(module_name, globals(), locals(), ['__name__'])
  File "/usr/local/lib/python2.7/site-packages/sentry/plugins/providers/dummy/repository.py", line 3, in <module>
    from sentry.plugins.providers.repository import RepositoryProvider
  File "/usr/local/lib/python2.7/site-packages/sentry/plugins/providers/repository.py", line 9, in <module>
    from sentry.api.serializers import serialize
  File "/usr/local/lib/python2.7/site-packages/sentry/api/__init__.py", line 4, in <module>
    from .client import ApiClient
  File "/usr/local/lib/python2.7/site-packages/sentry/api/client.py", line 8, in <module>
    from sentry.auth.superuser import Superuser
  File "/usr/local/lib/python2.7/site-packages/sentry/auth/__init__.py", line 3, in <module>
    from .provider import *  # NOQA
  File "/usr/local/lib/python2.7/site-packages/sentry/auth/provider.py", line 6, in <module>
    from .view import ConfigureView
  File "/usr/local/lib/python2.7/site-packages/sentry/auth/view.py", line 6, in <module>
    from sentry.web.frontend.base import BaseView
  File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/base.py", line 15, in <module>
    from sentry.api.serializers import serialize
  File "/usr/local/lib/python2.7/site-packages/sentry/api/serializers/__init__.py", line 4, in <module>
    from .models import *  # NOQA
  File "/usr/local/lib/python2.7/site-packages/sentry/api/serializers/models/__init__.py", line 5, in <module>
    import_submodules(globals(), __name__, __path__)
  File "/usr/local/lib/python2.7/site-packages/sentry/utils/imports.py", line 62, in import_submodules
    module = __import__(module_name, globals(), locals(), ['__name__'])
  File "/usr/local/lib/python2.7/site-packages/sentry/api/serializers/models/project.py", line 23, in <module>
    from sentry.grouping.strategies.configurations import DEFAULT_CONFIG as DEFAULT_GROUPING_CONFIG
  File "/usr/local/lib/python2.7/site-packages/sentry/grouping/strategies/__init__.py", line 19, in <module>
    _import_all()
  File "/usr/local/lib/python2.7/site-packages/sentry/grouping/strategies/__init__.py", line 16, in _import_all
    __import__('%s.%s' % (__name__, module))
  File "/usr/local/lib/python2.7/site-packages/sentry/grouping/strategies/message.py", line 8, in <module>
    from sentry.grouping.strategies.base import strategy
  File "/usr/local/lib/python2.7/site-packages/sentry/grouping/strategies/base.py", line 6, in <module>
    from sentry.grouping.enhancer import Enhancements
  File "/usr/local/lib/python2.7/site-packages/sentry/grouping/enhancer.py", line 416, in <module>
    ENHANCEMENT_BASES = _load_configs()
  File "/usr/local/lib/python2.7/site-packages/sentry/grouping/enhancer.py", line 409, in _load_configs
    for fn in os.listdir(base):
OSError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/site-packages/sentry/grouping/enhancement-configs'    

is there anything that I should do to avoid that error or are there any stable brach with Discovery/events browser enabled so I can play with it? ( I tried master and fix/auditlog)

How are you installing to get this?

I’m doing the following commands, using the code from https://github.com/getsentry/docker-sentry/tree/master/git , with some minor changes like editing the SENTRY_WEB_PORT to 9090

docker volume create --name=sentry-data && docker volume create --name=sentry-postgres
docker-compose build
docker-compose run --rm web upgrade #crash here

Using the following files

sentry.conf.py https://pastebin.com/Fudp7sTL
docker-compose.yml https://pastebin.com/MUu6JH1j

And I’m also trying on a fresh install to avoid any misconfiguration

Yeah, so we’re probably just missing something in packaging to cause those files to be collected. I can look into this.

But what are you getting out of running from git at this point? You’re probably going to have a hard time with that, especially if you’re looking into Discover and whatnot since those pieces require more infrastructure which isn’t really packaged up yet.

1 Like

I was playing with snuba, clickhouse, zookeper and Kafka to see what I could archive, it’s quite hard without any docs, but it’s Always good to learn new tech.

Sorry for the late reply. @ibm5155 - I have landed this PR a few days before you got the error: https://github.com/getsentry/sentry/pull/13382 which renames the files under that directory. Can this be related?

I don’t think so, I tried to run the web upgrade on docker pointing to master yesterday, and the same error is still present.

EDIT: This could be due to the fact that im running docker on Windows?
EDIT2: Also happens on Ubuntu

Ah, I’m also using Windows and before that patch, I couldn’t even check out the repo as that folder had files with : names in them. If you don’t mind, I’d recommend cloning the repo again (or just makes sure that folder is not excluded via any means like a sparse check out, which is what I did at the beginning).

Remember, for this to work on Windows, you need to check out a revision later than my PR :wink:

@ibm5155 - hit this issue myself when trying to build onpremise from latest git SHA and submitted a PR for the fix: https://github.com/getsentry/sentry/pull/13704

1 Like

@BYK Thank you!!
The issue got fixed, but now I faced another one haha (I’m using the git docker pointing to the fix-manifest branch, not the master)

If it helps I’ll share error message soon (I need to reset my docker setup)

Traceback (most recent call last):
  File "/usr/local/bin/sentry", line 10, 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/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/commands/upgrade.py", line 75, in upgrade
_upgrade(not noinput, traceback, verbosity, not no_repair)
  File "/usr/local/lib/python2.7/site-packages/sentry/runner/commands/upgrade.py", line 30, in _upgrade
ignore_ghost_migrations=True,
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 120, in call_command
return command.execute(*args, **defaults)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 661, in handle
return self.handle_noargs(**options)
  File "/usr/local/lib/python2.7/site-packages/south/management/commands/syncdb.py", line 114, in handle_noargs
self.sync_apps(['south'], app_name_to_app_map, options)
  File "/usr/local/lib/python2.7/site-packages/south/management/commands/syncdb.py", line 165, in sync_apps
cmd.sync_apps(connection, apps_to_sync)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 264, in sync_apps
cursor = connection.cursor()
  File "/usr/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 164, in cursor
cursor = self.make_cursor(self._cursor())
  File "/usr/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 44, in inner
return func(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/db/postgres/base.py", line 95, in _cursor
cursor = super(DatabaseWrapper, self)._cursor()
  File "/usr/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 135, in _cursor
self.ensure_connection()
  File "/usr/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
self.connect()
  File "/usr/local/lib/python2.7/site-packages/django/db/utils.py", line 98, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/usr/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
self.connect()
  File "/usr/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 119, in connect
self.connection = self.get_new_connection(conn_params)
  File "/usr/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 176, in get_new_connection
connection = Database.connect(**conn_params)
  File "/usr/local/lib/python2.7/site-packages/psycopg2/__init__.py", line 129, in connect
dsn = _ext.make_dsn(dsn, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/psycopg2/extensions.py", line 177, in make_dsn
parse_dsn(dsn)
django.db.utils.ProgrammingError: invalid dsn: invalid connection option "autocommit"

EDIT: removing the following code from the sentry.py seems to have “fixed” the second issue.

'OPTIONS': {
                'autocommit': True,
            },
1 Like

Hahaha, exactly the same thing happened to me: https://github.com/getsentry/onpremise/pull/195

I’m hoping to establish a nightly build and CI tests to prevent these from lingering around in the future. :wink:

PS: The fix landed on master so you can point it back to master now.

1 Like

Thank you for the support BYK, I managed to install sentry v10, of course many stuff didn’t work because I bet I didn’t configure snuba/clickhouse properly, still it’s funny to see it triggering errors because it couldn’t trigger or save an error event from itself ( and that’s a good system stress)

1 Like

I’ll start working on a snuba-enabled git setup soon so if you can wait for a few weeks, you should have something to play with :wink:

1 Like