in reply to LWP::Protocol::https is installed but pinto fails with "Protocol scheme https is not supported"

Please provide the output of these:
printf 'pinto: %s\n' "$( which pinto )" printf 'perl: %s\n' "$( which perl )" printf 'pinto shebang: %s\n' "$( head -n 1 "$( which pinto )" )" printf 'PATH=%s\n' "$PATH" env | grep ^PERL # Use the output from `head` above minus the `#!` instead of `perl`. perl -e'use LWP::Protocol::https'
  • Comment on Re: LWP::Protocol::https is installed but pinto fails with "Protocol scheme https is not supported"
  • Download Code

Replies are listed 'Best First'.
Re^2: LWP::Protocol::https is installed but pinto fails with "Protocol scheme https is not supported"
by Intrepid (Curate) on Mar 17, 2025 at 20:18 UTC

    Hello ikegami, your participation is much appreciated. Here's what the system I'm working on shows for your suggested commands:

    somian@antique-acer:~$ printf 'pinto: %s\n' "$( which pinto )"
    pinto: /usr/local/bin/pinto
    somian@antique-acer:~$ printf 'perl: %s\n' "$( which perl )"
    perl: /usr/local/bin/perl
    somian@antique-acer:~$ printf 'pinto shebang: %s\n' "$( head -n 1 "$( which pinto )" )"
    pinto shebang: #!/usr/local/bin/perl
    somian@antique-acer:~$ printf 'PATH=%s\n' "$PATH"
    PATH=/usr/lib/distcc/bin:/home/somian/.local/bin:/home/somian/local/bin:/usr/local/bin:/usr/bin:/bin
    somian@antique-acer:~$ env | grep ^PERL
    PERL5LIB=/usr/share/perl5
    somian@antique-acer:~$ /usr/local/bin/perl -e'use LWP::Protocol::https'
    somian@antique-acer:~$
    

    What this tells us is that /usr/local/bin/perl is consistently the perl that's being invoked. I added another such test, to see where LWP::Protocol::https is found:

      /usr/local/bin/perl -e'use LWP::Protocol::https; print qq$LWP::Protocol::https::VERSION = ,$INC{"LWP/Protocol/https.pm"}.$/'
    6.07 = /usr/share/perl5/LWP/Protocol/https.pm
    

    I don't know if we're closer to solving this, but I enjoy playing around with commands in the shell for its own sake :-).

    I've got a suspicion now, that my attempted pinto command was failing because I was running as root, under sudo. Question: if I run a perl script as root using sudo, will $PERL5LIB not be present in the environment as it is for the normal user? PERL5LIB is declared in /etc/profile on my system (Debian Gnu/Linux).

    I was running as root because I wanted to store my pinto stacks under /usr/local/lib/pinto, and I keep running into perm problems. If I try using the invocation above without being root, this happens:

    somian@antique-acer:~$ pinto --root /usr/local/lib/pinto/pinto1 pull D +ateTime DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::SQLite: +:st execute failed: attempt to write a readonly database [for Stateme +nt "INSERT INTO revision ( has_changes, is_committed, message, time_o +ffset, username, utc_time, uuid) VALUES ( ?, ?, ?, ?, ?, ?, ? )" with + ParamValues: 1=0, 2=0, 3='', 4=0, 5='', 6=1742241369, 7='ba2d5883-f3 +7c-45f2-8a81-ea701e4e7172'] at (eval 912) line 1
    Mar 17, 2025 at 20:15 UTC

      Running the commands in a different environment one than where you get the problem is not too useful, at least not on its own. Please run them in the same way as you normally run pinto.

      I haven't played much with sudo and how it affects the environment, but it seems possible that PERL5LIB isn't inherited or set in the child.

        Ok, getting back to you, ikegami, wrt to where you said:

        I haven't played much with sudo and how it affects the environment, but it seems possible that PERL5LIB isn't inherited or set in the child.

        I've just run a couple commands in the shell to check this. Recollecting that bash sources /etc/profile for a login shell, we become root using the flag that tells bash it is a login shell, and check its environment:

        somian@antique-acer:~/repos$ sudo bash -login -i root@antique-acer:/home/somian/repos# env | grep ^PERL PERL5LIB=/usr/share/perl5

        Now we do that same but leave out the -login flag, and PERL5LIB vanishes:

        somian@antique-acer:~/repos$ sudo bash -i root@antique-acer:/home/somian/repos# env | grep ^PERL root@antique-acer:/home/somian/repos#

        The apparent conclusion is that $PERL5LIB is not inherited when running as root, and furthermore won't be set when bash's root child process starts if one's setup is such that we set it in /etc/profile (which seems to me to be the "right" place for it).

        As I wrote before: "I was running as root because I wanted to store my pinto stacks under /usr/local/lib/pinto." Just not one of my brighter ideas, and I put it down to not having enough *nix knowledge. Now I am setting up repositories under my home dir and things are working as they should.

        Mar 19, 2025 at 02:42 UTC