Page 1 of 1

Adding remote DNS-host gives not found errors

Posted: Fri Sep 27, 2019 9:28 pm
by NordicSnowman
Running Debian 9.7 on both main and slave machine.

I have tried looking in the forums for similar errors but cannot find any solutions.
Anyone encountered this before?

I have tried using ip instead of host, same error.
Firewall open
User "dns-cluster" created and working on the slave server

All other functions, as far as i know, works perfect.

Using this:

Code: Select all

 v-add-remote-dns-host ns2.domainname.yyy 8083 dns-cluster password
This spits out the following.

Code: Select all

/usr/local/vesta/bin/v-add-remote-dns-host: 27: /usr/local/vesta/bin/v-add-remote-dns-host: source: not found
+ source /usr/local/vesta/func/remote.sh
/usr/local/vesta/bin/v-add-remote-dns-host: 28: /usr/local/vesta/bin/v-add-remote-dns-host: source: not found
+ source /usr/local/vesta/conf/vesta.conf
/usr/local/vesta/bin/v-add-remote-dns-host: 29: /usr/local/vesta/bin/v-add-remote-dns-host: source: not found
Suggestions? :)

Re: Adding remote DNS-host gives not found errors

Posted: Fri Sep 27, 2019 10:31 pm
by grayfolk
Try to

Code: Select all

 export PATH=$PATH:/usr/local/vesta/bin/

Re: Adding remote DNS-host gives not found errors

Posted: Fri Sep 27, 2019 10:42 pm
by NordicSnowman
grayfolk wrote:
Fri Sep 27, 2019 10:31 pm
Try to

Code: Select all

 export PATH=$PATH:/usr/local/vesta/bin/
No difference, same errors again.

Re: Adding remote DNS-host gives not found errors

Posted: Fri Sep 27, 2019 11:08 pm
by grayfolk
NordicSnowman wrote:
Fri Sep 27, 2019 10:42 pm
grayfolk wrote:
Fri Sep 27, 2019 10:31 pm
Try to

Code: Select all

 export PATH=$PATH:/usr/local/vesta/bin/
No difference, same errors again.
Ok, try

Code: Select all

export VESTA=/usr/local/vesta/
before v-add-remote-dns-host

Re: Adding remote DNS-host gives not found errors

Posted: Sat Sep 28, 2019 10:07 am
by NordicSnowman
grayfolk wrote:
Fri Sep 27, 2019 11:08 pm
NordicSnowman wrote:
Fri Sep 27, 2019 10:42 pm
grayfolk wrote:
Fri Sep 27, 2019 10:31 pm
Try to

Code: Select all

 export PATH=$PATH:/usr/local/vesta/bin/
No difference, same errors again.
Ok, try

Code: Select all

export VESTA=/usr/local/vesta/
before v-add-remote-dns-host
Nope

Tried the same thing on the slave machine, it gets the same errors on Debian 9.7

But on my other machines, Debian 9.5 it works perfect.

Re: Adding remote DNS-host gives not found errors

Posted: Sat Sep 28, 2019 10:46 am
by NordicSnowman
Running the command without the "sh -x", i get this

Code: Select all

root@hsxxx:~# v-add-remote-dns-host ns2.domain.yyy 8083 admin unkWDcaP1f
/usr/local/vesta/func/remote.sh: line 26: return: Error:: numeric argument required
Error: api connection to ns2.domain.yyy failed
Looks like its the sending of the API-command at line 26, but no clue why it fails like this.

I might have missed something, killing these two machines now and installing from scratch once again to make sure i didn't cause the problem myself :)

Re: Adding remote DNS-host gives not found errors

Posted: Sat Sep 28, 2019 6:12 pm
by NordicSnowman
Well, nothing new, still the same issues.

Re-installed two new VPS machines, one master and one slave.
Just a plain installation, no tricks of fixes at all.
(similar errors found when trying to create letsencrypt ssl´s)

Still get "not found" on the scripts, i have browsed through the forums all day but i cannot find anything even remotely similar.
Tried a bunch of other stuff just to be sure, no luck.

It´s not live-servers yet so not a emergency right now, maybe something in Vesta incompatible with Debian 9.7 ?
Because my Deb 8 & 9.5 machines works perfect with identical setup.

Code: Select all

+ host=ns2.xxx.xx
+ HOST=ns2.xxx.xx
+ port=8083
+ PORT=8083
+ user=dns-cluster
+ USER=dns-cluster
+ password=password
+ HIDE=4
+ PASSWORD=password
+ type=api
+ TYPE=api
+ dns_user=dns-cluster
+ DNS_USER=dns-cluster
+ source /usr/local/vesta//func/main.sh
/usr/local/vesta/bin/v-add-remote-dns-host: 27: /usr/local/vesta/bin/v-add-remote-dns-host: source: not found
+ source /usr/local/vesta/func/remote.sh
/usr/local/vesta/bin/v-add-remote-dns-host: 28: /usr/local/vesta/bin/v-add-remote-dns-host: source: not found
+ source /usr/local/vesta/conf/vesta.conf
/usr/local/vesta/bin/v-add-remote-dns-host: 29: /usr/local/vesta/bin/v-add-remote-dns-host: source: not found
+ args_usage=HOST PORT USER PASSWORD [TYPE] [DNS_USER]
+ check_args 4 4 HOST PORT USER PASSWORD [TYPE] [DNS_USER]
/usr/local/vesta/bin/v-add-remote-dns-host: 37: /usr/local/vesta/bin/v-add-remote-dns-host: check_args: not found
+ is_format_valid host port user type dns_user
/usr/local/vesta/bin/v-add-remote-dns-host: 38: /usr/local/vesta/bin/v-add-remote-dns-host: is_format_valid: not found
+ is_system_enabled  DNS_SYSTEM
/usr/local/vesta/bin/v-add-remote-dns-host: 39: /usr/local/vesta/bin/v-add-remote-dns-host: is_system_enabled: not found
+ is_password_valid
/usr/local/vesta/bin/v-add-remote-dns-host: 40: /usr/local/vesta/bin/v-add-remote-dns-host: is_password_valid: not found
+ is_dnshost_new
/usr/local/vesta/bin/v-add-remote-dns-host: 41: /usr/local/vesta/bin/v-add-remote-dns-host: is_dnshost_new: not found
+ is_dnshost_alive
/usr/local/vesta/bin/v-add-remote-dns-host: 42: /usr/local/vesta/bin/v-add-remote-dns-host: is_dnshost_alive: not found
+ date +%T %F
+ time_n_date=20:38:09 2019-09-27
+ echo 20:38:09 2019-09-27+
cut -f 1 -d
+ time=20:38:09
+ echo 20:38:09 2019-09-27
+ cut -f 2 -d
+ date=2019-09-27
+ str=HOST='ns2.xxx.xx' PORT='8083' USER='dns-cluster' PASSWORD='password'
+ str=HOST='ns2.xxx.xx' PORT='8083' USER='dns-cluster' PASSWORD='password' DNS_USER='dns-cluster' TYPE='api' SUSPENDED='no'
+ str=HOST='ns2.xxx.xx' PORT='8083' USER='dns-cluster' PASSWORD='password' DNS_USER='dns-cluster' TYPE='api' SUSPENDED='no' TIME='20:38:09' DATE='2019-09-27'
+ echo HOST='ns2.xxx.xx' PORT='8083' USER='dns-cluster' PASSWORD='password' DNS_USER='dns-cluster' TYPE='api' SUSPENDED='no' TIME='20:38:09' DATE='2019-09-27'
+ chmod 660 /usr/local/vesta/conf/dns-cluster.conf
+ grep DNS_CLUSTER /usr/local/vesta/conf/vesta.conf
+ [ -z  ]
+ sed -i s/^STATS_/DNS_CLUSTER='yes'\nSTATS_/g /usr/local/vesta/conf/vesta.conf
+ cluster_cmd v-add-cron-restart-job
/usr/local/vesta/bin/v-add-remote-dns-host: 71: /usr/local/vesta/bin/v-add-remote-dns-host: cluster_cmd: not found
+ check_result 127 ns2.xxx.xx connection failed
/usr/local/vesta/bin/v-add-remote-dns-host: 72: /usr/local/vesta/bin/v-add-remote-dns-host: check_result: not found
+ /v-sync-dns-cluster ns2.xxx.xx
/usr/local/vesta/bin/v-add-remote-dns-host: 75: /usr/local/vesta/bin/v-add-remote-dns-host: /v-sync-dns-cluster: not found
+ check_result 127 ns2.xxx.xx sync failed
/usr/local/vesta/bin/v-add-remote-dns-host: 76: /usr/local/vesta/bin/v-add-remote-dns-host: check_result: not found
+ cmd=sudo /usr/local/vesta/bin/v-update-sys-queue dns-cluster
+ grep sudo /usr/local/vesta/bin/v-update-sys-queue dns-cluster /usr/local/vesta/data/users/admin/cron.conf
+ check_cron=
+ [ -z  ]
+ [ ! -z  ]
+ log_event
/usr/local/vesta/bin/v-add-remote-dns-host: 91: /usr/local/vesta/bin/v-add-remote-dns-host: log_event: not found
+ exit

Re: Adding remote DNS-host gives not found errors

Posted: Tue Oct 01, 2019 10:40 am
by NordicSnowman
I kinda "solved" this myself after a few days.

Run

Code: Select all

v-add-remote-dns-host ns2.domainname.yyy 8083 dns-cluster password
After this, changing this file
/usr/local/vesta/conf/dns-cluster.conf

Changing this (the user from dns-cluster to admin, leave your password and other details)

Code: Select all

HOST='ns2.domain.yyy' PORT='8083' USER='dns-cluster' PASSWORD='password' DNS_USER='dns-cluster' TYPE='api' SUSPENDED='yes' TIME='09:40:23' DATE='2019-10-01'
to

Code: Select all

`HOST='ns2.domain.yyy' PORT='8083' USER='admin' PASSWORD='password' DNS_USER='dns-cluster' TYPE='api' SUSPENDED='yes' TIME='09:40:23' DATE='2019-10-01'`
After this, i ran

Code: Select all

v-unsuspend-remote-dns-host

v-sync-dns-cluster
Got the ideas by comparing other files on my working setup, where the user was admin and not dns-cluster as the created file had.

Looking in the logs i saw this:

Code: Select all

++ curl -s -k --data-urlencode user=dns-cluster --data-urlencode password=1234 --data-urlencode returncode=yes --data-urlencode cmd=v-delete-dns-domains-src --data-urlencode arg1=dns-cluster --data-urlencode arg2=hsxxx.yy --data-urlencode arg3=no --data-urlencode arg4= --data-urlencode arg5= --data-urlencode arg6= --data-urlencode arg7= --data-urlencode arg8= https://ns2.hsxxx.yy:8083/api/
+ answer='Error: authentication failed'
+ return 'Error: authentication failed'
This answer should be numeric - it wasnt due to the wrong user in the file above.

Why this happened (on several installed vps´s - i dont really know - there is probably a better solution out there than this...

Re: Adding remote DNS-host gives not found errors

Posted: Sat May 09, 2020 11:53 pm
by blackdiamondsoftware
After hours of searching and banging my head off the table i noticed that the command v-list-remote-dns-hosts
responded with bad data, the port number for the vestacp 8083 was repeated in the DNS user section and the provided password was all garbled and had half the add remote host command in in.

this lead me to your post and yes once i edited /usr/local/vesta/conf/dns-cluster.conf and ran the sync it worked

Thanks and if VESTA is watching they should really address or document this issue