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

Clound Foundry: service binding for [elasticsearch] is missing property: [port] #83

Closed
schefDev opened this issue Dec 21, 2023 · 4 comments
Assignees

Comments

@schefDev
Copy link

schefDev commented Dec 21, 2023

Honestly, I don't know if it's a bug in the Cloud Foundry service I'm using, but I have this exact case here.

   2023-12-21T13:09:19.25+0100 [APP/PROC/WEB/0] OUT level=error msg="service binding for [elasticsearch] is missing property: [port]"
   2023-12-21T13:09:19.25+0100 [APP/PROC/WEB/0] OUT level=error msg="service binding for [elasticsearch] is not valid"

Cause, the host (in credentials of the service binding) has no port:

"host": "https://xxx.elasticsearch.com",

instead of

"host": "https://xxx.elasticsearch.com:443",

To fix that in the backman if it finds approval, the well-known port in enrichBinding could be set according to the schema/protocol.
If I find the time, I will submit a pull request.

Add https://github.com/swisscom/backman/blob/develop/service/service.go#L139

// set well-known port based on scheme if still missing
if binding.Port == 0 {
	if strings.EqualFold(u.Scheme, "https") {
		binding.Port = 443
	}
	if strings.EqualFold(u.Scheme, "http") {
		binding.Port = 80
	}
}

Workaround: Downgrade to backman version 1.32.2

BR Christian

@schefDev
Copy link
Author

schefDev commented Dec 21, 2023

I just noticed that this case (no port in host) is common with older elasticsearch service instances. (in a certain known platform, in a known company)

schefDev added a commit to schefDev/backman that referenced this issue Dec 21, 2023
schefDev added a commit to schefDev/backman that referenced this issue Dec 27, 2023
@schefDev
Copy link
Author

schefDev commented Jan 9, 2024

Hi @JamesClonk or other contributors,

if you ever have time, it would be cool if you could take a look at this trifle.

Thanks and BR,
Christian

PS: Just so it's not lost if no one is notified. 👻

@JamesClonk JamesClonk self-assigned this Jan 9, 2024
@JamesClonk
Copy link
Member

@schefDev I'm on it, thanks for the ping! 👍
(Indeed, I don't seem to get notifications of issues or PRs unfortunately 😮)

@schefDev
Copy link
Author

Thanks @JamesClonk! 👍

Fixed in Release v2.1.1

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

2 participants