nabijaczleweli / cargo-update

A cargo subcommand for checking and applying updates to installed executables
MIT License
1.22k stars 42 forks source link

Auto configuration error #255

Closed breisfeld closed 6 months ago

breisfeld commented 6 months ago

Hi,

When executing the package install-update, I get the following error:

$ cargo install-update -a
Auto configuration failed
140308136251712:error:0EFFF065:configuration file routines:CRYPTO_internal:missing equal sign:conf/conf_def.c:346:line 57

Platform information:

$ cat /etc/os-release  
NAME="openSUSE Tumbleweed"
#VERSION="20240320"

$ uname -a
Linux xxxxx 6.8.1-1-default #1 SMP PREEMPT_DYNAMIC xxxxx x86_64 x86_64 x86_64 GNU/Linux

$ cargo --version
cargo 1.77.0 (3fe68eabf 2024-02-29)

$ cargo install --list
...
cargo-update v13.3.0:
    cargo-install-update
    cargo-install-update-config
...

Thanks for your help in resolving the issue.

nabijaczleweli commented 6 months ago

This looks like openssl (libssl) error format, and configuration file routines:missing equal sign:line 57 reads, to me, like a malformed openssl (libssl) config file – check if any configs under /etc/ssl (or where-ever else) are correct (in particular grep '^[^#]' /etc/ssl/openssl.cnf | grep -v = may illuminate the issue).

breisfeld commented 6 months ago

Thank you for the feedback and suggestion. Unfortunately, I can't find a missing equal sign in any of the openssl config files on my system. I'll keep investigating.

nabijaczleweli commented 6 months ago

For your investigation, try doing strace -o trace -fy cargo install-update -a. In trace there should be a final read() call just before the error is raised, and the associated file will probably be the one with the error.

breisfeld commented 6 months ago

Thank you for the tip. I greatly appreciate your help, especially because this doesn't appear to be associated with your package.

It looks like /etc/ssl/openssl.cnf is the culprit:

26619 openat(AT_FDCWD</home/xxxxx/build-dirs>, "/etc/ssl/openssl.cnf", O_RDONLY) = 3</etc/ssl/openssl.cnf>
26619 fstat(3</etc/ssl/openssl.cnf>, {st_mode=S_IFREG|0644, st_size=12506, ...}) = 0
26619 read(3</etc/ssl/openssl.cnf>, "#\n# OpenSSL example configuratio"..., 4096) = 4096
26619 close(3</etc/ssl/openssl.cnf>)    = 0
26619 write(2</dev/pts/1>, "Auto configuration failed\n", 26) = 26
26619 write(2</dev/pts/1>, "139968200687936:error:0EFFF065:c"..., 122) = 122
26619 exit_group(1)                     = ?
26619 +++ exited with 1 +++

However, I'm not seeing any missing =. The grep command you provided gives the following:

$ grep '^[^#]' /etc/ssl/openssl.cnf  | grep -v =      
[ oid_section ]
[ new_oids ]
[openssl_init]
[ engine_section ]
.include /etc/ssl/engines3.d
.include /etc/ssl/engdef3.d
[provider_sect]
[default_sect]
[ ssl_module ]
[ crypto_policy ]
[ ca ]
[ CA_default ]
                                        # several certs with same subject.
                                        # must be commented out to leave a V1 CRL
[ policy_match ]
[ policy_anything ]
[ req ]
[ req_distinguished_name ]
[ req_attributes ]
[ usr_cert ]
[ v3_req ]
[ v3_ca ]
[ crl_ext ]
[ proxy_cert_ext ]
[ tsa ]
[ tsa_config1 ]
                                        # (optional)
                                        # (optional)
                                        # (optional)
                                # (optional, default: no)
                                # (optional, default: no)
                                # (optional, default: no)
                                # identifier (optional, default: sha1)
[insta] # CMP using Insta Demo CA
[pbm] # Password-based protection for Insta CA
[signature] # Signature-based protection for Insta CA
[ir]
[cr]
[kur]
[rr]
nabijaczleweli commented 6 months ago

per analogiam to https://bugzilla.redhat.com/show_bug.cgi?id=1668916 this looks to me like cargo-update is linked to libssl1 and your system is using libssl3 (and the config file uses .include which is a libssl3-specific syntax?). can you try cargo install -f cargo-update?

breisfeld commented 6 months ago

Brilliant! Your solution worked perfectly. Thanks for your help and for the excellent cargo-update package!