Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Can Not add DNS records....display and delete work fine. #1341

Closed
cagivacode opened this issue Oct 21, 2024 · 6 comments
Closed

[BUG] Can Not add DNS records....display and delete work fine. #1341

cagivacode opened this issue Oct 21, 2024 · 6 comments

Comments

@cagivacode
Copy link

Operating system:
Ubuntu 20.04 LTS

CyberPanel version:
Current Version: 2.3 Build: 7 Current Commit: bfc2fc4

Not sure when this started, I do not add records that often, I do not use cloudflare.

The Add/Modify DNS Zone page works --- record are successfully displayed (fetched) --- delete records works as intended.

Trying to add any kind of record does not work --- the records are simply re-fetched with nothing added -- no error is displayed.

I have checked the database table (records) directly and the new record is not added.

The log file shows this at every attempt:
[10.20.2024_23-52-34] get() returned more than one Records -- it returned 3! [createDNSRecord]
[10.20.2024_23-54-07] Records matching query does not exist. [createDNSRecord]

Note: I have been making DNS changes this week: added DNSEC and upgraded PDNS (4.9.2). I needed to add secondary DNS servers that use the catalog feature.

I believe PDNS has added new tables in the process, but I don't think the RECORD table was changed in that schema.

id Primar
domain_id
name
type
content
ttl
prio
change_date
disabled
ordername
auth
domainOwner_id

I have looked at the Cyberpanel code, but I can't see the query that is causing the error.

any help would be appreciated

@usmannasir
Copy link
Owner

Hi,

I am able to add records, it can be your server related issue, can you email to help@cyberpanel.net with your server access, we will check and fix if there is any bug.

@cagivacode
Copy link
Author

@usmannasir I appreciate the offer, but my server is so locked down I would have to disable several levels of security to give someone access.

I have been able to determine that the last SQL call is:

SELECT records.domainOwner_id, records.id, records.domain_id, records.name, records.type, records.content, records.ttl, records.prio, records.change_date, records.disabled, records.ordername, records.auth FROM records WHERE (records.domainOwner_id = 15 AND records.type = 'SOA') LIMIT 21

When manually run it does return the SOA record.

Bizarrely, it has to do with SOA record parsing.

My newly added domains work and older ones do not.

I found that my older domains have an extra space between the "hostmaster address" and the "serial number". The extra space is being seen as a leading space (character).

The failure is during the serial number being incremented because of the leading space.

I manually changed my SOA records in the database and have solved the issue, but you may want to look at the SOA incrementing routine.

regards.

@usmannasir
Copy link
Owner

Looks like problem is somewhere here:

if zone.type == 'MASTER':

@usmannasir
Copy link
Owner

Can you show me example of your SOA value.

@cagivacode
Copy link
Author

cagivacode commented Oct 22, 2024

Not sure how/when these were added, I have used cyberpanel for many years. I may have bumped up the Serial Number in 2023, or I could have entered them then.

First one works, the second one does not. If I put these in....it could be just a cut and paste thing.

ns21.example.com hostmaster.example.com 2023113006 43200 7200 1209600 300
ns21.example.com hostmaster.example.com 2023113006 43200 7200 1209600 300

Just stripping leading and trailing spaces on the serial number would cure this, but I don't know how common of an error this can be.

Note: I can't show you because github is striping the extra space bewteen the "m" of .com and the "2" of the serial.

usmannasir added a commit that referenced this issue Oct 23, 2024
@usmannasir
Copy link
Owner

You can upgrade and try, should be OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants