<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[After migration of postgre to timescale the daemon service stucks on start]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I am struggling to get 3.4.178 on Windows to work with PostgreSQL 12.1 + timescale running on Centos 8.1. <br />
I upgraded working system from 3.2 to 3.4.<br />
It can work with "clasic" DB still.<br />
Working db has been migrated to TimeScale type with no error.<br />
Netxms 3.4.178 works if I direct it to use the "old" db.<br />
With the migrated db the daemon service stucks on start.</p>
<p dir="auto">Could you advise what to check, please.</p>
<p dir="auto">Diagnostic log is attached.</p>
<p dir="auto">Thanks<br />
MI<br />
 </p>
<hr />
<p dir="auto"><a href="/assets/uploads/files/smf/0000000005214-netxmsd.log">netxmsd.log</a></p>
]]></description><link>https://forum.netxms.org/topic/6591/after-migration-of-postgre-to-timescale-the-daemon-service-stucks-on-start</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 11:11:57 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/6591.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 02 Jul 2020 11:48:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to After migration of postgre to timescale the daemon service stucks on start on Thu, 16 Jul 2020 08:44:43 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">it looks like we setup hypertables in a wrong way, adding unnecessary space partitioning. This causes hypertable to have lots of chunks, so queries like SELECT max(event_id)  ... took lot of time, because each chunk should be queried. For net major release we already implemented conversion of log tables structure. You can wait for it (likely release time is September) or you can try to convert your event_log and alarms tables manually using the following queries:</p>
<pre><code>ALTER TABLE alarms RENAME TO old_alarms;
CREATE TABLE alarms (
   alarm_id integer not null,
   parent_alarm_id integer not null,
   alarm_state integer not null,
   hd_state integer not null,
   hd_ref varchar(63) null,
   creation_time integer not null,
   last_change_time integer not null,
   rule_guid varchar(36) null,
   source_object_id integer not null,
   zone_uin integer not null,
   source_event_code integer not null,
   source_event_id bigint not null,
   dci_id integer not null,
   message varchar(2000) null,
   original_severity integer not null,
   current_severity integer not null,
   repeat_count integer not null,
   alarm_key varchar(255) null,
   ack_by integer not null,
   resolved_by integer not null,
   term_by integer not null,
   timeout integer not null,
   timeout_event integer not null,
   ack_timeout integer not null,
   alarm_category_ids varchar(255) null,
   event_tags varchar(2000) null,
   rca_script_name varchar(255) null,
   impact varchar(1000) null,
   PRIMARY KEY(alarm_id));
CREATE INDEX idx_alarms_source_object_id ON alarms(source_object_id);
CREATE INDEX idx_alarms_last_change_time ON alarms(last_change_time);
INSERT INTO alarms (alarm_id,parent_alarm_id,alarm_state,hd_state,hd_ref,creation_time,last_change_time,rule_guid,source_object_id,zone_uin,source_event_code,source_event_id,dci_id,message,original_severity,current_severity,repeat_count,alarm_key,ack_by,resolved_by,term_by,timeout,timeout_event,ack_timeout,alarm_category_ids,event_tags,rca_script_name,impact) SELECT alarm_id,parent_alarm_id,alarm_state,hd_state,hd_ref,creation_time,last_change_time,rule_guid,source_object_id,zone_uin,source_event_code,source_event_id,dci_id,message,original_severity,current_severity,repeat_count,alarm_key,ack_by,resolved_by,term_by,timeout,timeout_event,ack_timeout,alarm_category_ids,event_tags,rca_script_name,impact FROM old_alarms;
DROP TABLE old_alarms CASCADE;

ALTER TABLE event_log RENAME TO old_event_log;
DROP INDEX IF EXISTS idx_event_log_event_timestamp;
DROP INDEX IF EXISTS idx_event_log_source;
DROP INDEX IF EXISTS idx_event_log_root_id;
CREATE TABLE event_log (
   event_id bigint not null,
   event_code integer not null,
   event_timestamp integer not null,
   origin integer not null,
   origin_timestamp integer not null,
   event_source integer not null,
   zone_uin integer not null,
   dci_id integer not null,
   event_severity integer not null,
   event_message varchar(2000) null,
   event_tags varchar(2000) null,
   root_event_id bigint not null,
   raw_data text null,
   PRIMARY KEY(event_id,event_timestamp));
