Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
 
Answered
Wedge Address Config Misconfigured Error

We are using wedge adress configs in an Ardent extension but we keep getting the following error:

_validate_db_configs
raise exceptions.ConfigurationError('Q2_WedgeAddress.Config Misconfigured')
q2_sdk.core.exceptions.ConfigurationError: Q2_WedgeAddress.Config Misconfigured

We have defined the config:

WEDGE_ADDRESS_CONFIGS = DbConfigList(
[
DbConfig('Cognito_Url', 'https://hidden.amazoncognito.com'),
]
)

and have reinstalled the extension. We recieved the anticipated prompt and used the default setting. We can confirm the value is in the database by directly loading the WedgeAddress records from the database:

wedge_object = WedgeAddress(self.logger, self.hq_credentials)
config_node = await wedge_object.get(short_name=self.extension_name)
self.write(config_node[0].Config.text)

Output >> {"Cognito_Url": "https://hidden.amazoncognito.com"}

Everything looks good but as soon as we call self.db_config or self.wedge_address_configs we get the error. We also tried calling self.get_wedge_address_configs(True) to enforce getting the config from the database but still the same error.

What are we missing?
Thanks!

Posted 4 years ago
Votes Newest

Answers 2


For anyone else that runs into this problem, we've coded a workaround for now:

wedge_object = WedgeAddress(self.logger, self.hq_credentials)
wedge_addresses = await wedge_object.get(short_name=self.extension_name)
if wedge_addresses:
		config_json = json.loads(wedge_addresses[0].Config.text)
		cognito_url = config_json['Cognito_Url']

Hello Chris,

I would need some more informaton. I would need how you are calling self.wedge_address_configs and the full stack trace. I would expect: self.wedge_address_configs['Cognito_Url'] to work.

Looking at the SDK code:

def _validate_db_configs(self, db_config_list: DbConfigList):
        """
        Raises exception if required WEDGE_ADDRESS_CONFIGS are not set
        """
        bad_config = False
        # Sanity-check the config to make sure all expected keys are now set.
        for key in [x.name for x in self.WEDGE_ADDRESS_CONFIGS.required]:
            if key not in db_config_list:
                bad_config = True
                self.logger.error('Q2_WedgeAddress.Config missing key: %s.' % key)

        # If anything went wrong, fail.
        if bad_config:
            self.logger.error(
                'DbConfigs Misconfigured. Try running `q2 update_installed -e %s`' % (
                    self.extension_name
                )
            )
            raise exceptions.ConfigurationError('Q2_WedgeAddress.Config Misconfigured')

So the only way that error can happen is if the key is not in the db_config

Posted 4 years ago
Trey Teter
124 × 2 Administrator
0

I was expecting that to work as well. We are calling it as follows:

cognito_url = self.wedge_address_configs['Cognito_Url']

...and here is the stack trace:

— Chris Janes   4 years ago
0

Traceback (most recent call last):
File "/home/cjanes@inter-val.ai/sdk/.env/lib/python3.8/site-packages/tornado/web.py", line 1713, in _execute
result = await result
File "./IntervalSSORequestHandler/extension.py", line 94, in get
cognito_url = self.wedge_address_configs['Cognito_Url']
File "/home/cjanes@inter-val.ai/sdk/.env/lib/python3.8/site-packages/q2_sdk/core/http_handlers/hq_handler.py", line 147, in wedge_address_configs
return self.db_config

— Chris Janes   4 years ago
0

File "/home/cjanes@inter-val.ai/sdk/.env/lib/python3.8/site-packages/q2_sdk/core/http_handlers/hq_handler.py", line 156, in db_config
self._validate_db_configs(_db_config)
File "/home/cjanes@inter-val.ai/sdk/.env/lib/python3.8/site-packages/q2_sdk/core/http_handlers/hq_handler.py", line 142, in _validate_db_configs
raise exceptions.ConfigurationError('Q2_WedgeAddress.Config Misconfigured')
q2_sdk.core.exceptions.ConfigurationError: Q2_WedgeAddress.Config Misconfigured

— Chris Janes   4 years ago
133 Views
2 Answers
4 years ago
4 years ago
Tags