Cloudsql-proxy: Won't Install on Raspberry PI 3b+

Created on 16 Aug 2018  Â·  9Comments  Â·  Source: GoogleCloudPlatform/cloudsql-proxy

I can't get this to install on my Raspberry Pi 3b+. Go is installed.

I enter..

go get github.com/GoogleCloudPlatform/cloudsql-proxy/cmd/cloud_sql_proxy

The result is...

# github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/proxy
go/src/github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/proxy/client.go:205: unknown tls.Config field 'VerifyPeerCertificate' in struct literal

I looked up the file indicated file. I can't tell what the issue is. It appears to be related to a recent fix of Issues #194 and #196 . A snippet from the file...

>cfg = &tls.Config{
>       ServerName:   name,
>       Certificates: []tls.Certificate{mycert},
>       RootCAs:      certs,
>       // We need to set InsecureSkipVerify to true due to
>       // https://github.com/GoogleCloudPlatform/cloudsql-proxy/issues/194
>       // https://tip.golang.org/doc/go1.11#crypto/x509
>       //
>       // Since we have a secure channel to the Cloud SQL API which we use to retrieve the
>       // certificates, we instead need to implement our own VerifyPeerCertificate function
>       // that will verify that the certificate is OK.
>       InsecureSkipVerify:    true,
>       VerifyPeerCertificate: genVerifyPeerCertificateFunc(name, certs),
>   }
>   return fmt.Sprintf("%s:%d", addr, c.Port), cfg, nil
> }
> 

So, I don't know if I'm doing something wrong what. I probably am. I'm not sure how git hub is supposed to work or if I'm breaking rules writing this. I apologize if that is the case. I just can't get it to work, any help would be greatly appreciated.

In case it matters for anything, the Pi I'm working on has the following attributes...
Debian v9.4

PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

The Kernel is...

uname -a
Linux raspberrypi 4.14.52-v7+ #1123 SMP Wed Jun 27 17:35:49 BST 2018 armv7l GNU/Linux

And the processor info is (all 4 cores identical except for processor number)...

processor   : 0
model name  : ARMv7 Processor rev 4 (v7l)
BogoMIPS    : 38.40
Features    : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part    : 0xd03
CPU revision    : 4
question

Most helpful comment

Because this project depends on distroless, which is currently amd64 only, I had to fork, build and push bespoke Docker images to get this to work on Raspberry Pi/arm32v7.

All 9 comments

@grantbrand What version of Go do you have installed on your Pi? My initial guess is that it may need to be >=1.11.

Currently it is 1.7.4. I'll see if I can get 1.11 installed. Just following the instructions for that over in the wiki doesn't seem to have worked.

The problem is likely that the default distribution of Go on the RPi is
usually slower than the regular release of Go (which happens every 6
months). You can download a precompiled version of Go for RPi from various
places online if you don't want to wait for your Pi to compile it from
source. Let me know if you need help installing the right version.

On Thu, Aug 16, 2018, 11:19 AM grantbrand notifications@github.com wrote:

Currently it is 1.7.4. I'll see if I can get 1.11 installed. Just
following the instructions for that over in the wiki doesn't seem to have
worked.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/GoogleCloudPlatform/cloudsql-proxy/issues/199#issuecomment-413638769,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAiy7_Ayu2BbrR25u6Z7nX5aaHwJNk1Xks5uRbe5gaJpZM4WAQh3
.

Well, I'm definitely open to some help!

This might actually be in the wrong place. Since the last, I've uninstalled Go, then worked to build it from source. I installed the v1.4 bootstrapper, and ran the 1.10.3 checkout to install, following the instructions at https://golang.org/doc/install/source. It went through, but failed several tests hanging the computer along the way. It is done now and when I check version my version is 1.4...

go version go version go1.4-bootstrap-20170531 linux/arm
So, I'm working to figure out what went wrong and have another go.

You can download the latest version here. (It looks like the Pi 3b+ is ARMv6, so it is probably this this one)

Make sure you uninstall your previous version first, then try these steps:

wget https://dl.google.com/go/go1.11rc1.linux-armv6l.tar.gz
sudo tar -C /usr/local -xvf go1.11rc1.linux-armv6l.tar.gz

Then update your PATH (PATH=$PATH:/usr/local/go/bin) in your bash profile.

Ok, I think I've got go and the cloudsql-proxy installed.

In case anyone has the same issues in the future..

I reinstalled Raspbian and updated it.

I switched the python version to default with 3.5.3. following this guide.

I made sure GCC was installed, and it is.
gcc --version

I followed instructions from kurtisvg directly above this post
Best advice is to copy/paste the code. I mis-typed something somewhere and then had to re-do it, so yay for copy/paste.

When I updated the PATH, it didn't look like it did anything, so I checked it with...
echo $PATH
The addition is visible at the end of the output.

Then I checked the version of GO to make sure it was actually there.
$ go version go version go1.11rc1 linux/arm
It's there, WOOT!

Next, I followed the instruction on the main page of this git -or- repository (I'm not sure what it's supposed to be called) which has you use GO to get and install the cloudsql-proxy.
go get github.com/GoogleCloudPlatform/cloudsql-proxy/cmd/cloud_sql_proxy
Again I had issues with mis-spelling something somewhere, maybe switching lowercase L's and 1's I'm not sure, so I copy pasted and it worked.

A side note...
In the process of reinstalling Raspbian I also switched back to the SD card that came with my Pi. I got it as part of a CanaKit, which included NOOBS on a 32GB MicroSD Card (Class 10). The card I was working on when the original issue presented is a 16GB MicroSD Card Ultimate 3.0 rated at 70MB/s. I don't know if the cards make a difference, but it seems from what I'm reading that the 16GB card is a newer design and higher speed, so I wouldn't think that would be an issue, I probably just screwed something up before I got to trying to install GO last time.

@grantbrand Thanks for following up. I'm going to go ahead and close this issue since your problem is resolved.

Thank you for the help!

Because this project depends on distroless, which is currently amd64 only, I had to fork, build and push bespoke Docker images to get this to work on Raspberry Pi/arm32v7.

Was this page helpful?
0 / 5 - 0 ratings