CREATE INDEX idx_event_log_event_timestamp ON event_log(event_timestamp);
CREATE INDEX idx_event_log_source ON event_log(event_source);
CREATE INDEX idx_event_log_root_id ON event_log(root_event_id) WHERE root_event_id &gt; 0;
SELECT create_hypertable('event_log', 'event_timestamp', chunk_time_interval =&gt; 86400);
INSERT INTO event_log (event_id,event_code,event_timestamp,origin,origin_timestamp,event_source,zone_uin,dci_id,event_severity,event_message,event_tags,root_event_id,raw_data) SELECT event_id,event_code,event_timestamp,origin,origin_timestamp,event_source,zone_uin,dci_id,event_severity,event_message,event_tags,root_event_id,raw_data FROM old_event_log;
DROP TABLE old_event_log CASCADE;
</code></pre>
<p dir="auto">Please note that data copy could take significant time. If you are not intended to keep existing event log you can just drop event_log table and create new one.</p>
<p dir="auto">Don't forget to make database snapshot or backup before trying this!</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/28252</link><guid isPermaLink="true">https://forum.netxms.org/post/28252</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Thu, 16 Jul 2020 08:44:43 GMT</pubDate></item><item><title><![CDATA[Reply to After migration of postgre to timescale the daemon service stucks on start on Wed, 15 Jul 2020 19:15:21 GMT]]></title><description><![CDATA[<p dir="auto">Any tips what may be wrong with timescaleDB?</p>
<p dir="auto">BR<br />
MI</p>
]]></description><link>https://forum.netxms.org/post/28245</link><guid isPermaLink="true">https://forum.netxms.org/post/28245</guid><dc:creator><![CDATA[mibox33]]></dc:creator><pubDate>Wed, 15 Jul 2020 19:15:21 GMT</pubDate></item><item><title><![CDATA[Reply to After migration of postgre to timescale the daemon service stucks on start on Wed, 08 Jul 2020 13:57:42 GMT]]></title><description><![CDATA[<p dir="auto">"EXPLAIN ANALYZE SELECT max(event_id) FROM event_log;"<br />
Message: Successfully run. Total query runtime: 3 min 42 secs. 26641 rows affected.<br />
Output = attached in 7z file</p>
<p dir="auto">For the second query: "EXPLAIN ANALYZE SELECT max(alarm_id) FROM alarms;"<br />
Message:  Successfully run. Total query runtime: 9 secs 232 msec. 3211 rows affected.<br />
Output: attached</p>
<p dir="auto">In 7z I also included running postgresql.conf file.<br />
After applying timescaleDB extension I run their tuning script and accepted the suggested changes.<br />
It means postgresql.conf contains values alterred by tune script + my mod = increased "max_locks_per_transaction".<br />
The original clasic netxms DB also served by the engine works fine with the settings.</p>
<p dir="auto">Regards<br />
MI</p>
<hr />
<p dir="auto"><a href="/assets/uploads/files/smf/0000000005221-timescale_queries.7z">timescale_queries.7z</a></p>
]]></description><link>https://forum.netxms.org/post/28207</link><guid isPermaLink="true">https://forum.netxms.org/post/28207</guid><dc:creator><![CDATA[mibox33]]></dc:creator><pubDate>Wed, 08 Jul 2020 13:57:42 GMT</pubDate></item><item><title><![CDATA[Reply to After migration of postgre to timescale the daemon service stucks on start on Tue, 07 Jul 2020 15:22:27 GMT]]></title><description><![CDATA[<p dir="auto">As for max_locks_per_transaction - I would first check general postgres parameters, first of all probably shared_buffer.<br />
Out of the box Postgres settings are very conservative.<br />
See e.g. <a href="https://www.percona.com/blog/2018/08/31/tuning-postgresql-database-parameters-to-optimize-performance/" rel="nofollow ugc">https://www.percona.com/blog/2018/08/31/tuning-postgresql-database-parameters-to-optimize-performance/</a></p>
]]></description><link>https://forum.netxms.org/post/28201</link><guid isPermaLink="true">https://forum.netxms.org/post/28201</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Tue, 07 Jul 2020 15:22:27 GMT</pubDate></item><item><title><![CDATA[Reply to After migration of postgre to timescale the daemon service stucks on start on Tue, 07 Jul 2020 13:51:35 GMT]]></title><description><![CDATA[<p dir="auto">Can you connect to postgres and show output of these queries:</p>
<p dir="auto">EXPLAIN ANALYZE SELECT max(event_id) FROM event_log</p>
<p dir="auto">EXPLAIN ANALYZE SELECT max(alarm_id) FROM alarms</p>
]]></description><link>https://forum.netxms.org/post/28200</link><guid isPermaLink="true">https://forum.netxms.org/post/28200</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Tue, 07 Jul 2020 13:51:35 GMT</pubDate></item><item><title><![CDATA[Reply to After migration of postgre to timescale the daemon service stucks on start on Tue, 07 Jul 2020 09:00:16 GMT]]></title><description><![CDATA[<p dir="auto">I did run nxdbmgr init and selected timescale prior migrating from classic db.<br />
Prior migration I also run nxdbmgr check to make sure the source is clean.<br />
Migration took some 20min but overall went smooth without any error reported.<br />
After migration nxdbmgr check does not complan also.</p>
<p dir="auto">Attached is log file (.7z) captured with -D 9.   </p>
<p dir="auto">Thanks<br />
MI</p>
<hr />
<p dir="auto"><a href="/assets/uploads/files/smf/0000000005220-netxmsd.7z">netxmsd.7z</a></p>
]]></description><link>https://forum.netxms.org/post/28198</link><guid isPermaLink="true">https://forum.netxms.org/post/28198</guid><dc:creator><![CDATA[mibox33]]></dc:creator><pubDate>Tue, 07 Jul 2020 09:00:16 GMT</pubDate></item><item><title><![CDATA[Reply to After migration of postgre to timescale the daemon service stucks on start on Mon, 06 Jul 2020 16:50:34 GMT]]></title><description><![CDATA[<p dir="auto">Did you initialize timescale DB with nxdbmgr init prior to importing data into it?<br />
Can you set debuglevel = 9, run the server for 5-10 minutes and show the log?<br />
Alternative approach would watch from the database side on what queries it's getting stuck.</p>
]]></description><link>https://forum.netxms.org/post/28193</link><guid isPermaLink="true">https://forum.netxms.org/post/28193</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Mon, 06 Jul 2020 16:50:34 GMT</pubDate></item><item><title><![CDATA[Reply to After migration of postgre to timescale the daemon service stucks on start on Sun, 05 Jul 2020 12:42:52 GMT]]></title><description><![CDATA[<p dir="auto">so just the log file is attached</p>
<hr />
<p dir="auto"><a href="/assets/uploads/files/smf/0000000005219-netxmsd.zip">netxmsd.zip</a></p>
]]></description><link>https://forum.netxms.org/post/28188</link><guid isPermaLink="true">https://forum.netxms.org/post/28188</guid><dc:creator><![CDATA[mibox33]]></dc:creator><pubDate>Sun, 05 Jul 2020 12:42:52 GMT</pubDate></item><item><title><![CDATA[Reply to After migration of postgre to timescale the daemon service stucks on start on Sun, 05 Jul 2020 12:38:35 GMT]]></title><description><![CDATA[<p dir="auto">Update:</p>
<p dir="auto">Following <a href="https://docs.timescale.com/latest/getting-started/configuring" rel="nofollow ugc">https://docs.timescale.com/latest/getting-started/configuring</a><br />
max_locks_per_transaction = 2 * num_chunks<br />
I increased max_locks_per_transaction from 64 (default) to 256.<br />
 <br />
