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

[BUG] configparser screws up case sensitivity #20

Closed
MikeSchiessl opened this issue Feb 3, 2022 · 4 comments
Closed

[BUG] configparser screws up case sensitivity #20

MikeSchiessl opened this issue Feb 3, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@MikeSchiessl
Copy link
Collaborator

Describe the bug
When running ULS with the section specified in UPPERCASE e.g. ULS_SECTION=DEFAULT but specified the section name within the .edgerc lowercase [default], config parser seems to be able to find the section but the config value (e.g. 'host') cannot be found.

ULS will return something weird like this:

ULS D Section 'DEFAULT' found.
ULS C Required configuration value 'host' not found in section / file. Please see: https://github.com/akamai/uls/blob/main/docs/AKAMAI_API_CREDENTIALS.md - Exiting

To Reproduce

bin/uls.py -i etp -f threat -o raw --loglevel debug --edgerc /opt/akamai-uls/my-edge --section DEFAULT
...
ULS D Section 'DEFAULT' found.
ULS C Required configuration value 'host' not found in section / file. Please see: ..... 
bin/uls.py -i etp -f threat -o raw --loglevel debug --edgerc /opt/akamai-uls/my-edge --section default
...
ULS starts running as expected 
bin/uls.py -i etp -f threat -o raw --loglevel debug --edgerc /opt/akamai-uls/my-edge --section DeFauLt
...
ULS C Section 'DeFauLt' not found. Available sections: '['default']'. - Exiting

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

ULS Version output
please run the following and attach the output here.

Akamai Unified Log Streamer Version information
ULS Version             1.3.0

EAA Version             0.4.5
ETP Version             0.3.6
MFA Version             0.0.6

OS Plattform            Linux-5.4.172-90.336.amzn2.x86_64-x86_64-with-glibc2.31
OS Version              5.4.172-90.336.amzn2.x86_64
Python Version          3.10.1
Docker Status           True
RootPath                /opt/akamai-uls/uls

Additional context
Seems to be a bug inside the configparser module - we will need to dig into this little deeper.
As "QuickFix" and for reference, I'll create a FAQ entry and leave this issue as reference.

@MikeSchiessl MikeSchiessl added the bug Something isn't working label Feb 3, 2022
@MikeSchiessl
Copy link
Collaborator Author

QuickFix:

Please watch out to specify the section exactly the same way (case sensitivity) as you have specified it in your .edgerc file.

@bitonio
Copy link
Collaborator

bitonio commented Feb 3, 2022

That seems to follow the original specs:
https://docs.python.org/3.10/library/configparser.html#supported-ini-file-structure

By default, section names are case sensitive but keys are not.

@mschiessl
Copy link

@bitonio - agreed and actually being case sensitive would be awesome, but then this could not happen at all:

.edgerc

[default]
host=aka-....
...

command

bin/uls.py -i etp -f threat -o raw --loglevel debug --edgerc /opt/akamai-uls/my-edge --section DEFAULT
...
ULS D Section 'DEFAULT' found.
ULS C Required configuration value 'host' not found in section / file. Please see: ..... 

So this is the mismatch that broke my nose today ;)

@MikeSchiessl
Copy link
Collaborator Author

added to FAQ in v. 1.3.2 / 1.3.3

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

No branches or pull requests

3 participants