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

Unexpected config values for Scaleway Secret Provider #389

Closed
haikoschol opened this issue Jun 10, 2024 · 7 comments
Closed

Unexpected config values for Scaleway Secret Provider #389

haikoschol opened this issue Jun 10, 2024 · 7 comments

Comments

@haikoschol
Copy link
Contributor

We are running ORT Server core in a Deployment in Scaleway Kubernetes. In order to use the Scaleway Secret Provider, we've set the following environment variables:

- name: SCW_API_VERSION
  value: "v1beta1"
- name: SCW_REGION
  value: "nl-ams"

A GET request to /api/v1/organizations/<id>/secrets fails with an internal server error and this message in the logs:

Caused by: com.typesafe.config.ConfigException$BadValue: hardcoded value: Invalid value at 'scwApiVersion': The enum class ScalewayApiVersion has no constant of the name 'v1beta1' (should be one of [V1_ALPHA1, V1_BETA1].)

The request succeeds with setting SCW_API_VERSION to V1_BETA1 and SCW_REGION to NETHERLANDS_AMSTERDAM.

Is this intended behavior? To me the code looks like v1beta1 and nl-ams should work. Or am I misunderstanding what @SerialName does?

cc @sschuberth

@sschuberth
Copy link
Contributor

Is this intended behavior?

Yes. For type safety, I decided to require enum names instead of the untyped strings the raw REST API URL uses.

@sschuberth
Copy link
Contributor

Or am I misunderstanding what @SerialName does?

Actually @SerialName does not play a role here because the code is not used to deserialize from the config file, but only to serialize for REST API usage. Instead, the ConfigManager code from here is relevant:

apiVersion = configManager.getEnumOrDefault(NAME_OF_API_VERSION, DEFAULT_API_VERSION),
region = configManager.getEnumOrDefault(NAME_OF_REGION, DEFAULT_REGION),

And that uses enums.

@haikoschol
Copy link
Contributor Author

It would be nice to use the same strings as Scaleway does in their documentation. But if that results in a less helpful error message for incorrect values, it's probably not an improvement.

@sschuberth
Copy link
Contributor

sschuberth commented Jun 10, 2024

It would be nice to use the same strings as Scaleway does in their documentation.

Let me check if I could easily support both, enum names and raw strings as values.

sschuberth added a commit to doubleopen-project/ort-server that referenced this issue Jun 10, 2024
github-merge-queue bot pushed a commit that referenced this issue Jun 10, 2024
@sschuberth
Copy link
Contributor

@mnonnenmacher auto-close also did not work here. Could you contact EF support to check whether it's some issue with Otterdog?

@haikoschol
Copy link
Contributor Author

It would be nice to use the same strings as Scaleway does in their documentation.

Let me check if I could easily support both, enum names and raw strings as values.

Works now. Thanks!

@mnonnenmacher
Copy link
Contributor

mnonnenmacher commented Jun 11, 2024

@mnonnenmacher auto-close also did not work here. Could you contact EF support to check whether it's some issue with Otterdog?

This is really weird, I could not find any bug reports that the feature is broken for anyone else and it also seems that there is no option to configure or disable it somehow. But I will create an issue with EF eventually.

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

No branches or pull requests

3 participants