The server service starts in 4min, however produces at right after about 10k failed SQL queries and the number keeps growing (current count exids 180k).</p>
<p dir="auto">BTW what value you suggest to set.</p>
<p dir="auto">Client starts and seems to work.</p>
<p dir="auto">Wanted to attache info file (2MB in size ) but getting "413 Request Entity Too Large" error.</p>
<p dir="auto">Regards<br />
MI</p>
]]></description><link>https://forum.netxms.org/post/28187</link><guid isPermaLink="true">https://forum.netxms.org/post/28187</guid><dc:creator><![CDATA[mibox33]]></dc:creator><pubDate>Sun, 05 Jul 2020 12:38:35 GMT</pubDate></item><item><title><![CDATA[Reply to After migration of postgre to timescale the daemon service stucks on start on Sun, 05 Jul 2020 06:55:11 GMT]]></title><description><![CDATA[<p dir="auto">The logs are attached.<br />
_net* is the file I found very surprising.<br />
It seems the service got started eventually - after over 8h.</p>
<p dir="auto">Regards<br />
Marek</p>
<hr />
<p dir="auto"><a href="/assets/uploads/files/smf/0000000005216-netxmsd.log">netxmsd.log</a></p>
<p dir="auto"><a href="/assets/uploads/files/smf/0000000005217-netxmsd.log">_netxmsd.log</a></p>
<p dir="auto"><a href="/assets/uploads/files/smf/0000000005218-nxdbmgr_check.log">nxdbmgr_check.log</a></p>
]]></description><link>https://forum.netxms.org/post/28186</link><guid isPermaLink="true">https://forum.netxms.org/post/28186</guid><dc:creator><![CDATA[mibox33]]></dc:creator><pubDate>Sun, 05 Jul 2020 06:55:11 GMT</pubDate></item><item><title><![CDATA[Reply to After migration of postgre to timescale the daemon service stucks on start on Fri, 03 Jul 2020 09:08:13 GMT]]></title><description><![CDATA[<p dir="auto">With TS db the server does not crash nor exits -  the service simply remains in "starting" state indefinitely.<br />
CPU load it generates during start is almost zero, also postgres is idling. <br />
I'll attached the log file created with -D 7 likely tomorrow.</p>
<p dir="auto">Thanks for your support.</p>
<p dir="auto">BR<br />
MI</p>
]]></description><link>https://forum.netxms.org/post/28177</link><guid isPermaLink="true">https://forum.netxms.org/post/28177</guid><dc:creator><![CDATA[mibox33]]></dc:creator><pubDate>Fri, 03 Jul 2020 09:08:13 GMT</pubDate></item><item><title><![CDATA[Reply to After migration of postgre to timescale the daemon service stucks on start on Fri, 03 Jul 2020 08:36:33 GMT]]></title><description><![CDATA[<p dir="auto">Ok, please set DebugLevel = 7 in server configuration, start the server, wait until it crashes or exits and share the log file.</p>
]]></description><link>https://forum.netxms.org/post/28175</link><guid isPermaLink="true">https://forum.netxms.org/post/28175</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Fri, 03 Jul 2020 08:36:33 GMT</pubDate></item><item><title><![CDATA[Reply to After migration of postgre to timescale the daemon service stucks on start on Thu, 02 Jul 2020 20:13:57 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for prompt reply.</p>
<p dir="auto">nxdbmgr check - no errors.<br />
Both clasic and TS are clean.<br />
I attached the complete output generated by your script.</p>
<p dir="auto">BR<br />
MI </p>
<hr />
<p dir="auto"><a href="/assets/uploads/files/smf/0000000005215-netxms.info.20200701-161342.zip">netxms.info.20200701-161342.zip</a></p>
]]></description><link>https://forum.netxms.org/post/28173</link><guid isPermaLink="true">https://forum.netxms.org/post/28173</guid><dc:creator><![CDATA[mibox33]]></dc:creator><pubDate>Thu, 02 Jul 2020 20:13:57 GMT</pubDate></item><item><title><![CDATA[Reply to After migration of postgre to timescale the daemon service stucks on start on Thu, 02 Jul 2020 12:18:50 GMT]]></title><description><![CDATA[<ol>
<li>The log file looks incomplete. Seems that you first started the server with low debug level, it ended with<br />
2020.07.01 16:06:19.834 *E* [                   ] Error initializing component locks table</li>
</ol>
<p dir="auto">The you started with higher debug, but it did not end up with the same error. Or have the server crashed?</p>
<ol start="2">
<li>Please try to run<br />
nxdbmgr check</li>
</ol>
<p dir="auto">What output does it produce?</p>
]]></description><link>https://forum.netxms.org/post/28168</link><guid isPermaLink="true">https://forum.netxms.org/post/28168</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Thu, 02 Jul 2020 12:18:50 GMT</pubDate></item></channel></rss>