Page 1 of 1

"Error: web template not found" when trying to add domain - Templates folder looks okay?

Posted: Thu Feb 11, 2016 12:04 am
by weirdaljr
Hello,

I wanted to see if anyone could point me in the right direction of what could be causing the "Error: web template not found" when trying to add a new domain in VestaCP. I checked what i thought was the correct template folders and the files all seem to be there, but I wasn't sure what else this error could be referring to?

Code: Select all

/usr/local/vesta/data/templates/web/apache2# ls
basedir.stpl  default.stpl  hosting.stpl  phpfcgid.sh    phpfcgid.tpl
basedir.tpl   default.tpl   hosting.tpl   phpfcgid.stpl

/usr/local/vesta/data/templates/web/nginx# ls
caching.stpl  default.stpl  default.tpl.save  hosting.stpl  proxy_ip.tpl
caching.tpl   default.tpl   hosting.sh        hosting.tpl

Re: "Error: web template not found" when trying to add domain - Templates folder looks okay?

Posted: Thu Feb 11, 2016 8:04 am
by tjebbeke
one of your templates names 'default.tpl.save', this is wrong, you need to change this to 'default.tpl'

Re: "Error: web template not found" when trying to add domain - Templates folder looks okay?

Posted: Thu Feb 11, 2016 10:08 am
by weirdaljr
tjebbeke wrote:one of your templates names 'default.tpl.save', this is wrong, you need to change this to 'default.tpl'
Thanks for the reply. I wasn't sure if you noticed the main default.tpl was there too... the .save was just a backup I made, but I tried removing the backup just to check as well as making sure the default.tpl was the original file and it didn't impact the error.

Re: "Error: web template not found" when trying to add domain - Templates folder looks okay?

Posted: Thu Feb 11, 2016 10:27 am
by tjebbeke
weirdaljr wrote:
tjebbeke wrote:one of your templates names 'default.tpl.save', this is wrong, you need to change this to 'default.tpl'
Thanks for the reply. I wasn't sure if you noticed the main default.tpl was there too... the .save was just a backup I made, but I tried removing the backup just to check as well as making sure the default.tpl was the original file and it didn't impact the error.
Oh Sorry, I didn't notice that the default.tpl was there.

This is the code to check if the template is valid:

Code: Select all

is_web_template_valid() {
    t="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$template.tpl"
    s="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$template.stpl"
    if [ ! -e $t ] || [ ! -e $s ]; then
        echo "Error: web template $template not found"
        log_event "$E_NOTEXIST" "$EVENT"
        exit $E_NOTEXIST
    fi
}

# Proxy template check
is_proxy_template_valid() {
    proxy=$1
    t="$WEBTPL/$PROXY_SYSTEM/$proxy.tpl"
    s="$WEBTPL/$PROXY_SYSTEM/$proxy.stpl"
    if [ ! -e $t ] || [ ! -e $s ]; then
        echo "Error: proxy template $proxy not found"
        log_event "$E_NOTEXIST" "$EVENT"
        exit $E_NOTEXIST
    fi
}
So I don't see why you have this error.

Re: "Error: web template not found" when trying to add domain - Templates folder looks okay?

Posted: Thu Feb 11, 2016 2:05 pm
by weirdaljr
Looking at that code if that is the only thing that could cause it could the variables not be set? What is the -e checking for? I assume it is a error checking routine of sorts, but I do not know the code to debug.

Re: "Error: web template not found" when trying to add domain - Templates folder looks okay?

Posted: Thu Feb 11, 2016 4:29 pm
by tjebbeke
weirdaljr wrote:Looking at that code if that is the only thing that could cause it could the variables not be set? What is the -e checking for? I assume it is a error checking routine of sorts, but I do not know the code to debug.
-e checks if file exist.

The vars:
BIN=$VESTA/bin
USER_DATA=$VESTA/data/users/$user
WEBTPL=$VESTA/data/templates/web
DNSTPL=$VESTA/data/templates/dns

$WEB_SYSTEM & $WEB_BACKEND & $PROXY_SYSTEM are defined in /usr/local/vesta/conf/vesta.conf