running into this error and unsure how to debug
# pact-go
h
running into this error and unsure how to debug
Copy code
[Container] 2023/07/12 23:38:21 Running command pact-go -l DEBUG install
2023/07/12 23:38:21 [ERROR] Your Pact library installation is out of date and we were unable to download a newer one for you: exit status 1
[Container] 2023/07/12 23:38:21 Command did not exit successfully pact-go -l DEBUG install exit status 1
m
Is this the v2 or v1 library Haz?
h
v2
m
I’m assuming you’ve installed the FFI in the container?
what’s the output of
pact-go -v install -f
?
brb
h
yeah - ran the usual
go install <http://github.com/pact-foundation/pact-go/v2@2.x.x|github.com/pact-foundation/pact-go/v2@2.x.x>
the first attemp was with
-f
and still failed. i removed it because i noticed a branch when
!i.force
m
That's a different command that installs the pact golang package. Did you run the other one too to install the FFI?
h
i usually run this
Copy code
'go install <http://github.com/pact-foundation/pact-go/v2@2.x.x|github.com/pact-foundation/pact-go/v2@2.x.x>',
'pact-go -l DEBUG install -f'
is that not correct?
m
yep. Sorry it wasn’t clear above that you ran the second command (just the
go install
one was mentioned)
Are you running on a different OS/architecture by any chance?
h
yes, and i checked that by running
go env
👍 1
Copy code
GOARCH="amd64"
GOOS="linux"
m
checks out
So anyway, maybe I’m missing something. When you run
pact-go -l DEBUG install -f
what is the output? Are you able to shell into the container and run it there?
h
no, i cant
it's running in codebuild facepalm
m
I reckon it could be this check that’s failing:
Copy code
// checkMusl checks if the OS uses musl library instead of glibc
func (i *Installer) checkMusl() error {
	lddPath, err := exec.LookPath("ldd")
	if err != nil {
		return fmt.Errorf("could not find ldd in environment path")
	}

	cmd := exec.Command(lddPath, "/bin/echo")
	out, err := cmd.CombinedOutput()

	if strings.Contains(string(out), "musl") {
		log.Println("[WARN] Usage of musl library is known to cause problems, prefer using glibc instead.")
	}

	return err
}
Given the
exit status 1
error, this is the only thing I think might return that
h
i have a branch with some extra logging on it.
👍 1
can i submit a pull
m
Just looking at that, we probably shouldn’t error the install because we couldn’t check if it was a musl setup.
I’m going to push a fix for that shortly
for some extra logs.
... i have to drop off for the day.
m
thx
No worries. See also #646c3eb - i’d love to know if that fixes your isnsue
can chat tomorrow 🙂
h
Cool, thx
🙌 1
cool - that worked!
Copy code
2023/07/13 15:57:04 [DEBUG] unable to check for presence musl library due to error: exit status 1
2023/07/13 15:57:04 [INFO] downloading library from <https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v0.4.5/libpact_ffi-linux-x86_64.so.gz> to /usr/local/lib/libpact_ffi.so
&{}
2023/07/13 15:57:05 [DEBUG] obtaining hash for file /usr/local/lib/libpact_ffi.so
m
awesome, thanks. Will update the release!
Oh, I already did that 🙂