Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Won't Install on Raspberry PI 3b+ #199

Closed
grantbrand opened this issue Aug 16, 2018 · 9 comments
Closed

Won't Install on Raspberry PI 3b+ #199

grantbrand opened this issue Aug 16, 2018 · 9 comments
Labels
type: question Request for information or clarification.

Comments

@grantbrand
Copy link

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
@kurtisvg kurtisvg added the type: question Request for information or clarification. label Aug 16, 2018
@kurtisvg
Copy link
Contributor

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

@grantbrand
Copy link
Author

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.

@Carrotman42
Copy link
Contributor

Carrotman42 commented Aug 16, 2018 via email

@grantbrand
Copy link
Author

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.

@kurtisvg
Copy link
Contributor

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.

@grantbrand
Copy link
Author

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.

@kurtisvg
Copy link
Contributor

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

@grantbrand
Copy link
Author

Thank you for the help!

@outofcoffee
Copy link

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.

yosatak pushed a commit to yosatak/cloud-sql-proxy that referenced this issue Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Request for information or clarification.
Projects
None yet
Development

No branches or pull requests

4 participants