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

Invalid Unicode escape error on strings contains backslash character "\" #8951

Closed
ulyszk opened this issue Aug 4, 2021 · 3 comments · Fixed by #8955
Closed

Invalid Unicode escape error on strings contains backslash character "\" #8951

ulyszk opened this issue Aug 4, 2021 · 3 comments · Fixed by #8955
Assignees
Labels
area/db-ido Database output bug Something isn't working
Milestone

Comments

@ulyszk
Copy link

ulyszk commented Aug 4, 2021

Describe the bug

A clear and concise description of what the bug is.

Please ensure to read https://github.com/Icinga/icinga2/blob/master/doc/15-troubleshooting.md first. Formatting tips: GitHub supports Markdown: https://guides.github.com/features/mastering-markdown/

To Reproduce

Upgrading to 2.12.5 and 2.13.0 from 2.12.4 causes "invalid Unicode escape" error and non working IDO PosgreSQL connection.

Relevant logfiles (icinga2.log):
2021-08-04 14:27:55 +0200] critical/IdoPgsqlConnection: Error "ERROR: invalid Unicode escape
LINE 1: ...LUES (E'1', 1, E'0', 13703, E'file_age_file', E'C:\Users\rob...
^
HINT: Unicode escapes must be \uXXXX or \UXXXXXXXX.
" when executing query "INSERT INTO icinga_customvariables (config_type, instance_id, is_json, object_id, varname, varvalue) VALUES (E'1', 1, E'0', 13703, E'file_age_file', E'C:\Users\flexi\Logs\LastRun\CalendarUpdate.log'
)"
[2021-08-04 14:27:55 +0200] warning/IdoPgsqlConnection: Exception during database operation: Verify that your database is operational!

Downgrading back to 2.12.4 solves the problem.

  1. I am not sure if this is the root cause, but any parameter contains \ backslash character in configuration can cause error like
    file_age_file = "C:\Users\felxi"
    vars.ilo4_password = "MTsk3499cv\!f"
  2. Downgrading to older version solves the problem.

Expected behavior

Proper handling of Unicode.

Your Environment

Include as many relevant details about the environment you experienced the problem in

  • Version used (icinga2 --version):
    icinga2 - The Icinga 2 network monitoring daemon (version: 2.12.4-1)

Copyright (c) 2012-2021 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later http://gnu.org/licenses/gpl2.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

System information:
Platform: CentOS Linux
Platform version: 7 (Core)
Kernel: Linux
Kernel version: 3.10.0-1127.8.2.el7.x86_64
Architecture: x86_64

Build information:
Compiler: GNU 4.8.5
Build host: runner-hh8q3bz2-project-322-concurrent-0
OpenSSL version: OpenSSL 1.0.2k-fips 26 Jan 2017

Application information:

General paths:
Config directory: /etc/icinga2
Data directory: /var/lib/icinga2
Log directory: /var/log/icinga2
Cache directory: /var/cache/icinga2
Spool directory: /var/spool/icinga2
Run directory: /run/icinga2

Old paths (deprecated):
Installation root: /usr
Sysconf directory: /etc
Run directory (base): /run
Local state directory: /var

Internal paths:
Package data directory: /usr/share/icinga2
State path: /var/lib/icinga2/icinga2.state
Modified attributes path: /var/lib/icinga2/modified-attributes.conf
Objects path: /var/cache/icinga2/icinga2.debug
Vars path: /var/cache/icinga2/icinga2.vars
PID path: /run/icinga2/icinga2.pid

  • Operating System and version:
  • Enabled features (icinga2 feature list):

Disabled features: compatlog elasticsearch graphite icingadb influxdb2 livestatus opentsdb perfdata
Enabled features: api checker command debuglog gelf ido-pgsql influxdb mainlog notification statusdata syslog

  • Icinga Web 2 version and modules (System - About):
  • Config validation (icinga2 daemon -C):

Configuration is valid

@julianbrost
Copy link
Contributor

Upgrading to 2.12.5 and 2.13.0 from 2.12.4 causes "invalid Unicode escape" error and non working IDO PosgreSQL connection.

Are you sure this is broken in 2.12.5 but was working in 2.12.4? The only change to PostgreSQL between these versions is 843353a, but that doesn't have an effect on the actual connection to the database.

I suspect this might be due to #8123, but that's only in 2.13.0.

@julianbrost julianbrost added area/db-ido Database output bug Something isn't working labels Aug 4, 2021
@julianbrost julianbrost self-assigned this Aug 4, 2021
@julianbrost
Copy link
Contributor

Anyways, I was able to reproduce this with 2.13.0. And looks like reverting #8123 indeed fixes this.

@ulyszk
Copy link
Author

ulyszk commented Aug 5, 2021

@julianbrost You are right, 2.12.5 is also OK for me. Thank you for the confirmation.

@ulyszk ulyszk changed the title Invalid Unicode escape error on strings contains blackslash character "\" Invalid Unicode escape error on strings contains backslash character "\" Aug 5, 2021
@julianbrost julianbrost added this to the 2.13.1 milestone Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/db-ido Database output bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants