BNS Logs - Subdomain is missing zone files

I see the following logs in our BNS node. The frequency of these logs is increasing exponentially.
@jude Can you please suggest how to fix this?

"[2020-01-02 07:11:37,391] [DEBUG] [subdomains:1508] (11.139794923431680) Subdomain is missing 34 zone files: Subdomain(fqn=aminhg.magnum_crux.id,domain=magnum_crux.id,seq=0,address=1EHuLw941TXsgVTEQTmdiT7oKbWeSTdfG,zfhash=9bb64d16ab6dd41fddb39467f61dd1b8415398f7,zfindex=113096)\n","stream":"stdout","time":"2020-01-02T07:11:37.753038936Z"

Hi @prakhar,

You should have all of your zone files in your subdomain registrar’s database. You can try re-sending them to the peer network with this Python2 script:

#!/usr/bin/env python

import blockstack.lib.client as client
import sys
import base64

if len(sys.argv) != 3:
    print 'Usage: {} URL ZONEFILE_PATH'.format(sys.argv[0])
    sys.exit(1)

url = sys.argv[1]
zonefile_txt = base64.b64encode(open(sys.argv[2]).read())

res = client.put_zonefiles(url, [zonefile_txt])
if 'error' in res:
    print >> sys.stderr, res['error']
    sys.exit(1)

print res
sys.exit(0)

You’d take each zone file from your subdomain database, save it as a file on disk, and use this script to push it to e.g. https://node.blockstack.org:6263 (or some other publicly-routable core node).

Note that the zone file must hash to a value_hash issued by one of your subdomain registrar’s NAME_UPDATE's. The script will tell you if this is not the case, since the core node will reply with an error message if so.

I ran the above script and got the following response for each Zonefile:
{u'status': True, u'indexing': False, u'lastblock': 611079, u'saved': [1]}

However, this doesn’t reduced the number of missing zonefiles in the debug logs.
[2020-01-03 11:37:31,527] [DEBUG] [subdomains:1508] (11.139794878588672) Subdomain is missing 34 zone files: Subdomain(fqn=zbgw.magnum_crux.id,domain=magnum_crux.id,seq=0,address=1PhK4Ja3FcEJ9996ug8NiePLDyFcSCQeMv,zfhash=956a78b64d4a117946bc870c629f67a3cad8d27b,zfindex=116908)

Also, I am able to resolve all these IDs. If the subdomain is missing zonefiles, how am i able to resolve these IDs?

Hey, it looks like you’re missing 34 instances of be038454dca670fdba1a95930d9786f88bf3dff6.

Here’s how to tell:

$ sqlite3 ~/.blockstack-server/atlas.db 'select zonefile_hash from zonefiles where name = "magnum_crux.id" and present = 0'
be038454dca670fdba1a95930d9786f88bf3dff6
be038454dca670fdba1a95930d9786f88bf3dff6
be038454dca670fdba1a95930d9786f88bf3dff6
...

Also, the response you saw from the script – the saved: [1] – indicates that the zone files were successfully relayed :+1:

Hey @jude,
Thank you for the help.
I am trying to understand what are the possible implications of these missing zonefiles?
I am still able to resolve the IDs which I see in the debug logs. If the zonefiles are missing, how the IDs are resolving successfully?

I am trying to understand what are the possible implications of these missing zonefiles?
I am still able to resolve the IDs which I see in the debug logs. If the zonefiles are missing, how the IDs are resolving successfully?

The loss of a zone file means that any off-chain username registrations in that zone file will be lost. It won’t affect other off-chain names you’ve registered.

If you can’t find the missing zone file, you can simply re-register the missing usernames.