Can't send UNLIMITED quota over http api when creating a virtual-server

Hi,

I am trying to create a domain with unlimited quota, however no matter how I call it, virtualmin will complain:

“No quota specified” or “Missing or invalid total quota”…

I have tried the following so far, without success:

quota=UNLIMITED&uquota=UNLIMITED quota=-1&uquota=-1 quota=0&uquota=0

quota=UNLIMITED does indeed work when I use create-user, but not for create-server..

Thanks Lucian

Status: 
Active

Comments

Ilia's picture
Submitted by Ilia on Thu, 03/26/2020 - 13:01

Hi,

Do you have system quotas enabled? Do you have quotas enabled in Virtualmin Configuration?

I have tried the following so far, without success: quota=UNLIMITED&uquota=UNLIMITED quota=-1&uquota=-1 quota=0&uquota=0

What exactly is this that what you tried? Can you provide step-by-step screenshots to get clearer picture of what not working, as it works fine for me.

Hello,

Mine is a scripted installation, so did not go through the "web wizard", but I thought quotas would be on by default:

sh install.sh -f -n test1.domain.tld

Here is the command I use and the result:

root@test1:~# curl -k -q -u "root:pass" 'https://127.0.0.1:10000/virtual-server/remote.cgi?program=create-domain&domain=test1.35-217-162-217.sslip.io&web&ssl&user=test1&pass=pass1&desc="desc"&unix&mail&dir&&dns&spam&virus&multiline=&quota=UNLIMITED&uquota=UNLIMITED'

No quota specified

Adds a new Virtualmin virtual server, with the settings and features
specified on the command line.

virtualmin create-domain --domain domain.name
                         --pass "password-for-new-domain" |
                         --passfile password-file
                        [--hashpass]
                        [--parent domain.name | --alias domain.name |
                         --alias-with-mail domain.name |
                         --superdom domain.name]
                        [--desc description-for-domain]
                        [--email contact-email]
                        [--user new-unix-user]
                        [--group new-unix-group]
                        [--unix]
                        [--dir]
                        [--dns]
                        [--mail]
                        [--web]
                        [--webalizer]
                        [--ssl]
                        [--logrotate]
                        [--mysql]
                        [--spam]
                        [--virus]
                        [--default-features] | [--features-from-plan]
                        [--allocate-ip | --ip virtual.ip.address |
                         --shared-ip existing.ip.address]
                        [--ip-already]
                        [--default-ip6 |
                         --shared-ip6 existing.ip.address |
                         --allocate-ip6 |
                         --ip6 virtual.ip.address]
                        [--ip6-already]
                        [--dns-ip address | --no-dns-ip]
                        [--max-doms domains|*]
                        [--max-aliasdoms domains]
                        [--max-realdoms domains]
                        [--max-mailboxes boxes]
                        [--max-dbs databases]
                        [--max-aliases aliases]
                        [--quota quota-for-domain|UNLIMITED]
                        [--uquota quota-for-unix-user|UNLIMITED]
                        [--template "name"]
                        [--plan "name"]
                        [--limits-from-plan]
                        [--suffix username-prefix]
                        [--db database-name]
                        [--fwdto email-address]
                        [--reseller name]
                        [--mysql-pass password]
                        [--skip-warnings]
                        [--letsencrypt]
                        [--field-name value]*
                        [--enable-jail | --disable-jail]
                        [--mysql-server hostname]

Exit status: 256
Ilia's picture
Submitted by Ilia on Fri, 03/27/2020 - 06:48

Have you tried using Virtualmin CLI on the server directly?

Have you tried not using quotes in desc="desc" param?

If you minimize the query string, does it work in basic defaults?

Hi,

I've tried to remove all non-essential ones, leaving just domain name, user, password and quota and uquota of course: no luck.

Ilia's picture
Submitted by Ilia on Fri, 03/27/2020 - 07:22

Do you exclude connection error?

If command run locally on the server, does it work?

Yes, indeed, all queries are done with curl to https://127.0.0.1:10000/virtual-server/remote.cgi, the connection is not the issue, virtualmin clearly complains: "No quota specified"

In fact, if I use "quota=10000&uquota=10000" everything is fine. I just want to have unlimited quota.

Ilia's picture
Submitted by Ilia on Fri, 03/27/2020 - 10:35

This is really odd that's it not working for you. What Virtualmin version do you have installed?

Have you tired setting it to "0"? This is what UNLIMITED really does. Does it work then for you?

I tried with 0, -1 and UNLIMITED, same error. It does work if I specify a valid number like 10000 or smth.

I am probably making some mistake somewhere. I'll dig some more and let you know if I ever find the problem.

Ilia's picture
Submitted by Ilia on Fri, 03/27/2020 - 12:48

Can you please tell, which Virtualmin version was that and if 0 works instead of UNLIMITED?

I am not at the PC but I can tell you it's the latest version of everything, install by install.sh yesterday.

With 0 I got the same error.

Ok, back to a PC, tried various things but still no luck. Here is what I am doing (Debian 10):

wget http://software.virtualmin.com/gpl/scripts/install.sh
sh install.sh  -f -n host.name

virtualmin-config-system -exclude MySQL AWStats ProFTPd Usermin PostgreSQL Webalizer --include Dovecot Fail2ban Apache Mailman Procmail Postfix SpamAssassin ClamAV NTP SASL Webmin Quotas

for i in ftp webmin virtualmin-awstats virtualmin-dav; do virtualmin set-global-feature --disable-feature $i; done

sed -i s/"hashpass=0"/""/g /etc/webmin/virtual-server/config
echo "hashpass=1" >> /etc/webmin/virtual-server/config

sed -i '/quota=/d' /etc/webmin/virtual-server/plans/0
echo quota= >> /etc/webmin/virtual-server/plans/0
echo uquota= >> /etc/webmin/virtual-server/plans/0

Then I try to add a domain with unlimited quota, and this fails....

curl -k -q -u "root:pass" 'https://127.0.0.1:10000/virtual-server/remote.cgi?program=create-domain&domain=test3.10-217-162-217.sslip.io&quota=0&uquota=0&web&ssl&user=test3&pass=somepass&desc=descriere&unix&mail&dir&dns&spam&virus'

No quota specified

Exit: 256
Ilia's picture
Submitted by Ilia on Sat, 03/28/2020 - 06:03

Here is what I am doing (Debian 10):

Why are you doing this in relation to virtualmin-config-system command and adding values manually to config files? Let install script to do it all for you the right way! I wouldn't recommend steps you're talking. It's easy to break anything and it takes way more time to find out what's wrong.

Have you run Post-Install Wizard script and config check after installation?

Hi,

The project I am working on needs fully automated installations, no interacting with the UI I'm afraid. #devops baby ... :-)

Ilia's picture
Submitted by Ilia on Sat, 03/28/2020 - 08:15

You don't need to use config-system after installing with install.sh script, as it does it for you.

Note: There is a wizard_run key in config, that is expected to be set to 1 after successful post-install setup.

I had a look at the create-domain API, and it indeed doesn't support unlimited quotas properly. This will be fixed in the next release..

Ilia's picture
Submitted by Ilia on Sat, 03/28/2020 - 18:21

Lucian, you are welcome to patch your file locally, restart Webmin and give it a try now.

Does it solve your issue?

Thanks, Jamie! I checked that code too, and noticed it was setting the value to 0 for unlimited quotas but didn't manage to look further, as it worked perfectly fine for me on the UI.

The patch seems to be working, thanks guys!

Ilia thanks for the tip with wizard_run=1.