google / differential-privacy

Google's differential privacy libraries.
Apache License 2.0
3.02k stars 346 forks source link

postgres extension docker build failed #243

Closed zjingwang closed 11 months ago

zjingwang commented 1 year ago

i was building the Dockerfile in cc/postgres and it failed with the error below

Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]                                                                                                                           
Get:2 http://apt.postgresql.org/pub/repos/apt bookworm-pgdg InRelease [123 kB]                                                                                                           
Get:3 http://deb.debian.org/debian bookworm-updates InRelease [52.1 kB]                                                                                                                  
Err:1 http://deb.debian.org/debian bookworm InRelease                                                                                                                                    
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 NO_PUBKEY F8D2585B8783D481                
Get:4 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]                                                                                                        
Err:3 http://deb.debian.org/debian bookworm-updates InRelease                                                                                                                            
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131                                           
Err:4 http://deb.debian.org/debian-security bookworm-security InRelease                                                                                                                  
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54404762BBB6E853 NO_PUBKEY BDE6D2B9216EC7A8                                           
Err:2 http://apt.postgresql.org/pub/repos/apt bookworm-pgdg InRelease                                                                                                                    
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7FCC7D46ACCC4CF8                                                                      
Reading package lists...                                                                                                                                                                 
W: GPG error: http://deb.debian.org/debian bookworm InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 NO_PUBKEY F8D2585B8783D481                                                                                                                                            
E: The repository 'http://deb.debian.org/debian bookworm InRelease' is not signed.                                                                                                       
W: GPG error: http://deb.debian.org/debian bookworm-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131                                                                                                                                                               
E: The repository 'http://deb.debian.org/debian bookworm-updates InRelease' is not signed.                                                                                               
W: GPG error: http://deb.debian.org/debian-security bookworm-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54404762BBB6E853 NO_PUBKEY BDE6D2B9216EC7A8                                                                                                                                                     
E: The repository 'http://deb.debian.org/debian-security bookworm-security InRelease' is not signed.                                                                                     
W: GPG error: http://apt.postgresql.org/pub/repos/apt bookworm-pgdg InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7FCC7D46ACCC4CF8                                                                                                                                                                                  
E: The repository 'http://apt.postgresql.org/pub/repos/apt bookworm-pgdg InRelease' is not signed.                                                                                       
E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'                           
E: Sub-process returned an error code  

i thought it may because of the low version of postgres and updated to the lates one, but i it still not worked.

zjingwang commented 1 year ago

also it failded when compiling anon_func.so

ERROR: /root/.cache/bazel/_bazel_root/6387ad62885344b69d0acaf95e26b345/external/postgres/BUILD.bazel:35:15: CcConfigureMakeRule external/postgres/postgres/include failed: (Exit 1): bash failed: error executing command /bin/bash -c bazel-out/k8-opt/bin/external/postgres/postgres_foreign_cc/wrapper_build_script.sh
dibakch commented 1 year ago

Just taking a quick look. Debian recently had a new release, so could you try and change testing to stable in line 18?

EDIT: Same for the other add-apt-repository commands

zjingwang commented 1 year ago

Sadly, i followed your sollution, but it still not worked. Before your answer, I googled a lot of solutions but got none successful. It was caused by the apt-get update command. Someone says update docker to newer version may solve the problem, but it still not worked for me.

zjingwang commented 11 months ago

Instead of using postgres image, i used ubuntu:20.04 to build postgres and the extension from scrach, and i worked. see https://github.com/google/differential-privacy/issues/244