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

[dev.icinga.com #7730] Restart Icinga - Error Restoring program state from file '/var/lib/icinga2/icinga2.state' #2273

Closed
icinga-migration opened this issue Nov 18, 2014 · 10 comments
Labels
bug Something isn't working
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/7730

Created by fmbiete on 2014-11-18 17:05:46 00:00

Assignee: gbeutner
Status: Resolved (closed on 2014-11-20 09:10:03 00:00)
Target Version: 2.2.1
Last Update: 2014-11-27 21:32:58 00:00 (in Redmine)

Icinga Version: 2.2.0

Every time I restart icinga2 (systemctl restart icinga2 / icinga2 daemon) I get the following error and fails:

[2014-11-18 17:39:50  0100] information/DynamicObject: Restoring program state from file '/var/lib/icinga2/icinga2.state'
Caught unhandled exception.
Current time: 2014-11-18 17:39:50  0100

Application information:
  Application version: v2.2.0
  Installation root: /usr
  Sysconf directory: /etc
  Run directory: /var/run
  Local state directory: /var
  Package data directory: /usr/share/icinga2
  State path: /var/lib/icinga2/icinga2.state
  Objects path: /var/cache/icinga2/icinga2.debug
  Vars path: /var/cache/icinga2/icinga2.vars
  PID path: /var/run/icinga2/icinga2.pid
  Application type: icinga/IcingaApplication

/root/rpmbuild/BUILD/icinga2/lib/base/json.cpp(361): Throw in function icinga::Value icinga::JsonDecode(const icinga::String&)
Dynamic exception type: boost::exception_detail::clone_impl >
std::exception::what: lexical error: invalid bytes in UTF8 string.
                                        {"name":"gestpim.mad.sw!renr-s
                     (right here) ------^

[icinga::StackTrace*] = 
        (0) icinga2: void boost::throw_exception >(boost::exception_detail::error_info_injector const&) ( 0xe9) [0x417199]
        (1) libbase.so: void boost::exception_detail::throw_exception_(std::invalid_argument const&, char const*, char const*, int) ( 0x69) [0x7fbe3e697fe9]
        (2) libbase.so: icinga::JsonDecode(icinga::String const&) ( 0x47d) [0x7fbe3e6606fd]
        (3) libbase.so: icinga::DynamicObject::RestoreObject(icinga::String const&, int) ( 0x3a) [0x7fbe3e669d4a]
        (4) libbase.so: icinga::WorkQueue::WorkerThreadProc() ( 0x384) [0x7fbe3e661664]
        (5) libboost_thread-mt.so.1.53.0:  ( 0xd24a) [0x7fbe3f08d24a]
        (6) libpthread.so.0:  ( 0x7df3) [0x7fbe3bf25df3]
        (7) libc.so.6: clone ( 0x6d) [0x7fbe3c43801d]


[icinga::ContextTrace*] = 


***
* This would indicate a runtime problem or configuration error. If you believe this is a bug in Icinga 2
* please submit a bug report at https://dev.icinga.org/ and include this stack trace as well as any other
* information that might be useful in order to reproduce this problem.
***

The first time I thought it was an incompatible format from the old version (icinga2-2.1.0-1.snapshot201409101913.el7.centos.x86_64), and I removed the state file. It started correcty, but without the status info.
But at each restart I'm finding the same problem.

Attachments

Changesets

2014-11-20 09:09:13 00:00 by (unknown) 5321bc4

Don't validate strings in the JSON parser

fixes #7730

2014-11-21 07:26:07 00:00 by (unknown) 95e86ce

Don't validate strings in the JSON parser

fixes #7730

Relations:

@icinga-migration
Copy link
Author

Updated by fmbiete on 2014-11-18 17:07:21 00:00

Icinga version is 2.2-1.el7.centos.x86_64 but I was getting an error creating the issue "Icinga version is invalid"??

@icinga-migration
Copy link
Author

Updated by fmbiete on 2014-11-18 17:54:23 00:00

Ok, I have found the problem, one check returned a wrongly encoded output, and it's stored in the status file.

{"active":1.0,"check_source":"icinga.mad.stc.renr.es","command":["/usr/local/libexec/check_http","-I","10.1.17.196","-c","10","-p","8080","-u","/test.jsp","-w","5"],"execution_end":1416327889.3924450874,"execution_start":1416327889.3808898926,"exit_status":0.0,"output":"HTTP OK: HTTP/1.1 302 Movido tempor�lmente - 375 bytes in 0.005 second response time ",

Although it's a problem in my check...

  • version 2.1.0 didn't show that error, and the same output existed before. This is not a problem per se, but maybe printing the host/service with the error would be a good idea (if possible)
  • it would be nice to convert the output text to utf-8 before writing to the status file

@icinga-migration
Copy link
Author

Updated by melaniegault on 2014-11-18 20:50:47 00:00

I have the same problem with my only monitored windows client (nsclient** with nrpe checks).

Application information:
  Application version: v2.2.0
  Installation root: /usr
  Sysconf directory: /etc
  Run directory: /var/run
  Local state directory: /var
  Package data directory: /usr/share/icinga2
  State path: /var/lib/icinga2/icinga2.state
  Objects path: /var/cache/icinga2/icinga2.debug
  Vars path: /var/cache/icinga2/icinga2.vars
  PID path: /var/run/icinga2/icinga2.pid
  Application type: icinga/IcingaApplication

../base/json.cpp(361): Throw in function icinga::Value icinga::JsonDecode(const icinga::String&)
Dynamic exception type: N5boost16exception_detail10clone_implINS0_19error_info_injectorISt16invalid_argumentEEEE
std::exception::what: lexical error: invalid bytes in UTF8 string.
                                        {"name":"svq-doracle.site-mair
                     (right here) ------^

[PN6icinga10StackTraceE] =
        (0) libbase.so: void boost::throw_exception >(boost::exception_detail::error_info_injector const&) ( 0x16f) [0x7fb0b345fdcf]
        (1) libbase.so: icinga::JsonDecode(icinga::String const&) ( 0x4c0) [0x7fb0b34262d0]
        (2) libbase.so: icinga::DynamicObject::RestoreObject(icinga::String const&, int) ( 0x3b) [0x7fb0b34297eb]
        (3) libbase.so: icinga::WorkQueue::WorkerThreadProc() ( 0x3b1) [0x7fb0b33fe9f1]
        (4) libboost_thread-mt.so.5: thread_proxy ( 0x77) [0x7fb0b3dfed47]
        (5) libpthread.so.0:  ( 0x79d1) [0x7fb0b0fb09d1]
        (6) libc.so.6: clone ( 0x6d) [0x7fb0b12ae9dd]

@icinga-migration
Copy link
Author

Updated by gbeutner on 2014-11-20 09:00:59 00:00

  • Icinga Version changed from 2 to 2

@icinga-migration
Copy link
Author

Updated by gbeutner on 2014-11-20 09:09:00 00:00

  • Category set to libbase
  • Status changed from New to Assigned
  • Assigned to set to gbeutner
  • Target Version set to 2.2.1

@icinga-migration
Copy link
Author

Updated by Anonymous on 2014-11-20 09:10:03 00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 0 to 100

Applied in changeset 5321bc4.

@icinga-migration
Copy link
Author

Updated by gbeutner on 2014-11-20 09:10:25 00:00

Please re-test if you can reproduce this problem with the latest snapshot packages.

@icinga-migration
Copy link
Author

Updated by fmbiete on 2014-11-21 07:35:39 00:00

Retested and it works. With two different wrong state files icinga starts without any problems.

Thank you very much!

Version: icinga2-2.2-1.snapshot201411202014.el7.centos.x86_64

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-11-21 09:56:37 00:00

  • Duplicated set to 7777

@icinga-migration
Copy link
Author

Updated by melaniegault on 2014-11-27 21:32:58 00:00

another way to solve : force nsclient with utf-8 :
in the ini file add

[/settings/NRPE/server]
encoding = utf8

@icinga-migration icinga-migration added bug Something isn't working libbase labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.2.1 milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant