-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Bad bytes in generated config file prevent config file parsing #8965
Comments
Can you give me a bit more information about how you generated this file? It looks like it was generated on a Windows computer, but what program was it generated inside of? |
I believe this is a Windows-only issue. The file was generated using influxd.exe that was part of the 1.3.6, 64 bit release zip: The executable was invoked from the Window's command line as well as powershell and always produced this output. |
Do you have a hexdump of the generated configuration file? |
This isn't the whole file, but you can see the issue by looking at it. This file was generated by the config command and then directly opened in a hex editor. You can see the first two characters FF and FE as well as all the NULL characters 00 after pretty much every other character (they appear as '.' on the ASCII column on the right). I had to clear out both FF and FE (well as I said I cleared everything above 7F just to be safe) as well as all of the 00's and then finally influxd.exe would parse it. |
From some initial looking online, it appears that the first two bytes are a byte-order mark and it's likely possible that the file is being written out in UTF-16 for whatever reason (hence all of the zero bytes), but then being read back as UTF-8 with no byte order mark. I'm not sure yet why it's doing that. |
Wow, good catch. Yeah given the evidence that sounds like a perfectly acceptable explanation. I did end up testing this release on MacOS and did not run into the issue, so I guess the clue would be that the UTF16/UTF8 mismatch is somehow related to Windows-dependent code. |
Bug report
System info:
InfluxDB 1.3.6 branch 1.3, commit a7c3d3c
Windows 10, 64 bit
Steps to reproduce:
Expected behavior:
Generated configuration file should parse without errors.
Actual behavior:
Generated configuration file fails parsing with errors.
Additional info:
Looking at the file in a hex editor reveals what looks like a ton of unintended characters in the stream. The file starts with the hex characters:
FF FE
which are invisible to most text editors. Also there are NULL characters littered throughout the file, pretty much after every normal ASCII text character is a NULL character. The parser is tripping up on all of these bad characters written to the file stream.I wrote a script that removes the first two characters (well anything over
7F
basically) and removes all the NULL characters00
from the generated output and when I run with that "cleaned" configuration file everything works as expected.Are there not tests that attempt to run influxd with the default generated config file on multiple platforms?
I'm not sure if this bug affects systems outside of Windows.
The text was updated successfully, but these errors were encountered: