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

Aws lambda Execution failed - /lib64/libc.so.6: version `GLIBC_2.28' not found #789

Closed
matrottier opened this issue Jul 13, 2021 · 16 comments · Fixed by #790
Closed

Aws lambda Execution failed - /lib64/libc.so.6: version `GLIBC_2.28' not found #789

matrottier opened this issue Jul 13, 2021 · 16 comments · Fixed by #790

Comments

@matrottier
Copy link

Trying to run Tegola with AWS lambda.
i got this error when testing :
START RequestId: 1340f6e4-ceee-401b-950b-cac0880a4f95 Version: $LATEST /var/task/tegola_lambda: /lib64/libc.so.6: version 'GLIBC_2.28' not found (required by /var/task/tegola_lambda) END RequestId: 1340f6e4-ceee-401b-950b-cac0880a4f95 REPORT RequestId: 1340f6e4-ceee-401b-950b-cac0880a4f95 Duration: 35.30 ms Billed Duration: 36 ms Memory Size: 512 MB Max Memory Used: 6 MB RequestId: 1340f6e4-ceee-401b-950b-cac0880a4f95 Process exited before completing request

i tried the version from github and a compiled version with go 1.3 and go 1.6.
also tried the option "CGO_ENABLED=0" on the compilation without success

@ARolek
Copy link
Member

ARolek commented Jul 13, 2021

@matrottier hmmm. We're currently using tegola_lambda to run the demo.tegola.io. I'm going to ask the obvious question first, can you confirm you're using the Go runtime in Lambda?

@matrottier
Copy link
Author

i think so... there it is my console :
aws_lambda_tegola

@ARolek
Copy link
Member

ARolek commented Jul 13, 2021

@matrottier that looks correct to me. When you built locally, did you use GOOS=linux? Does this same error happen when you use the release builds?

@matrottier
Copy link
Author

matrottier commented Jul 14, 2021

@ARolek it happen with release builds AND locally builds. =/

@matrottier
Copy link
Author

matrottier commented Jul 14, 2021

***EDITED LOG
in an act of utter desperation,
i tested a "layer" with the file "libc.so.6" in the folder "lib/lib64".
2 environments variables:
LD_DEBUG | all
LD_LIBRARY_PATH | /opt/lib/lib64/

there is the log :

so.2 [0]
         9:	symbol=_rtld_global;  lookup in file=/opt/lib/lib64/libc.so.6 [0]
         9:	symbol=_rtld_global;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
         9:	binding file /lib64/libdl.so.2 [0] to /lib64/ld-linux-x86-64.so.2 [0]: normal symbol `_rtld_global' [GLIBC_PRIVATE]
         9:	symbol=__cxa_finalize;  lookup in file=/var/task/tegola_lambda [0]
         9:	symbol=__cxa_finalize;  lookup in file=/lib64/libpthread.so.0 [0]
         9:	symbol=__cxa_finalize;  lookup in file=/lib64/libdl.so.2 [0]
         9:	symbol=__cxa_finalize;  lookup in file=/opt/lib/lib64/libc.so.6 [0]
         9:	binding file /lib64/libdl.so.2 [0] to /opt/lib/lib64/libc.so.6 [0]: normal symbol `__cxa_finalize' [GLIBC_2.2.5]
         9:	
         9:	relocation processing: /lib64/libpthread.so.0 (lazy)
         9:	symbol=_ITM_deregisterTMCloneTable;  lookup in file=/var/task/tegola_lambda [0]
         9:	symbol=_ITM_deregisterTMCloneTable;  lookup in file=/lib64/libpthread.so.0 [0]
         9:	symbol=_ITM_deregisterTMCloneTable;  lookup in file=/lib64/libdl.so.2 [0]
         9:	symbol=_ITM_deregisterTMCloneTable;  lookup in file=/opt/lib/lib64/libc.so.6 [0]
         9:	symbol=_ITM_deregisterTMCloneTable;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
         9:	symbol=errno;  lookup in file=/var/task/tegola_lambda [0]
         9:	symbol=errno;  lookup in file=/lib64/libpthread.so.0 [0]
         9:	symbol=errno;  lookup in file=/lib64/libdl.so.2 [0]
         9:	symbol=errno;  lookup in file=/opt/lib/lib64/libc.so.6 [0]
         9:	binding file /lib64/libpthread.so.0 [0] to /opt/lib/lib64/libc.so.6 [0]: normal symbol `errno' [GLIBC_PRIVATE]
         9:	symbol=__resp;  lookup in file=/var/task/tegola_lambda [0]
         9:	symbol=__resp;  lookup in file=/lib64/libpthread.so.0 [0]
         9:	symbol=__resp;  lookup in file=/lib64/libdl.so.2 [0]
         9:	symbol=__resp;  lookup in file=/opt/lib/lib64/libc.so.6 [0]
         9:	binding file /lib64/libpthread.so.0 [0] to /opt/lib/lib64/libc.so.6 [0]: normal symbol `__resp' [GLIBC_PRIVATE]
         9:	symbol=__libc_stack_end;  lookup in file=/var/task/tegola_lambda [0]
         9:	symbol=__libc_stack_end;  lookup in file=/lib64/libpthread.so.0 [0]
         9:	symbol=__libc_stack_end;  lookup in file=/lib64/libdl.so.2 [0]
         9:	symbol=__libc_stack_end;  lookup in file=/opt/lib/lib64/libc.so.6 [0]
         9:	symbol=__libc_stack_end;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
         9:	binding file /lib64/libpthread.so.0 [0] to /lib64/ld-linux-x86-64.so.2 [0]: normal symbol `__libc_stack_end' [GLIBC_2.2.5]
         9:	symbol=_rtld_global_ro;  lookup in file=/var/task/tegola_lambda [0]
         9:	symbol=_rtld_global_ro;  lookup in file=/lib64/libpthread.so.0 [0]
         9:	symbol=_rtld_global_ro;  lookup in file=/lib64/libdl.so.2 [0]
         9:	symbol=_rtld_global_ro;  lookup in file=/opt/lib/lib64/libc.so.6 [0]
         9:	symbol=_rtld_global_ro;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
         9:	binding file /lib64/libpthread.so.0 [0] to /lib64/ld-linux-x86-64.so.2 [0]: normal symbol `_rtld_global_ro' [GLIBC_PRIVATE]
         9:	symbol=__libc_dl_error_tsd;  lookup in file=/var/task/tegola_lambda [0]
         9:	symbol=__libc_dl_error_tsd;  lookup in file=/lib64/libpthread.so.0 [0]
         9:	symbol=__libc_dl_error_tsd;  lookup in file=/lib64/libdl.so.2 [0]
         9:	symbol=__libc_dl_error_tsd;  lookup in file=/opt/lib/lib64/libc.so.6 [0]
         9:	/lib64/libpthread.so.0: error: relocation error: symbol __libc_dl_error_tsd, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference (fatal)
/var/task/tegola_lambda: relocation error: /lib64/libpthread.so.0: symbol __libc_dl_error_tsd, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference
END RequestId: d37e3d63-672a-49f9-b3c1-866173d2fb75
REPORT RequestId: d37e3d63-672a-49f9-b3c1-866173d2fb75	Duration: 67.20 ms	Billed Duration: 68 ms	Memory Size: 128 MB	Max Memory Used: 6 MB	
RequestId: d37e3d63-672a-49f9-b3c1-866173d2fb75 Process exited before completing request

@matrottier
Copy link
Author

oh!
locally build v0.13.0 with option "CGO_ENABLED=0" and go 1.16.6 (was 1.13.8 before (ubuntu 20.04) )
seems to work,
i got a timeout after 15sec. probably a problem in my configuration of the PG database.
I will be able to move forward

@ARolek
Copy link
Member

ARolek commented Jul 15, 2021

@matrottier I"m going to reopen this issue until I have a chance to investigate why the build pipeline is not producing a binary that just works. Here's the build command:

- name: Build for Linux
env:
# build architecture
GOOS: linux
run: |
cd cmd/tegola
go build -mod vendor -ldflags "-w -X github.com/go-spatial/tegola/cmd/tegola/cmd.Version=${VERSION}"

It looks like you disabled CGO, but that's not desirable as Geopkg will not work without it. I'm not quite sure what changed (something with Lambda?) but I would like to make sure no one else has to deal with this juggle.

@ARolek ARolek reopened this Jul 15, 2021
@ARolek
Copy link
Member

ARolek commented Jul 16, 2021

@matrottier I was able to recreate your problem, and I'm not quite sure when this started. AWS Lambda runs on AmazonLinux and we're currently compiling on the GH Action runner ubuntu-latest. There's clearly a mismatch of GLIB location / version / expectations. I'm working on updating the CI so we don't encounter this anymore.

Thanks again for reporting this.

ARolek added a commit that referenced this issue Jul 16, 2021
* build tegola_lambda using amazon linux rather than ubuntu
* move from using ubuntu-latest to ubuntu-20.04 in GH actions.

closes #789
@ARolek
Copy link
Member

ARolek commented Jul 19, 2021

@matrottier can you try the binary output from this Github Action run: https://github.com/go-spatial/tegola/actions/runs/1043951686

I refactored the way we're building tegola_lambda and I'm now using Amazon Linux for that build. I'm hoping you can give it a test and confirm it's working on your end. It's working for me with my tests.

@matrottier
Copy link
Author

it works !! (no problem with GLIBC)
but i got this error from API gateway, any idea ?
"Internal Server Error The IAM role configured on the integration or API Gateway doesn't have permissions to call the integration. Check the permissions and try again"

@ARolek
Copy link
Member

ARolek commented Jul 19, 2021

@matrottier excellent! Thanks for checking that out. Regarding the IAM issue, that sounds like it has to do with your resource access control rules setup in your AWS account, not specific to tegola. I have personally found that using the Application Load Balancer easier to set up the API Gateway. Considering giving that a shot and then moving to API Gateway.

ARolek added a commit that referenced this issue Jul 19, 2021
AWS Lambda uses Amazon Linux for Lambda executions. The previous
build pipeline was using Ubuntu 18.04 to build tegola_lambda
which had GLIB location parity with Amazon Linux. After upgrading
to Ubuntu 20.04 the GLIB references between Ubuntu and Amazon Linux
are no longer in parity so tegola_lambda fails to find GLIB during
Lambda execution.

This commit accomplished the following:

* build tegola_lambda using Amazon Linux rather than Ubuntu
* move from using ubuntu-latest to ubuntu-20.04 in GH actions.

closes #789
ARolek added a commit that referenced this issue Jul 19, 2021
AWS Lambda uses Amazon Linux for Lambda executions. The previous
build pipeline was using Ubuntu 18.04 to build tegola_lambda
which had GLIB location parity with Amazon Linux. After upgrading
to Ubuntu 20.04 the GLIB references between Ubuntu and Amazon Linux
are no longer in parity so tegola_lambda fails to find GLIB during
Lambda execution.

This commit accomplished the following:

* build tegola_lambda using Amazon Linux rather than Ubuntu
* move from using ubuntu-latest to ubuntu-20.04 in GH actions.

closes #789
@ARolek
Copy link
Member

ARolek commented Jul 19, 2021

@matrottier I just sent in a PR to fix this if you want to give it a look: #790

@ARolek ARolek closed this as completed in 4ab36cc Jul 21, 2021
@matrottier
Copy link
Author

trying to upgrade from 0.16 and i got the same message :

/var/task/bootstrap: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /var/task/bootstrap)
/var/task/bootstrap: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by /var/task/bootstrap)
/var/task/bootstrap: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by /var/task/bootstrap)
/var/task/bootstrap: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by /var/task/bootstrap)

with my own compiled binary, the file of the github 0.17, 0.18 and 0.19.
i tested with SAM and in my CDK code i use this option : runtime: lambda.Runtime.GO_1_X. also tried lambda.Runtime.PROVIDED_AL2,

searching for a hint ! 🙏

@ARolek
Copy link
Member

ARolek commented Mar 13, 2024

@matrottier you're saying the version you download from the tegola releases page is is throwing this error? A few things to note:

  • You need to use the al2 runtime now for Go based lambda functions
  • Our release page has 2 lambda architectures: arm and amd64. make sure you pick the right architecture for your deployment.

@matrottier
Copy link
Author

move along, nothing to see here !
just a old man who has trouble with technology

it's working with al2 and tegola_lambda_amd64.zip
thanks for the quick reply @ARolek

@ARolek
Copy link
Member

ARolek commented Mar 13, 2024

@matrottier nice! and anytime ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants