Database Import API Error 127

3 posts / 0 new
Last post
#1 Sun, 11/18/2012 - 23:19
branches

Database Import API Error 127

I execute the following command from a cron job running as root:

virtualmin import-database --domain $domain --name $dbName --type mysql

Where the variables are obviously replaced with relevant data. Interestingly, if I execute the PHP script with this code manually (running as sudo), the job executes just fine and the database is imported into Virtualmin. However, if the cron job, which is setup through Webmin and set to run as root, kicks off this script, this call returns a "127".

I haven't been able to find any documentation on what a 127 error might be, but I need this database to import from the cron. Any help would be most appreciated!

Also, after the cron fails (but the database was successfully created via the script, so it clearly is running as root), I can go into the Virtualmin UI, go to Import Database, and import the database just fine manually.

Mon, 11/19/2012 - 08:49
andreychek

Howdy,

I had to do some digging to figure out what "127" might be, but after some Googling, I found this here which suggests that may be a "command not found" error:

http://tldp.org/LDP/abs/html/exitcodes.html

Since it's a problem with cron, that likely means it's a path issue... so rather than just calling "virtualmin", try using the full path -- "/usr/sbin/virtualmin", and see if that does the trick for you.

-Eric

Tue, 12/04/2012 - 18:15 (Reply to #2)
branches

Thanks for the reply. Absolute paths did the trick.

Topic locked