Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check to make sure schema has the right version #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amercader
Copy link
Member

No description provided.

@ChristianF88
Copy link

Hi guys, I'm running into the issue #13 and it seems like this pull request is ready to be merged? Any tips for me until it is? I want to run a ckan-docker 2.10 dev instance...

@duttonw
Copy link

duttonw commented Jan 30, 2025

Hi @ChristianF88 ,

see https://github.com/qld-gov-au/ckanext-validation/blob/master/.github/workflows/test-direct.yml#L30

          - ckan-version: "2.10"
            ckan-image: "2.10-py3.10"
            ckan-solr: "2.10-sol
...
    services:
      solr:
        image: ckan/ckan-solr:${{ matrix.ckan-solr }}
      postgres:
        image: ckan/ckan-postgres-dev:${{ matrix.ckan-version }}

per comments on #15

@ChristianF88
Copy link

Hi @duttonw, thanks for the advice, but I am actually already running with the image ckan/ckan-solr:2.10-solr9. Still I am getting:

Traceback (most recent call last):
  File "/usr/local/bin/ckan", line 8, in <module>
    sys.exit(ckan())
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1054, in main
    with self.make_context(prog_name, args, **extra) as ctx:
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 920, in make_context
    self.parse_args(ctx, args)
  File "/srv/app/src/ckan/ckan/cli/cli.py", line 121, in parse_args
    result = super().parse_args(ctx, args)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1613, in parse_args
    rest = super().parse_args(ctx, args)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1378, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 2360, in handle_parse_result
    value = self.process_value(ctx, value)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 2322, in process_value
    value = self.callback(ctx, self, value)
  File "/srv/app/src/ckan/ckan/cli/cli.py", line 131, in _init_ckan_config
    _add_ctx_object(ctx, value)
  File "/srv/app/src/ckan/ckan/cli/cli.py", line 140, in _add_ctx_object
    ctx.obj = CtxObject(path)
  File "/srv/app/src/ckan/ckan/cli/cli.py", line 57, in __init__
    self.app = make_app(raw_config)
  File "/srv/app/src/ckan/ckan/config/middleware/__init__.py", line 27, in make_app
    load_environment(conf)
  File "/srv/app/src/ckan/ckan/config/environment.py", line 69, in load_environment
    p.load_all()
  File "/srv/app/src/ckan/ckan/plugins/core.py", line 218, in load_all
    unload_all()
  File "/srv/app/src/ckan/ckan/plugins/core.py", line 268, in unload_all
    unload(*reversed(_PLUGINS))
  File "/srv/app/src/ckan/ckan/plugins/core.py", line 300, in unload
    plugins_update()
  File "/srv/app/src/ckan/ckan/plugins/core.py", line 210, in plugins_update
    environment.update_config()
  File "/srv/app/src/ckan/ckan/config/environment.py", line 184, in update_config
    search.check_solr_schema_version()
  File "/srv/app/src/ckan/ckan/lib/search/__init__.py", line 395, in check_solr_schema_version
    raise SearchError('SOLR schema version not supported: %s. Supported'
ckan.lib.search.common.SearchError: SOLR schema version not supported: 2.11. Supported versions are [2.8, 2.9, 2.10]

So there seems to be ckan2.11 specified somewhere. I checked the managed-schema in the solr container and it is for ckan version 2.10. Any ideas?

@ChristianF88
Copy link

ChristianF88 commented Feb 5, 2025

When running:

docker exec <SOLR-CONTAINER> cat server/solr/configsets/ckan/conf/managed-schema | grep "schema name"

I get <schema name="ckan-2.10" version="1.6">, which is what I would expect - ckan-2.10.

But querying solr directly:

docker exec <SOLR-CONTAINER wget -qO- http://127.0.0.1:8983/solr/ckan/schema?wt=schema.xml | grep "schema name="

it return <schema name="ckan-2.11" version="1.6">. ckan-2.11

@duttonw
Copy link

duttonw commented Feb 5, 2025

This has not been merged yet. This is to stop accidental version mismatch on deployments.

@ChristianF88
Copy link

Thank you for pointing that out. I'm simply reporting this here, as it is the exact problem I am experiencing. My current workaround is to use the *-spatial image, as it works.

@duttonw
Copy link

duttonw commented Feb 6, 2025

@amercader can you please get this merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants