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

Issues with ingress relation #61

Open
shipperizer opened this issue Aug 23, 2024 · 3 comments
Open

Issues with ingress relation #61

shipperizer opened this issue Aug 23, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@shipperizer
Copy link
Contributor

when integrating with traefik-k8s a validation issue seems to be happening on the ingress side due to our sent payload

2024-08-23T07:53:56.836Z [container-agent] 2024-08-23 07:53:56 INFO juju-log ingress:49: Provider not ready; validation error encountered: ({}, {'type': 'object', 'properties': {'model': {'type': 'string'}, 'name': {'type': 'string'}, 'host': {'type': 'string'}, 'port': {'type': 'string'}, 'strip-prefix': {'type': 'string'}, 'redirect-https': {'type': 'string'}}, 'required': ['model', 'name', 'host', 'port']})
2024-08-23T07:53:56.859Z [container-agent] 2024-08-23 07:53:56 DEBUG juju-log ingress:49: failed to validate databag: {}
2024-08-23T07:53:56.859Z [container-agent] Traceback (most recent call last):
2024-08-23T07:53:56.859Z [container-agent]   File "/var/lib/juju/agents/unit-public-ingress-0/charm/lib/charms/traefik_k8s/v2/ingress.py", line 182, in load
2024-08-23T07:53:56.859Z [container-agent]     return cls.model_validate_json(json.dumps(data))  # type: ignore
2024-08-23T07:53:56.859Z [container-agent]   File "/var/lib/juju/agents/unit-public-ingress-0/charm/venv/pydantic/main.py", line 597, in model_validate_json
2024-08-23T07:53:56.859Z [container-agent]     return cls.__pydantic_validator__.validate_json(json_data, strict=strict, context=context)
2024-08-23T07:53:56.859Z [container-agent] pydantic_core._pydantic_core.ValidationError: 3 validation errors for IngressRequirerAppData
2024-08-23T07:53:56.859Z [container-agent] model
2024-08-23T07:53:56.859Z [container-agent]   Field required [type=missing, input_value={}, input_type=dict]
2024-08-23T07:53:56.859Z [container-agent]     For further information visit https://errors.pydantic.dev/2.8/v/missing
2024-08-23T07:53:56.859Z [container-agent] name
2024-08-23T07:53:56.859Z [container-agent]   Field required [type=missing, input_value={}, input_type=dict]
2024-08-23T07:53:56.859Z [container-agent]     For further information visit https://errors.pydantic.dev/2.8/v/missing
2024-08-23T07:53:56.859Z [container-agent] port
2024-08-23T07:53:56.859Z [container-agent]   Field required [type=missing, input_value={}, input_type=dict]
2024-08-23T07:53:56.859Z [container-agent]     For further information visit https://errors.pydantic.dev/2.8/v/missing
2024-08-23T07:53:56.868Z [container-agent] 2024-08-23 07:53:56 DEBUG juju-log ingress:49: Provider not ready; validation error encountered: failed to validate ingress requirer data
2024-08-23T07:53:57.289Z [container-agent] 2024-08-23 07:53:57 INFO juju.worker.uniter.operation runhook.go:186 ran "ingress-relation-created" hook (via hook dispatching script: dispatch)
2024-08-23T07:53:58.412Z [container-agent] 2024-08-23 07:53:58 DEBUG juju-log ingress:49: ops 2.14.1 up and running.
2024-08-23T07:53:58.537Z [container-agent] 2024-08-23 07:53:58 DEBUG juju-log ingress:49: no relation on 'tracing': tracing not ready
2024-08-23T07:53:58.545Z [container-agent] 2024-08-23 07:53:58 DEBUG juju-log ingress:49: <class '__main__.TraefikIngressCharm'>.<property object at 0x7f06d2cd6130> returned None; quietly disabling charm_tracing for the run.
2024-08-23T07:53:58.583Z [container-agent] 2024-08-23 07:53:58 DEBUG juju-log ingress:49: Emitting Juju event ingress_relation_joined.
2024-08-23T07:53:58.722Z [container-agent] 2024-08-23 07:53:58 INFO juju-log ingress:49: Provider not ready; validation error encountered: ({'port': '8080', 'model': '"stg-identity-jaas-dev"', 'name': '"admin-ui"', 'strip-prefix': 'true', 'redirect-https': 'false'}, {'type': 'object', 'properties': {'model': {'type': 'string'}, 'name': {'type': 'string'}, 'host': {'type': 'string'}, 'port': {'type': 'string'}, 'strip-prefix': {'type': 'string'}, 'redirect-https': {'type': 'string'}}, 'required': ['model', 'name', 'host', 'port']})
2024-08-23T07:53:58.767Z [container-agent] 2024-08-23 07:53:58 WARNING juju-log ingress:49: 'app' expected but not received.
2024-08-23T07:53:58.800Z [container-agent] 2024-08-23 07:53:58 WARNING juju-log ingress:49: 'app_name' expected in snapshot but not found.

to reproduce simply deploy admin-ui and traefik-k8s and relate them

@shipperizer shipperizer added the bug Something isn't working label Aug 23, 2024
@shipperizer
Copy link
Contributor Author

  - relation-id: 14
    endpoint: ingress
    related-endpoint: ingress
    application-data:
      model: '"stg-identity-jaas-dev"'
      name: '"login-ui"'
      port: "8080"
      redirect-https: "false"
      scheme: '"http"'
      strip-prefix: "true"
    related-units:
      login-ui/0:
        in-scope: true
        data:
          egress-subnets: 10.152.183.219/32
          host: '"login-ui-0.login-ui-endpoints.stg-identity-jaas-dev.svc.cluster.local"'
          ingress-address: 10.152.183.219
          private-address: 10.152.183.219
  - relation-id: 49
    endpoint: ingress
    related-endpoint: ingress
    application-data:
      model: '"stg-identity-jaas-dev"'
      name: '"admin-ui"'
      port: "8080"
      redirect-https: "false"
      scheme: '"http"'
      strip-prefix: "true"
    related-units:
      admin-ui/0:
        in-scope: true
        data:
          host: '"admin-ui-0.admin-ui-endpoints.stg-identity-jaas-dev.svc.cluster.local"'

these are the differences between a login-ui and an admin-ui ingress

login-ui uses lib 2.5, admin 2.6

@shipperizer
Copy link
Contributor Author

issue seems to be resolving when upgrading to the latest traefik library 2.13

@shipperizer shipperizer added bug Something isn't working and removed bug Something isn't working labels Aug 27, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/IAM-1011.

This message was autogenerated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant