Local installation fails

I tried the instructions to install cluster-in-a-box locally, but it fails at the deployment stage.

Specifically:

$ memsql-deploy cluster-in-a-box --license [MY_LICENSE]
Starting rollback
✓ Rollback succeeded
unknown package type for host 127.0.0.1: could not find dpkg or rpm

System info:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.10
Release: 18.10
Codename: cosmic
$ uname -a
Linux [...] 4.18.0-10-generic #11-Ubuntu SMP Thu Oct 11 15:13:55 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
1 Like

Thanks for reporting this issue. We require access to either the dpkg or rpm command on the current machine. Can you confirm that you have access to either of those tools? It appears that you are running Ubuntu, so in theory you should have access to the dpkg command.

1 Like

Yes, I do have access:

$ dpkg --version
Debian 'dpkg' package management program version 1.19.0.5 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
1 Like

Can you send the output of which dpkg. Also I am trying to repro the issue on a Ubuntu 18.10 machine now.

1 Like

Here you go:

$ which dpkg
/usr/bin/dpkg
1 Like

Ok, so I confirmed that I am able to install cluster-in-a-box from scratch in a Ubuntu 18.10 docker image, however I am not convinced that reproduces your environment. During the installation process we are exec’ing the which binary on your machine which in this case is returning an error. Can you send the output of this:

memsql-deploy cluster-in-a-box -vvv --license [YOUR_LICENSE]

Also which shell are you using? And can you send the output of running which dpkg inside of a /bin/sh session.

1 Like

Ok, also was able to run this on a fresh Ubuntu 18.10 AMI on EC2. At this point I am convinced this is something to do with the environment. The leading ideas are:

  1. what implementation of sh is on the machine
  2. is the which binary installed on your machine? some shells provide it, which would explain which dpkg working in your environment but failing when we try to exec it.
1 Like

While we are figuring out this issue, you can also install cluster-in-a-box via Docker (Install on local PC as standalone - Help - SingleStore Forums) to play around with MemSQL.

1 Like

Here you go:

$ memsql-deploy cluster-in-a-box -vvv --license [LICENSE]                                                                     
2018/11/06 15:58:36 main.go:38 Running command `/usr/bin/whoami `
2018/11/06 15:58:36 main.go:38 Command `/usr/bin/whoami ` took 951.853µs                                                                  
2018/11/06 15:58:36 main.go:38 Running command `/usr/bin/groups `
2018/11/06 15:58:36 main.go:38 Command `/usr/bin/groups ` took 656.457µs                                                                  
2018/11/06 15:58:36 main.go:38 Running command `/usr/bin/which sudo`
2018/11/06 15:58:36 main.go:38 Command `/usr/bin/which sudo` took 522.869µs                                                               
2018/11/06 15:58:36 main.go:38 Running command `/usr/bin/sudo -n echo`                                                                    
2018/11/06 15:58:36 main.go:38 Command `/usr/bin/sudo -n echo` took 4.414072ms                                                            
2018/11/06 15:58:36 main.go:38 Running command `/usr/bin/sudo -S -k -- /bin/sh -c 'printf' '[STRING]' && 'exec' 'which' 'rpm'`
2018/11/06 15:58:38 main.go:38 Command `/usr/bin/sudo -S -k -- /bin/sh -c 'printf' '[STRING]' && 'exec' 'which' 'rpm'` failed with exit code 1 in 2.084441114s
2018/11/06 15:58:38 main.go:38 Running command `/usr/bin/sudo -S -k -- /bin/sh -c 'printf' '[STRING]' && 'exec' 'which' 'dpkg'`
2018/11/06 15:58:40 main.go:38 Command `/usr/bin/sudo -S -k -- /bin/sh -c 'printf' '[STRING]' && 'exec' 'which' 'dpkg'` failed with exit code 1 in 2.031203354s
Starting rollback
✓ Rollback succeeded
unknown package type for host 127.0.0.1: could not find dpkg or rpm

And:

$ /bin/sh
$ which dpkg
/usr/bin/dpkg
2 Likes

Thanks, looking into it a bit more.

Can you run man sh and determine which implementation of sh you are using. On my Ubuntu 18.10 system I am running dash. Also - do you have any interesting sudo restrictions on your machine?

1 Like

Ahah! I was running the memsql-deploy command inside a tmux terminal. I just tried outside tmux and it looks to be working :slight_smile:

1 Like

Awesome, thanks for discovering that. I will figure out the issue and file a bug.

1 Like

Well, it doesn’t repro for me in tmux. Can you provide any additional notes about your tmux environment to help me reproduce this issue? Much appreciated.

Something funky is going on. I was able to install through memsql-deploy, but all the CLI commands return with unknown package type for host 127.0.0.1: could not find dpkg or rpm

For anyone else following the thread, we have taken this conversation offline to debug a bit faster. I will post a full explanation/resolution once we figure it out.

Sorry for the late update to this thread. In summary, we were able to repro the issue and released a fix in the memsql-toolbox package version 1.0.1. We are now on memsql-toolbox 1.0.3 and haven’t heard anyone else reporting this issue so I am going to mark this as solved.

For anyone interested, the issue was related to sudo saving temporary timed credentials in the user’s environment. This allowed the tools to incorrectly guess that sudo didn’t require a password which caused it to fail commands later on.

I got exactly the same error on your up to date version 1.0.6 19e4230c79a10192c6b947cb2b144fdb37cb3c0e when I try to deploy a in a box cluster locally on a debian 9 Linux lido 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u6 (2018-10-08) x86_64 GNU/Linux.

memsql-deploy cluster-in-a-box --license XXXXXXXXXXXXXXXXXXXXXXXXXXXX
sudo password for user@127.0.0.1: 
Starting rollback
✓ Rollback succeeded
unknown package type for host 127.0.0.1: Both dpkg and rpm package managers found on the system

I found the problem.

rpm is a regular package for a debian system. Its better to search for the package manager tools by inspect the distribution not by checking dpkg and rpm together. Its not identify your system requirements.

Thanks for the info! We will evaluate alternative solutions to picking the default package manager as the issue you hit is not ideal.

1 Like