[FATAL] Carp::croak: 'blocksize' is not a recognized argument - Ubuntu

  • Ubuntu 18.04.6 LTS

    I-MSCP 1.5.3 (2018120800)


    Today I wanted to update some cpan modules for spamassassin and accidentally ran:

    perl -MCPAN -e upgrade


    Since then I can't change any email address, it gets stuck on toadd ...

    an update or reinstalling packages also shows an error message:

    Code
    1. [FATAL] Carp::croak: 'blocksize' is not a recognized argument at /usr/local/share/perl/5.26.1/Crypt/CBC.pm line 312, <$fh> line 408.
    2. at /var/www/imscp/engine/PerlLib/iMSCP/Crypt.pm line 498.
    3. E: Problem executing scripts DPkg::Post-Invoke 'if [ -x /usr/local/sbin/imscp-dpkg-post-invoke.pl -a ${IMSCP_SETUP:=0} -eq 0 ]; then /usr/bin/perl /usr/local/sbin/imscp-dpkg-post-invoke.pl -d; fi'
    4. E: Sub-process returned an error code

    I then tried to reinstall all perl packages

    Code
    1. apt-get --reinstall install perl libcrypt-blowfish-perl libcrypt-cbc-perl libcrypt-eksblowfish-perl libcrypt-rijndael-perl libdata-validate-ip-perl libdate-simple-perl libdatetime-perl libdbd-mysql-perl libdbi-perl libemail-valid-perl libfile-copy-recursive-perl libfile-homedir-perl libhash-merge-perl libjson-perl libmailtools-perl libmime-tools-perl libnet-dns-perl libnet-libidn-perl libsort-naturally-perl libtimedate-perl libunix-mknod-perl libwww-perl libxml-parser-perl libxml-simple-perl

    shows

    Code
    1. shows:
    2. [FATAL] Carp::croak: 'blocksize' is not a recognized argument at /usr/local/share/perl/5.26.1/Crypt/CBC.pm line 312, <$fh> line 408.
    3. at /var/www/imscp/engine/PerlLib/iMSCP/Crypt.pm line 498.


    LE plugin log (snap fix Kess) shows

    Code
    1. [Thu May 26 17:00:01 2022] [error] main: Couldn't process Let's Encrypt pending tasks: 'blocksize' is not a recognized argument at /$
    2. at /var/www/imscp/gui/plugins/LetsEncrypt/cron/../../../../engine/PerlLib/iMSCP/Crypt.pm line 498.


    CBC package seems to be available

    Code
    1. apt -y install apt-file
    2. apt update
    3. apt-file search Crypt/CBC.pm
    4. libcrypt-cbc-perl: /usr/share/perl5/Crypt/CBC.pm
    5. libmessage-passing-perl: /usr/share/perl5/Message/Passing/Filter/Decoder/Crypt/CBC.pm
    6. libmessage-passing-perl: /usr/share/perl5/Message/Passing/Filter/Encoder/Crypt/CBC.pm
    7. libmessage-passing-perl: /usr/share/perl5/Message/Passing/Role/Crypt/CBC.pm


    It's a productive server with 200 customers on board so it's a bit urgent ...

    How can I solve this problem?

  • it seems the cpan upgrade created an alias:

    Code
    1. type -a cpan
    2. cpan is /usr/local/bin/cpan
    3. cpan is /usr/bin/cpan
    4. ls -l /usr/local/bin/cpan
    5. -r-xr-xr-x 1 root root 8258 May 26 15:22 /usr/local/bin/cpan

    what is your output on Ubuntu 18 of:

    type -a cpan

  • some more details > cpan -> r

  • do you think I can remove /usr/local/bin/cpan?

    ls -l /usr/local/bin/cpan

    -r-xr-xr-x 1 root root 8258 May 26 15:22 /usr/local/bin/cpan


    and unalias cpan if it's an alias, or unset -f cpan

  • I have removed the new cpan

    Code
    1. rm /usr/local/bin/cpan
    2. unset -f cpan

    now it shows:

    type -a cpan

    cpan is /usr/bin/cpan


    but if I try to install or re-install a package e.g.


    What can I do?

  • seems to be caused in that part -> Crypt::CBC->new(

  • hmm, if i disable that part then it works

    nano /var/www/imscp/engine/PerlLib/iMSCP/Crypt.pm

    line 502

    # -blocksize => length $iv,


    Does the encryption still work afterwards and can I use it that way?

  • I'm not sure if this issue was caused by the erroneous mcpan upgrade or by a previous regular ubuntu update ... strange!

    What do you think, can I keep the "blocksize" part above like this?

  • I guess there are still new files & folders which should be removed ...


    which perl

    /usr/bin/perl

    (ok)


    This new folder is still available

    /usr/local/share/perl/5.26.1

    (delete)


    and many new files under

    /usr/local/bin

    on other installation there is only clamav-unofficial-sigs.sh available in /usr/local/bin

    (delete)


    and I have a backup of:

    /etc/perl

    /root/.cpan/build

    /root/.cpan/build/Metadata

    (delete restore)

    +++ maybe the /root cpan stuff could cause the issues +++


    Can I delete them safely?


    after unset -f cpan only /usr/bin/cpan is shown now:

    type -a cpan

    cpan is /usr/bin/cpan