Skip to content

Malformed json/yaml model file in discoverDomain due to with newline handling #999

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

Closed
rssh22 opened this issue Nov 10, 2021 · 9 comments · Fixed by #1011
Closed

Malformed json/yaml model file in discoverDomain due to with newline handling #999

rssh22 opened this issue Nov 10, 2021 · 9 comments · Fixed by #1011
Assignees

Comments

@rssh22
Copy link

rssh22 commented Nov 10, 2021

As of #829 this should be solved. However, the problem happens again in release 1.9.18.

@Bneve5 @rssh22 it appears that the core issue was the embedded newline characters in the string value. I have created a PR that corrects the embedded newline handling that I believe will fix this issue.

Originally posted by @robertpatrick in #823 (comment)

@robertpatrick
Copy link
Member

@rssh22 I am not seeing the PR. Are you sure you created it on this repo?

@rssh22
Copy link
Author

rssh22 commented Nov 10, 2021

@robertpatrick I did not create the PR. I guess that you did because of your comment in #823 (comment)_

As you can see in the release notes for 1.9.9 this bug was solved there:
image

@robertpatrick
Copy link
Member

@Bneve5 @rssh22 it appears that the core issue was the embedded newline characters in the string value. I have created a PR that corrects the embedded newline handling that I believe will fix this issue.

@rssh22 OK, your previous comment included an unquoted reference to a comment I made 9 months ago so I read it as your comment.

@rssh22
Copy link
Author

rssh22 commented Nov 16, 2021

Here is another example of malformed json generated by the tool:

            "siloe-web-jee-r01a-iq-jeec-jds-u0" : {
                "Target" : "wlc-pre-32-c1",
                "JdbcResource" : {
                    "JDBCConnectionPoolParams" : {
                        "MaxCapacity" : 15,
                        "WrapTypes" : "true",
                        "RemoveInfectedConnections" : "true",
                        "StatementCacheType" : "LRU",
                        "InactiveConnectionTimeoutSeconds" : 20,
                        "StatementTimeout" : 60,
                        "HighestNumWaiters" : 30,
                        "ShrinkFrequencySeconds" : 900,
                        "StatementCacheSize" : 10,
                        "TestTableName" : "SQL SELECT 1 FROM DUAL",
                        "ConnectionReserveTimeoutSeconds" : 10,
                        "CapacityIncrement" : 1,
                        "IgnoreInUseConnectionsEnabled" : "true",
                        "InitialCapacity" : 1,
                        "TestFrequencySeconds" : 120,
                        "LoginDelaySeconds" : 0,
                        "TestConnectionsOnReserve" : "true",
                        "SecondsToTrustAnIdlePoolConnection" : 10,
                        "InitSql" : "SQL BEGIN

EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_SORT = SPANISH_AI';

EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_COMP = LINGUISTIC';

EXECUTE IMMEDIATE 'ALTER SESSION SET \"_b_tree_bitmap_plans\" = FALSE';

EXECUTE IMMEDIATE 'ALTER SESSION SET \"star_transformation_enabled\" = FALSE';
END;",
                        "ConnectionCreationRetryFrequencySeconds" : 0
                    },

@robertpatrick
Copy link
Member

robertpatrick commented Nov 17, 2021

@rssh22 This JSON output formatting issue is a different problem, not related to the YAML parser issues surrounding newlines. I will ask someone to look into this...

@rssh22
Copy link
Author

rssh22 commented Nov 17, 2021

I though it was the same cause. Thank you @robertpatrick.

@robertpatrick
Copy link
Member

PR #1011 should fix the JSON output formatting issue, once merged and released. Since most people are using YAML, this was an oversight on our part. The JSON parser was already properly "de-escaping" the special characters but the code generating the JSON output was not properly escaping them.

@ddsharpe
Copy link
Member

Merge #1101 partially fixes this issue. Another change is pending.

@ddsharpe ddsharpe reopened this Nov 17, 2021
@robertpatrick
Copy link
Member

I believe that this issue was about the output formatting only so closing this issue as resolved by PR #1011.

In WDT 2.0, we are replacing the YAML parser and output formatter with snakeyaml. This will cause some minor changes in what the input YAML needs to look like as well as how the YAML output is formatted (hence the 2.0 version) but we hope it will provide a better all-around YAML experience for our users.

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

Successfully merging a pull request may close this issue.

3 participants