netdisco / netdisco

A web-based network management tool.
http://netdisco.org/
BSD 3-Clause "New" or "Revised" License
633 stars 74 forks source link

control characters in netdisco-backend.log #1168

Open inphobia opened 5 months ago

inphobia commented 5 months ago

Expected Behavior

control characters should be stripped out of the log. this string seems to be propagated from somewhere in the dbix stack as far as i can tell.

Current Behavior

[1905] 2024-01-27 22:07:47 error bless( {'msg' => 'DBIx::Class::Storage::DBI::catch {...} (): DBI Connection failed: DBI connect(\'dbname=netdisco;host=1.1.1.1\',\'netdisco\',...) failed: connection to server at "1.1.1.1", port 5432 failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections? at /home/netdisco/perl5/lib/perl5/DBIx/Class/Storage/DBI.pm line 1639. at /home/netdisco/perl5/lib/perl5/App/Netdisco/JobQueue/PostgreSQL.pm line 265
'}, 'DBIx::Class::Exception' )
        (in cleanup) à<93>+KðU^@^@anup)  at /home/netdisco/perl5/lib/perl5/DBIx/Class/Exception.pm line 77 during global destruction.
DBIx::Class::Schema::Versioned::_on_connect(): Your DB is currently unversioned. Please call upgrade on your schema to sync the DB. at /home/netdisco/perl5/lib/perl5/DBICx/Sugar.pm line 121
error running job: DBIx::Class::Storage::DBI::catch {...} (): DBI Connection failed: DBI connect('dbname=netdisco;host=1.1.1.1','netdisco',...) failed: connection to server at "1.1.1.1", port 5432 failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections? at /home/netdisco/perl5/lib/perl5/DBIx/Class/Storage/DBI.pm line 1639. at /home/netdisco/perl5/lib/perl5/App/Netdisco/Util/Device.pm line 65

note the: (in cleanup) à<93>+KðU^@^@anup)

Possible Solution

Steps to Reproduce (for bugs)

  1. run netdisco and database on different hosts, connect using tcp
  2. reboot machine which runs database with netdisco-backend still running.

Context

Your Environment

Config info (deployment.yml)

Device information

https://github.com/netdisco/netdisco/wiki/Snapshot#share-a-snapshot

inphobia commented 5 months ago

at first glance it seems to be trying to print "cleanup" twice, but the second one gets corrupted somehow.

also found them in netdisco-web.log

2024/01/28-23:35:21 Server closing!
        (in cleanup) 300UtY`U^@^@anup)  at /home/netdisco/perl5/lib/perl5/DBIx/Class/Exception.pm line 77 during global destruction.
        (in cleanup) `343346Z`U^@^@anup)  at /home/netdisco/perl5/lib/perl5/DBIx/Class/Exception.pm line 77 during global destruction.
        (in cleanup) P337)[`U^@^@anup)  at /home/netdisco/perl5/lib/perl5/DBIx/Class/Exception.pm line 77 during global destruction.
        (in cleanup) Ю305Z`U^@^@anup)  at /home/netdisco/perl5/lib/perl5/DBIx/Class/Exception.pm line 77 during global destruction.
        (in cleanup) ^PS327Z`U^@^@anup)  at /home/netdisco/perl5/lib/perl5/DBIx/Class/Exception.pm line 77 during global destruction.

netdisco get's started with the following locale environment should that be relevant:

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=