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

Valid toml is invalid #6578

Open
jsirex opened this issue May 22, 2019 · 12 comments
Open

Valid toml is invalid #6578

jsirex opened this issue May 22, 2019 · 12 comments
Labels
Documentation Flags an issue / PR for attention by the technical documentation team

Comments

@jsirex
Copy link
Contributor

jsirex commented May 22, 2019

Sometimes using nested keys via dots is useful:

# YAML
spring:
  cloud:
   kafka:
     broker: broker-1

According to this: https://github.com/toml-lang/toml#keys it can be written as:

# TOML
sping.cloud.kafka.broker = "broker-1"

However validation is failed (by rq and also by tomlcheck). I believe they use same library.

Here is the test:

echo "foo.bar.baz = 125" | rq -t

If you have lots of nested keys dealing with sections may be nightmare:

[foo]
bar = 5
[foo.baz.banny]
x = "y"
z = "xxx"
[foo.baz.bar.fizz]
r = 6
[foo.baz.bar.fizzzz]
r = 7

This is either bug or we need to point to correct TOML syntax reference in documentation.
Note, that habitat parses dotted configs correctly.

@jsirex jsirex added the C-bug label May 22, 2019
@jsirex
Copy link
Contributor Author

jsirex commented May 22, 2019

   health-api: Writing configuration
   health-api: Writing service management scripts
   health-api: Using run hook /src/health-api/habitat/hooks/run
   health-api: Building package metadata
[ERROR] [rq] Encountered: expected an equals, found a period at line 19
[ERROR] [rq] (Re-run with --trace or RUST_BACKTRACE=1 for a backtrace)
   health-api: ERROR: Bad pkg_export in pkg_exposes; Value of key "app.server.port" does not contain a valid TCP or UDP port number: 
   health-api: Build time: 1m6s
   health-api: Exiting on error

@christophermaier
Copy link
Contributor

@jsirex can you give some more detail on what's going on here? Are you running rq in a hook and it's choking on TOML that Habitat is otherwise parsing just fine?

@jsirex
Copy link
Contributor Author

jsirex commented May 28, 2019

Create any package with default.toml:

web.http.port = 80

In plan.sh try export and expose the port. rq unable to parse such toml file: [ERROR] [rq] Encountered: expected an equals, found a period at line 19

@christophermaier
Copy link
Contributor

Seems like rq and tomlcheck aren't adhering to the spec, then (which is odd, since rq is implemented in Rust and uses the same libraries that Habitat does 🤔)

As such, I don't think there's anything that we can do about this, apart from noting this in our documentation.

@jsirex
Copy link
Contributor Author

jsirex commented Dec 9, 2019

@christophermaier, I checked rq version 1.0.2 and it seems to work.

@jsirex
Copy link
Contributor Author

jsirex commented Dec 10, 2019

UPD: still issues with rq: dflemstr/rq#206

@mwrock
Copy link
Contributor

mwrock commented Dec 10, 2019

Closing here since the root cause appears to be elsewhere.

@mwrock mwrock closed this as completed Dec 10, 2019
@jsirex
Copy link
Contributor Author

jsirex commented Dec 10, 2019

It odd for me you're closing issue while habitat itself still does not work as expected..
Anyway this issue requires an action from habitat dev team...

@mwrock
Copy link
Contributor

mwrock commented Dec 10, 2019

my apologies. You are correct. I missed a detail here. Reopening.

@mwrock mwrock reopened this Dec 10, 2019
@jsirex
Copy link
Contributor Author

jsirex commented Jan 4, 2020

Linking rq issue: dflemstr/rq#208

@christophermaier christophermaier added Documentation Flags an issue / PR for attention by the technical documentation team and removed A-documentation labels Aug 18, 2020
@stale
Copy link

stale bot commented Jul 31, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

1 similar comment
@stale
Copy link

stale bot commented Aug 12, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Flags an issue / PR for attention by the technical documentation team
Projects
None yet
Development

No branches or pull requests

5 participants