make_sandbox won't accept path argument

Asked by John Russell on 2011-03-23

I'm trying out MySQL Sandbox, and I get an error that looks like this:

$ make_sandbox 5.x.y $(pwd)/mysql-5.x.y-m5-osx10.5-x86_64.tar.gz
Executing low_level_make_sandbox --basedir=/Users/jrussell/opt/mysql/5.x.y \
 --sandbox_directory=msb_5_x_y \
 --install_version=5.x \
 --sandbox_port=5x0y \
 --no_ver_after_name \
 /Users/jrussell/desktop/sandbox/MySQL-Sandbox-3.0.17/mysql-5.x.y-m5-osx10.5-x86_64.tar.gz \
unexpected arguments </Users/jrussell/desktop/sandbox/MySQL-Sandbox-3.0.17/mysql-5.x.y-m5-osx10.5-x86_64.tar.gz>

(All the x's and y's above are real digits, I substituted letters in this output because x > 5. :-)

I also tried calling low_level_make_sandbox directly with these same parameters, with the --my_clause before the path to the .tar.gz file, but that produced the same error. Is there some dependency on the .tar.gz filename that it won't work unless the name is in some precise format? Or does MySQL Sandbox only work for specific releases that only go up to 5.5?


I got the original command working, but after putting it aside from some time and trying a different variation, again I get baffling errors that don't seem to agree with the syntax message:

$ low_level_make_sandbox $(pwd)/mysql-5.6.3.tar.gz
unexpected arguments <.../path stuff.../mysql-5.6.3.tar.gz>

I'm trying to specify the port and directory to install a "labs" build in a special location. I've tried all combinations of -P <portnum>, -P=<portnum>, --sandbox_port <portnum>, --sandbox_port=<portnum>, etc. before and after the path to the tarball, but always this "unexpected arguments" error. The cookbook doesn't show an example using low_level_make_sandbox here:

In fact the examples all around this section don't use the tarball path format at all. That would help a lot if such examples could be sprinkled throughout the cookbook. Could the syntax check in the script test whether the "unexpected argument" is the name of a tarball, and give some more precise advice in that case? E.g. "you can't specify both a version and a tarball" or "when tarball is specified, you must also specify the -xyz option".

Oh I think I see the issue, so I'll try to summarize here to save some searching in a few months when I forget and encounter the error again. :-) The cookbook for specifying port and directory shows an example "low_level_make_sandbox --help", which suggests to me I'll call low_level_make_sandbox directly to perform this task. low_level_sandbox --help shows the syntax with the tarball coming last. That's the syntax I can't make work at all. Then I try make_sandbox, assuming the tarball must come last there too. In fact, the make_sandbox --help message suggests that's the case:

usage: ./make_sandbox version [options] {VERSION|tarball_full_name}.

However, the only way I can avoid the error is to call make_sandbox with all the options _after_ the tarball path:

make_sandbox $(pwd)/mysql-5.6.3.tar.gz --sandbox_port=49152 --sandbox_directory=<dirname>

If it's intentional that the tarball has to come before the -- options, could the order of items reflect that in the syntax message for make_sandbox and low_level_make_sandbox?

Question information

English Edit question
MySQL Sandbox Edit question
No assignee Edit question
Last query:
Last reply:

It looks like you are giving too many sources.
It's either the tar ball or the version (which works when you have expanded a tar ball into $HOME/opt/mysql)
Try this
$ make_sandbox tarballname

low_level_make_sandbox is just what the name says. It's low-level, and not optimized for human usage. That's why the manual mainly mentions the wrapper make_sandbox.
The syntax for low_level_make_sandbox DOES NOT have the tarball at the end. The tarball is dealt with by make_sandbox, which is the only place containing code that expands tarballs. Since this is a wrapper around low_level_make sandbox, the options go after the tarball (or the version number, if you follow the recommended convention of expanding your tarballs into $HOME/opt/mysql). The mention of the tarball in the help is a bug. I will fix it.

I have installed a few sandboxes with MySQL 5.6.3 without problems, other than the annoyance of the bootstrap operation writing non-errors to the STDERR.

Coming back to your questions.
You can change the directory in a few simple ways

make_sandbox mysql-5.6.3-m5-osx10.6-.tar.gz
# will install in $HOME/sandboxes/msb_5_6_3 with port 5603

make_sandbox mysql-5.6.3-m5-osx10.6-.tar.gz --sandbox_directory=john --sandbox_port=6000
# will install in $HOME/sandboxes/john with port 6000

make_sandbox mysql-5.6.3-m5-osx10.6-.tar.gz --check_port
# if you have already installed this version, it will
# install in $HOME/sandboxes/msb_5_6_3_a with port 5604 (or the first available port after this)
# subsequent installations will create msb_5_6_3_b, and so on

SANDBOX_HOME=/var/my_sandboxes make_sandbox make_sandbox mysql-5.6.3-m5-osx10.6-.tar.gz
# install in /var/my_sandboxes/msb_5_5_3 with port 5603
# with two caveats: (1) you must have write privileges to /var/my_sandboxes, and (2) the --check_port option won't be able to check existing ports

Can you help with this problem?

Provide an answer of your own, or ask John Russell for more information if necessary.

To post a message you must log in.