Configuration overrides not applied when indexing on cron.

Created on 15 July 2024, 6 months ago

Problem/Motivation

In my server configuration, I use the local ddev url and export to config. Like this:

...
id: es_server
backend: opensearch
backend_config:
  connector_config:
    url: 'https://drupalorg.ddev.site:9201'
...

Then, I override the values per environment via $settings, like this:
$config['search_api.server.es_server']['backend_config']['connector_config']['url'] = getenv('SEARCH_API_HOST');

The reason for this set up is so I can change server URL, username, password or other settings via environment variables instead of having them exported in config.

Everything via the UI works as expected.

On production:

  • βœ… If I click the "Index now" button when viewing the search index, it all works as expected.
  • ❌ However, when cron runs, it tries to connect to the ddev instance and fails

It doesn’t seem to be applying the configuration overrides via cron.

πŸ› Bug report
Status

Closed: works as designed

Version

2.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain fjgarlin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @fjgarlin
  • Status changed to Closed: works as designed 6 months ago
  • πŸ‡ͺπŸ‡ΈSpain fjgarlin

    Thanks to @larowlan for helping via slack to debug this.

    It was not an issue here. drush cget search_api.server.es_server --include-overridden showed that the overrides I was setting were not actually being applied.

Production build 0.71.5 2024