<p>Few checkpoints for you before you even start:</p>
<ol>
<li>Check status for services:
sudo systemctl status cnode
sudo systemctl status cnode-dbsync</li>
<li>Since you've used Guild-Ops scripts, you've already got <a href="https://cardano-community.github.io/guild-operators/Scripts/gliveview/" rel="nofollow noreferrer">gLiveView</a> installed in <code>$CNODE_HOME/scripts</code> folder. I assume you went through <a href="https://cardano-community.github.io/guild-operators/Scripts/env/" rel="nofollow noreferrer">documentation</a> to ensure you've updated variables in <code>env</code> file.</li>
<li>Before looking at dbsync, I'd first recommend you ensure your node is working and in sync - gLiveView gives a nice little overview to check status of your node.</li>
<li>All the logs are in $CNODE_HOME/logs folder, the node (by default) would be node0.json. So if any of the component isnt working, you'd need to check corresponding log file for the cause.</li>
</ol>

CC BY-SA 4.0
2023-09-13T23:58:40.770Z
2023-09-13T23:58:40.770Z
RdLrT
<p>I've restored a <a href="https://update-cardano-mainnet.iohk.io/cardano-db-sync/index.html#13.1/" rel="nofollow noreferrer">recent db-sync snapshot</a> (I am running node 8.1.2). The restore was successful; I can run SQL queries against the default <code>cexplorer</code> database. However, there seems to be an issue when I begin running db-sync to sync the rest of the way.</p>
<p>For context, I am using the <a href="https://cardano-community.github.io/guild-operators/Build/dbsync/" rel="nofollow noreferrer">Guild Operator's scripts</a> (<code>.dbsync.sh -d</code>); the systemd service deploys successfully, but after several hours the (restored) database still appears not to be syncing, as evidenced when I run:</p>
<pre><code>cexplorer=# select now () - max (time) as behind_by from block ;
       behind_by
------------------------
 5 days 22:44:28.094372
(1 row)
</code></pre>
<p>And after several minutes:</p>
<pre><code>cexplorer=# select now () - max (time) as behind_by from block ;
       behind_by
------------------------
 5 days 22:58:38.184134
(1 row)
</code></pre>
<p><strong>The <code>behind_by</code> value keeps increasing</strong>, so I assume the databse is not syncing.</p>
<p>Here are the log message(s) after running <code>tail -10f $CNODE_HOME/logs/dbsync.json</code>:</p>
<p><code>{&quot;app&quot;:[],&quot;at&quot;:&quot;2023-09-13T20:45:54.69Z&quot;,&quot;data&quot;:{&quot;kind&quot;:&quot;LogMessage&quot;,&quot;message&quot;:&quot;Handling input offset 22100000&quot;},&quot;env&quot;:&quot;&lt;unknown&gt;:00000&quot;,&quot;host&quot;:&quot;&quot;,&quot;loc&quot;:null,&quot;msg&quot;:&quot;&quot;,&quot;ns&quot;:[&quot;db-sync-node&quot;],&quot;pid&quot;:&quot;918006&quot;,&quot;sev&quot;:&quot;Info&quot;,&quot;thread&quot;:&quot;6&quot;}</code></p>
<p>Any ideas what could be wrong or what the log message means?</p>

CC BY-SA 4.0
2023-09-13T21:21:32.710Z
The reason why its not syncing will almost certainly be obvious if you look at the logs of both the `node` and `db-sync`.
Erik de Castro Lopo
CC BY-SA 4.0
2023-09-13T21:30:09.877Z
I asked cause I'm definitely a noob.

I suspect it has something to do with the "Handling input offset" message, but not sure what it means.
zhekson
CC BY-SA 4.0
2023-09-13T23:33:27.910Z
Nothing to do with that message. That is an effect not a cause and it gives zero clue as to the actual cause.
Erik de Castro Lopo
CC BY-SA 4.0
2023-09-13T23:38:31.720Z
so then which log files are you referring to?
zhekson
CC BY-SA 4.0
2023-09-13T23:44:24.483Z
The logs for the `node` and the logs for `db-sync`. One or the other should have the proper cause. I am not familiar with the Guild operator scripts so I am not sure where the log files are. Probably in `$CNODE_HOME`
Erik de Castro Lopo
<cardano-db-sync>
db-sync not syncing
# db-sync not syncing

(Asked by: username_0 on 2023-09-13)

I've restored a recent db-sync snapshot (I am running node 8.1.2). The restore was successful; I can run SQL queries against the default cexplorer database. However, there seems to be an issue when I begin running db-sync to sync the rest of the way.
For context, I am using the Guild Operator's scripts (.dbsync.sh -d); the systemd service deploys successfully, but after several hours the (restored) database still appears not to be syncing, as evidenced when I run:
cexplorer=# select now () - max (time) as behind_by from block ;
       behind_by
------------------------
 5 days 22:44:28.094372
(1 row)

And after several minutes:
cexplorer=# select now () - max (time) as behind_by from block ;
       behind_by
------------------------
 5 days 22:58:38.184134
(1 row)

The behind_by value keeps increasing, so I assume the databse is not syncing.
Here are the log message(s) after running tail -10f $CNODE_HOME/logs/dbsync.json:
{"app":[],"at":"2023-09-13T20:45:54.69Z","data":{"kind":"LogMessage","message":"Handling input offset 22100000"},"env":":00000","host":"","loc":null,"msg":"","ns":["db-sync-node"],"pid":"918006","sev":"Info","thread":"6"}
Any ideas what could be wrong or what the log message means?

**Tags:** cardano-db-sync
> **Comments:**
> **username_1**: The reason why its not syncing will almost certainly be obvious if you look at the logs of both the `node` and `db-sync`.  
> **username_0**: I asked cause I'm definitely a noob.  I suspect it has something to do with the "Handling input offset" message, but not sure what it means.  
> **username_1**: Nothing to do with that message. That is an effect not a cause and it gives zero clue as to the actual cause.  
> **username_0**: so then which log files are you referring to?  
> **username_1**: The logs for the `node` and the logs for `db-sync`. One or the other should have the proper cause. I am not familiar with the Guild operator scripts so I am not sure where the log files are. Probably in `$CNODE_HOME`  

---

## 1 answers

### Answer by username_2 on 2023-09-13. Score: 1

Few checkpoints for you before you even start:

1. Check status for services:
   sudo systemctl status cnode
   sudo systemctl status cnode-dbsync
2. Since you've used Guild-Ops scripts, you've already got [gLiveView](https://cardano-community.github.io/guild-operators/Scripts/gliveview/) installed in `$CNODE_HOME/scripts` folder. I assume you went through [documentation](https://cardano-community.github.io/guild-operators/Scripts/env/) to ensure you've updated variables in `env` file.
3. Before looking at dbsync, I'd first recommend you ensure your node is working and in sync - gLiveView gives a nice little overview to check status of your node.
4. All the logs are in $CNODE\_HOME/logs folder, the node (by default) would be node0.json. So if any of the component isnt working, you'd need to check corresponding log file for the cause.


---

