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

Got a '301' from 'github.com' expected '200' #14

Open
eserte opened this Issue Dec 2, 2018 · 1 comment

Comments

2 participants
@eserte

eserte commented Dec 2, 2018

In a minimal docker setup using debian/stretch (stable) the test suite fails. The Dockerfile:

# maybe: docker pull debian:stretch
# docker build -t perl-test . && docker run perl-test
FROM debian:stretch

RUN apt-get -y update
RUN apt-get -y --no-install-recommends install perl make gcc

#RUN apt-get -y --no-install-recommends install liblwp-protocol-https-perl

CMD cpan -t ATRODO/App-MechaCPAN-0.26.tar.gz

The failing tests:

Got a '301' from 'github.com' expected '200' at /root/.cpan/build/App-MechaCPAN-0.26-hPnjY9/blib/lib/App/MechaCPAN.pm line 597.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 2 just after 3.
t/07_tmpdata.t ............. 
Dubious, test returned 2 (wstat 512, 0x200)
All 3 subtests passed 
...
# Error: 'Got a '301' from 'github.com' expected '200' at /root/.cpan/build/App-MechaCPAN-0.26-hPnjY9/blib/lib/App/MechaCPAN.pm line 597.
# '

#   Failed test 'Got 'https://github.com/p5sagit/Try-Tiny/archive/v0.24.zip''
#   at t/22_install__get_targz.t line 49.
# Looks like you failed 1 test of 14.
t/22_install__get_targz.t .. 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/14 subtests 
        (less 2 skipped subtests: 11 okay)
...
#   Failed test 'Honored PERL_USE_UNSAFE_INC=: /root/.cpan/build/App-MechaCPAN-0.26-hPnjY9/t/../test_dists/UnsafeInc/UnsafeInc-1.0.tar.gz'
#   at t/gh3.t line 23.
#          got: '0'
#     expected: anything else

#   Failed test 'Honored PERL_USE_UNSAFE_INC=0: /root/.cpan/build/App-MechaCPAN-0.26-hPnjY9/t/../test_dists/UnsafeInc/UnsafeInc-1.0.tar.gz'
#   at t/gh3.t line 27.
#          got: '0'
#     expected: anything else
# Looks like you failed 2 tests of 8.
t/gh3.t .................... 
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/8 subtests 

The first two failing tests are fixed by installing LWP::Protocol::https before (see the commented out RUN line in the Dockerfile). The third test still fails (and probably should dealt into another issue).

@atrodo

This comment has been minimized.

Owner

atrodo commented Dec 4, 2018

Thank you very much for the ticket. I have seen these failures on cpantesters, but had so far assumed that the 301 as caused because of some strange network configuration causing github URLs to be redirected. Having this information however makes it clear that the issue is that https is missing from LWP and (I assume) LWP rewriting my https url to http since it can't do https. I will be investigating how to handle this case for the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment