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

Error retrieving DNS resources #123

Open
s0uky opened this issue Jan 19, 2024 · 3 comments
Open

Error retrieving DNS resources #123

s0uky opened this issue Jan 19, 2024 · 3 comments

Comments

@s0uky
Copy link

s0uky commented Jan 19, 2024

Hello,
I'm forcing issue with retrieving DNS resources over API:

E0119 15:14:32.063206       1 maascluster_controller.go:242] controllers/MaasCluster "msg"="failed to reconcile load balancer" "error"="error retrieving dns resources \"maas1-k8s-dev-547d29.default\": parse \"http://maas-example.com:5240/MAAS\\n/api/2.0/dnsresources/\": net/url: invalid control character in URL" "maascluster"="maas1-k8s-dev-infra"
E0119 15:14:32.063703       1 controller.go:317] controller/maascluster "msg"="Reconciler error" "error"="error retrieving dns resources \"maas1-k8s-dev-infra-547d29.default\": parse \"http://maas-example.com:5240/MAAS\\n/api/2.0/dnsresources/\": net/url: invalid control character in URL" "name"="maas1-k8s-dev-infra" "namespace"="maas1-k8s-dev-infra" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="MaasCluster"

I have only this in endpoint var:
MAAS_ENDPOINT=http://maas-example.com:5240/MAAS
Rest of URL is added automatically: \\n/api/2.0/dnsresources/\ and that newline sign could be the problem.

I'm using v0.5.0.

@blackliner
Copy link

Double check if your env variable contains a newline, maybe because you used echo to form it. The URL is likely just concatenated in the code.

maasEndpoint := os.Getenv("MAAS_ENDPOINT")

@s0uky
Copy link
Author

s0uky commented Jan 23, 2024

Correct, I used echo for it, my bad.
MAAS_ENDPOINT is now correct, same as MAAS_API_KEY, but still no luck. I'm stuck on status: "error"="error retrieving dns resources', 'status:401, message: Authorization Error: 'Invalid signature. Expected signature base string.
when I want retrieve DNS recources.

E0123 11:01:44.562268       1 maascluster_controller.go:242] controllers/MaasCluster "msg"="failed to reconcile load balancer" "error"="error retrieving dns resources \"maas1-k8s-dev-example-infra-3d6678.default\": status: 401, message: Authorization Error: 'Invalid signature. Expected signature base string: GET&http%3A%2F%2Fmaas.example.com%3A5240%2FMAAS%2Fapi%2F2.0%2Fdnsresources%2F&fqdn%3Dmaas1-k8s-dev-example-infra-3d6678.default%26oauth_consumer_key%3DMQC49M5b6WBUkXq2e2%26oauth_nonce%3Ddae91aa3-007f-409e-8498-02d168929736%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1706007704%26oauth_token%3DtULty7yqYkaGSdsVXH%26oauth_version%3D1.0'" "maascluster"="maas1-k8s-dev-example-infra"

@sudharsanomprakash
Copy link

@s0uky I guess it's issue with base64 encoding of your API key. Please check capmaas-manager-bootstrap-credentials

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