"500" Internal Server Error and diagnosis failed for DNS

:uk:/:us: Message template (english)

My YunoHost server

Hardware: VPS bought online
YunoHost version: 11.2.4
I have access to my server : Through SSH | through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

I have similar issue as Can't open domain settings and Diagnosis DNS error

Which happen after I have add my own domain name (brought via porkbun and already config properly following DNS zone configuration | Yunohost Documentation), and now I can’t access or config my domain name as well as diagnosis error for domain check. I can still add new one or remove them via command line, but I can’t install certification on them. All of my apps installed in this VPS are running just fine. Thank you so much for your help!

Error: "500" Internal Server Error

Action: "GET" /yunohost/api/domains/my.domain.com?locale=en

Error message:
Unexpected server error

Traceback

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/moulinette/utils/filesystem.py", line 63, in read_json
    loaded_json = json.loads(file_content)
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/yunohost/certificate.py", line 94, in certificate_status
    _check_domain_is_ready_for_ACME(domain)
  File "/usr/lib/python3/dist-packages/yunohost/certificate.py", line 784, in _check_domain_is_ready_for_ACME
    Diagnoser.get_cached_report(
  File "/usr/lib/python3/dist-packages/yunohost/diagnosis.py", line 521, in get_cached_report
    report = read_json(cache_file)
  File "/usr/lib/python3/dist-packages/moulinette/utils/filesystem.py", line 65, in read_json
    raise MoulinetteError("corrupted_json", ressource=file_path, error=str(e))
moulinette.core.MoulinetteError: Corrupted JSON read from /var/cache/yunohost/diagnosis/dnsrecords.json (reason: Expecting value: line 1 column 1 (char 0))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/moulinette/interfaces/api.py", line 453, in process
    ret = self.actionsmap.process(arguments, timeout=30, route=_route)
  File "/usr/lib/python3/dist-packages/moulinette/actionsmap.py", line 580, in process
    return func(**arguments)
  File "/usr/lib/python3/dist-packages/yunohost/domain.py", line 162, in domain_info
    certificate = domain_cert_status([domain], full=True)["certificates"][domain]
  File "/usr/lib/python3/dist-packages/yunohost/domain.py", line 784, in domain_cert_status
    return certificate_status(domain_list, full)
  File "/usr/lib/python3/dist-packages/yunohost/certificate.py", line 97, in certificate_status
    if e.key == "certmanager_domain_not_diagnosed_yet":
AttributeError: 'MoulinetteError' object has no attribute 'key'

and for diagnosis failed for category ‘dnsrecords’

Diagnosis failed for category 'dnsrecords':
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/moulinette/utils/filesystem.py", line 63, in read_json
loaded_json = json.loads(file_content)
File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/yunohost/certificate.py", line 94, in certificate_status
_check_domain_is_ready_for_ACME(domain)
File "/usr/lib/python3/dist-packages/yunohost/certificate.py", line 784, in _check_domain_is_ready_for_ACME
Diagnoser.get_cached_report(
File "/usr/lib/python3/dist-packages/yunohost/diagnosis.py", line 521, in get_cached_report
report = read_json(cache_file)
File "/usr/lib/python3/dist-packages/moulinette/utils/filesystem.py", line 65, in read_json
raise MoulinetteError("corrupted_json", ressource=file_path, error=str(e))
moulinette.core.MoulinetteError: Corrupted JSON read from /var/cache/yunohost/diagnosis/dnsrecords.json (reason: Expecting value: line 1 column 1 (char 0))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/yunohost/diagnosis.py", line 183, in diagnosis_run
code, report = diagnoser.diagnose(force=force)
File "/usr/lib/python3/dist-packages/yunohost/diagnosis.py", line 430, in diagnose
items = list(self.run())
File "/usr/lib/python3/dist-packages/yunohost/diagnosers/12-dnsrecords.py", line 57, in run
for report in self.check_domain(
File "/usr/lib/python3/dist-packages/yunohost/diagnosers/12-dnsrecords.py", line 90, in check_domain
expected_configuration = _build_dns_conf(
File "/usr/lib/python3/dist-packages/yunohost/dns.py", line 164, in _build_dns_conf
domains_settings = {
File "/usr/lib/python3/dist-packages/yunohost/dns.py", line 165, in
domain: domain_config_get(domain, export=True)
File "/usr/lib/python3/dist-packages/yunohost/domain.py", line 599, in domain_config_get
return config.get(key, mode)
File "/usr/lib/python3/dist-packages/yunohost/domain.py", line 620, in get
result = super().get(key=key, mode=mode)
File "/usr/lib/python3/dist-packages/yunohost/utils/configpanel.py", line 110, in get
self._get_config_panel()
File "/usr/lib/python3/dist-packages/yunohost/utils/configpanel.py", line 332, in _get_config_panel
toml_config_panel = self._get_raw_config()
File "/usr/lib/python3/dist-packages/yunohost/domain.py", line 660, in _get_raw_config
status = certificate_status([self.entity], full=True)["certificates"][
File "/usr/lib/python3/dist-packages/yunohost/certificate.py", line 97, in certificate_status
if e.key == "certmanager_domain_not_diagnosed_yet":
AttributeError: 'MoulinetteError' object has no attribute 'key'


Not sure why the cache is corrupted but let’s try to clean it up with:

sudo rm  /var/cache/yunohost/diagnosis/dnsrecords.json
1 Like

Hello,

Thank you! It seems to fixed my problem and I can access and edit DNS like normal now!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.