Local installation fails

solved

#1

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

#2

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.


#3

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.

#4

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


#5

Here you go:

$ which dpkg
/usr/bin/dpkg

#6

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.


#7

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.

#8

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


#9

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

#10

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?


#11

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:


#12

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


#13

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.


#14

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


#15

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.


#16

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.