metacpan / metacpan-docker

DEVELOPMENT Docker configs for MetaCPAN
Artistic License 2.0
26 stars 23 forks source link

Docker image does not appear to work, catalyst reporting cannot forward to view #89

Open PaulGWebster opened 2 years ago

PaulGWebster commented 2 years ago

As title

PaulGWebster commented 2 years ago
web_1                     | [2021/09/23 10:39:14] [INFO] [/] *** Request 2 (0.049/s) [7] [Thu Sep 23 10:39:14 2021] ***
web_1                     | [2021/09/23 10:39:14] [DEBUG] [/] Path is "/"
web_1                     | [2021/09/23 10:39:14] [DEBUG] [/] "GET" request for "/" from "172.18.0.5"
web_1                     | [2021/09/23 10:39:14] [WARN] [/] Attempted to use view 'MetaCPAN::Web::View::HTML', but does not exist
web_1                     | [2021/09/23 10:39:14] [ERROR] [/] Caught exception in MetaCPAN::Web::Controller::Root->end "Catalyst::Action::RenderView could not find a view to forward to."
web_1                     | 172.18.0.5 - - [23/Sep/2021:10:39:14 +0000] "GET / HTTP/1.1" 500 23901 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.134 Safari/537.36"
PaulGWebster commented 2 years ago

not sure if relevent but a few other warnings on dc-up

github-meets-cpan-cron_1  | wait-for-it.sh: timeout occurred after waiting 15 seconds for mongodb:27017
github-meets-cpan_1       | wait-for-it.sh: timeout occurred after waiting 15 seconds for mongodb:27017
github-meets-cpan-cron_1  | malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "(end of string)") at /code/cron/../lib/GMC/Util.pm line 48.
metacpan_github-meets-cpan-cron_1 exited with code 255

mongodb_1 | mongodb_1 | WARNING: MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that! mongodb_1 | see https://www.mongodb.com/community/forums/t/mongodb-5-0-cpu-intel-g4650-compatibility/116610/2 mongodb_1 | see also https://github.com/docker-library/mongo/issues/485#issuecomment-891991814 mongodb_1 |

metacpan_mongodb_1 exited with code 132

PaulGWebster commented 2 years ago

Fixed the mongodb crashout with:

  mongodb:
    image: mongo:4.4.9

Still getting problems accessing 'web' though with the missing view

PaulGWebster commented 2 years ago

This is what catalyst is saying:

Request
do {
  require Symbol;
  my $a = bless({
    _determined_real_method => 1,
    _log                    => bless({ abort => undef, autoflush => 1, watch_delay => 0 }, "Log::Log4perl::Catalyst"),
    _path                   => "",
    _read_length            => 0,
    _read_position          => 0,
    _use_hash_multivalue    => 0,
    action                  => "/",
    address                 => "172.31.0.5",
    arguments               => [],
    base                    => bless(do{\(my $o = "http://web.metacpan.localhost/")}, "URI::http"),
    body_parameters         => {},
    captures                => [],
    cookies                 => {},
    data_handlers           => {
                                 "application/json" => sub { ... },
                                 "application/x-www-form-urlencoded" => sub { ... },
                               },
    env                     => {
                                 "Catalyst.Stash.v2"              => sub { ... },
                                 "HTTP_ACCEPT"                    => "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
                                 "HTTP_ACCEPT_ENCODING"           => "gzip, deflate",
                                 "HTTP_ACCEPT_LANGUAGE"           => "en-GB,en-US;q=0.9,en;q=0.8",
                                 "HTTP_CACHE_CONTROL"             => "max-age=0",
                                 "HTTP_HOST"                      => "web.metacpan.localhost",
                                 "HTTP_UPGRADE_INSECURE_REQUESTS" => 1,
                                 "HTTP_USER_AGENT"                => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.134 Safari/537.36",
                                 "HTTP_X_FORWARDED_FOR"           => "172.31.0.5",
                                 "HTTP_X_FORWARDED_HOST"          => "web.metacpan.localhost",
                                 "HTTP_X_FORWARDED_PORT"          => 80,
                                 "HTTP_X_FORWARDED_PROTO"         => "http",
                                 "HTTP_X_FORWARDED_SERVER"        => "5bd018d3b7f9",
                                 "HTTP_X_REAL_IP"                 => "172.31.0.5",
                                 "MetaCPAN::Web.request_id"       => "b2fa7f4dd3c8cc65c8ea90aec91aacc496a3c87c",
                                 "PATH_INFO"                      => "/",
                                 "plack.original_request_method"  => "GET",
                                 "psgi.errors"                    => *main::STDERR,
                                 "psgi.input"                     => \*HTTP::Server::PSGI::$input,
                                 "psgi.multiprocess"              => "",
                                 "psgi.multithread"               => "",
                                 "psgi.nonblocking"               => "",
                                 "psgi.run_once"                  => "",
                                 "psgi.streaming"                 => 1,
                                 "psgi.url_scheme"                => "http",
                                 "psgi.version"                   => [1, 1],
                                 "psgix.assets"                   => [
                                                                       "/static/js/jquery.min.js",
                                                                       "/static/js/jquery.tablesorter.js",
                                                                       "/static/js/jquery.relatize_date.js",
                                                                       "/static/js/jquery.qtip.min.js",
                                                                       "/static/js/jquery.autocomplete.min.js",
                                                                       "/static/js/mousetrap.min.js",
                                                                       "/static/js/shCore.js",
                                                                       "/static/js/shBrushPerl.js",
                                                                       "/static/js/shBrushPlain.js",
                                                                       "/static/js/shBrushYaml.js",
                                                                       "/static/js/shBrushJScript.js",
                                                                       "/static/js/shBrushDiff.js",
                                                                       "/static/js/shBrushCpp.js",
                                                                       "/static/js/shBrushCPANChanges.js",
                                                                       "/static/js/cpan.js",
                                                                       "/static/js/toolbar.js",
                                                                       "/static/js/github.js",
                                                                       "/static/js/dropdown.js",
                                                                       "/static/modules/bootstrap-v3.4.1/js/dropdown.js",
                                                                       "/static/modules/bootstrap-v3.4.1/js/collapse.js",
                                                                       "/static/modules/bootstrap-v3.4.1/js/modal.js",
                                                                       "/static/modules/bootstrap-v3.4.1/js/tooltip.js",
                                                                       "/static/modules/bootstrap-v3.4.1/js/affix.js",
                                                                       "/static/js/bootstrap-slidepanel.js",
                                                                       "/static/js/syntaxhighlighter.js",
                                                                       "/static/js/less.min.js",
                                                                       "/static/css/jquery.autocomplete.css",
                                                                       "/static/css/jquery.qtip.min.css",
                                                                       "/static/css/shCore.css",
                                                                       "/static/css/shThemeDefault.css",
                                                                       "/static/css/user.css",
                                                                       "/static/less/style.less",
                                                                     ],
                                 "psgix.harakiri"                 => 1,
                                 "psgix.input.buffered"           => 1,
                                 "psgix.io"                       => bless(Symbol::gensym(), "IO::Socket::INET"),
                                 "psgix.session"                  => {},
                                 "psgix.session.options"          => { id => 1632394809.54548, no_store => 1 },
                                 "QUERY_STRING"                   => "",
                                 "REMOTE_ADDR"                    => "172.31.0.5",
                                 "REMOTE_PORT"                    => 36288,
                                 "REQUEST_METHOD"                 => "GET",
                                 "REQUEST_URI"                    => "/",
                                 "SCRIPT_NAME"                    => "",
                                 "SERVER_NAME"                    => 0,
                                 "SERVER_PORT"                    => 80,
                                 "SERVER_PROTOCOL"                => "HTTP/1.1",
                               },
    final_args              => 'fix',
    headers                 => bless({
                                 "::std_case"                => {
                                                                  "cookie"                    => "Cookie",
                                                                  "upgrade-insecure-requests" => "UPGRADE-INSECURE-REQUESTS",
                                                                  "x-forwarded-for"           => "X-FORWARDED-FOR",
                                                                  "x-forwarded-host"          => "X-FORWARDED-HOST",
                                                                  "x-forwarded-port"          => "X-FORWARDED-PORT",
                                                                  "x-forwarded-proto"         => "X-FORWARDED-PROTO",
                                                                  "x-forwarded-server"        => "X-FORWARDED-SERVER",
                                                                  "x-real-ip"                 => "X-REAL-IP",
                                                                },
                                 "accept"                    => "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
                                 "accept-encoding"           => "gzip, deflate",
                                 "accept-language"           => "en-GB,en-US;q=0.9,en;q=0.8",
                                 "cache-control"             => "max-age=0",
                                 "host"                      => "web.metacpan.localhost",
                                 "upgrade-insecure-requests" => 1,
                                 "user-agent"                => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.134 Safari/537.36",
                                 "x-forwarded-for"           => "172.31.0.5",
                                 "x-forwarded-host"          => "web.metacpan.localhost",
                                 "x-forwarded-port"          => 80,
                                 "x-forwarded-proto"         => "http",
                                 "x-forwarded-server"        => "5bd018d3b7f9",
                                 "x-real-ip"                 => "172.31.0.5",
                               }, "HTTP::Headers"),
    match                   => "/",
    method                  => "GET",
    parameters              => {},
    protocol                => "HTTP/1.1",
    query_parameters        => {},
    remote_user             => undef,
    secure                  => 0,
    uploads                 => {},
    uri                     => bless(do{\(my $o = "http://web.metacpan.localhost/")}, "URI::http"),
  }, "Moose::Meta::Class::__ANON__::SERIAL::15");
  *{$a->{env}{"psgix.io"}} = {
    io_socket_domain   => 2,
    io_socket_peername => pack("H*","02008dc0ac1f00020000000000000000"),
    io_socket_proto    => 6,
    io_socket_timeout  => undef,
    io_socket_type     => 1,
  };
  $a->{final_args} = $a->{arguments};
  $a;
}
Response
bless({
  _log => bless({ abort => undef, autoflush => 1, watch_delay => 0 }, "Log::Log4perl::Catalyst"),
  _response_cb => sub { ... },
  body => undef,
  cookies => {},
  encodable_content_type => qr/text|xml$|javascript$/,
  encoding => bless({ Name => "utf-8-strict", strict_utf8 => 1 }, "Encode::utf8"),
  finalized_headers => 0,
  headers => bless({
    "::std_case"   => { "x-catalyst" => "X-Catalyst" },
    "content-type" => "text/html; charset=utf-8",
    "x-catalyst"   => 5.90128,
  }, "HTTP::Headers"),
  status => 200,
}, "Moose::Meta::Class::__ANON__::SERIAL::16")
Stash
{ template => "home.tx" }
Config
do {
  my $a = {
    "Action::RenderView"                          => {
                                                       ignore_classes => [
                                                                           "DBIx::Class::ResultSource::Table",
                                                                           "DBIx::Class::ResultSourceHandle",
                                                                           "DateTime",
                                                                         ],
                                                       scrubber_func  => sub { ... },
                                                     },
    "api"                                         => "http://api:5000",
    "api_external"                                => "http://localhost:5000",
    "api_external_secure"                         => "http://localhost:5000",
    "api_secure"                                  => "http://api:5000",
    "consumer_key"                                => "metacpan.dev",
    "consumer_secret"                             => "ClearAirTurbulence",
    "Controller::Account::Turing"                 => { public_key => "6LeH2MsSAAAAANwz3AA73Gw5OjCVjT6I51Ev-ior" },
    "cookie_secret"                               => "seekrit",
    "default_view"                                => "HTML",
    "disable_component_resolution_regex_fallback" => 1,
    "home"                                        => "/metacpan-web",
    "mark_unauthorized_releases"                  => 0,
    "name"                                        => "MetaCPAN::Web",
    "Plugin::Authentication"                      => {
                                                       default => {
                                                         class => "+MetaCPAN::Web::Authentication::Realm",
                                                         credential => { class => "NoPassword" },
                                                         store => { class => "+MetaCPAN::Web::Authentication::Store" },
                                                         use_session => 0,
                                                       },
                                                       use_session => 0,
                                                     },
    "Plugin::ConfigLoader"                        => {},
    "Plugin::Static::Simple"                      => {
                                                       debug => 1,
                                                       dirs => [],
                                                       ignore_dirs => [],
                                                       ignore_extensions => ["tmpl", "tt", "tt2", "html", "xhtml"],
                                                       include_path => [
                                                         bless({
                                                           dirs => ["", "metacpan-web", "root"],
                                                           file_spec_class => undef,
                                                           volume => "",
                                                         }, "Path::Class::Dir"),
                                                       ],
                                                       mime_types => {},
                                                       mime_types_obj => bless({}, "MIME::Types"),
                                                       no_logs => 1,
                                                     },
    "root"                                        => 'fix',
    "setup_components"                            => { search_extra => [] },
    "source_host"                                 => "http://localhost:5000",
    "static"                                      => 'fix',
    "View::HTML"                                  => {
                                                       AUTO_FILTER        => "html",
                                                       COMPILE_DIR        => "/var/tmp/templates",
                                                       COMPILE_PERL       => 0,
                                                       ENCODING           => "utf8",
                                                       INCLUDE_PATH       => "root/",
                                                       STAT_TTL           => 1,
                                                       TAG_STYLE          => "asp",
                                                       TEMPLATE_EXTENSION => ".html",
                                                       WRAPPER            => "wrapper.html",
                                                     },
    "View::Raw"                                   => { WRAPPER => "" },
    "web_host"                                    => "http://localhost:5001",
  };
  $a->{"root"} = $a->{"Plugin::Static::Simple"}{include_path}[0];
  $a->{"static"} = $a->{"Plugin::Static::Simple"};
  $a;
}
PaulGWebster commented 2 years ago

by the way I noticed in my trace that consumer_secret is being shown ... as this is the public docker image I assume that it was auto generated during init, but just highlighting it in case it is a genuine security issue

oalders commented 2 years ago

If you're just working on the front end, you should be fine with docker-compose up web as you don't need any of the other services to edit web.

oalders commented 2 years ago

by the way I noticed in my trace that consumer_secret is being shown ... as this is the public docker image I assume that it was auto generated during init, but just highlighting it in case it is a genuine security issue

This seems fine. That's just a placeholder value. The production instances get their secrets elsewhere.

PaulGWebster commented 2 years ago

Seems to have made no difference weirdly:

web_1                     | [2021/09/23 13:39:23] [DEBUG] [/] "GET" request for "/" from "172.31.0.3"
web_1                     | [2021/09/23 13:39:23] [WARN] [/] Attempted to use view 'MetaCPAN::Web::View::HTML', but does not exist
web_1                     | [2021/09/23 13:39:23] [ERROR] [/] Caught exception in MetaCPAN::Web::Controller::Root->end "Catalyst::Action::RenderView could not find a view to forward to."
web_1                     | 172.31.0.3 - - [23/Sep/2021:13:39:23 +0000] "GET / HTTP/1.1" 500 23696 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.134 Safari/537.36"
web_1                     | [2021/09/23 13:39:23] [DEBUG] [/] Response Code: 500; Content-Type: text/html; charset=utf-8; Content-Length: unknown
web_1                     | [2021/09/23 13:39:23] [INFO] [/] Request took 0.016273s (61.451/s)
web_1                     | .------------------------------------------------------------+-----------.
web_1                     | | Action                                                     | Time      |
web_1                     | +------------------------------------------------------------+-----------+
web_1                     | | /index                                                     | 0.000139s |
web_1                     | | /end                                                       | 0.000698s |
web_1                     | '------------------------------------------------------------+-----------'
web_1                     |
web_1                     | [2021/09/23 13:39:35] [INFO] [/] *** Request 2 (0.054/s) [7] [Thu Sep 23 13:39:35 2021] ***
web_1                     | [2021/09/23 13:39:35] [DEBUG] [/] Path is "/"
web_1                     | [2021/09/23 13:39:35] [DEBUG] [/] "GET" request for "/" from "172.31.0.3"
web_1                     | [2021/09/23 13:39:35] [WARN] [/] Attempted to use view 'MetaCPAN::Web::View::HTML', but does not exist
web_1                     | [2021/09/23 13:39:35] [ERROR] [/] Caught exception in MetaCPAN::Web::Controller::Root->end "Catalyst::Action::RenderView could not find a view to forward to."
web_1                     | 172.31.0.3 - - [23/Sep/2021:13:39:35 +0000] "GET / HTTP/1.1" 500 23901 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.134 Safari/537.36"
web_1                     | [2021/09/23 13:39:35] [DEBUG] [/] Response Code: 500; Content-Type: text/html; charset=utf-8; Content-Length: unknown
web_1                     | [2021/09/23 13:39:35] [INFO] [/] Request took 0.01601s (62.461/s)
web_1                     | .------------------------------------------------------------+-----------.
web_1                     | | Action                                                     | Time      |
web_1                     | +------------------------------------------------------------+-----------+
web_1                     | | /index                                                     | 0.000134s |
web_1                     | | /end                                                       | 0.000558s |
web_1                     | '------------------------------------------------------------+-----------'
Caught exception in MetaCPAN::Web::Controller::Root->end "Catalyst::Action::RenderView could not find a view to forward to."

Request
do {
  require Symbol;
  my $a = bless({
    _determined_real_method => 1,
    _log                    => bless({ abort => undef, autoflush => 1, watch_delay => 0 }, "Log::Log4perl::Catalyst"),
    _path                   => "",
    _read_length            => 0,
    _read_position          => 0,
    _use_hash_multivalue    => 0,
    action                  => "/",
    address                 => "172.31.0.3",
    arguments               => [],
    base                    => bless(do{\(my $o = "http://web.metacpan.localhost/")}, "URI::http"),
    body_parameters         => {},
    captures                => [],
    cookies                 => {},
    data_handlers           => {
                                 "application/json" => sub { ... },
                                 "application/x-www-form-urlencoded" => sub { ... },
                               },
    env                     => {
                                 "Catalyst.Stash.v2"              => sub { ... },
                                 "HTTP_ACCEPT"                    => "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
                                 "HTTP_ACCEPT_ENCODING"           => "gzip, deflate",
                                 "HTTP_ACCEPT_LANGUAGE"           => "en-GB,en-US;q=0.9,en;q=0.8",
                                 "HTTP_CACHE_CONTROL"             => "max-age=0",
                                 "HTTP_HOST"                      => "web.metacpan.localhost",
                                 "HTTP_UPGRADE_INSECURE_REQUESTS" => 1,
                                 "HTTP_USER_AGENT"                => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.134 Safari/537.36",
                                 "HTTP_X_FORWARDED_FOR"           => "172.31.0.3",
                                 "HTTP_X_FORWARDED_HOST"          => "web.metacpan.localhost",
                                 "HTTP_X_FORWARDED_PORT"          => 80,
                                 "HTTP_X_FORWARDED_PROTO"         => "http",
                                 "HTTP_X_FORWARDED_SERVER"        => "5bd018d3b7f9",
                                 "HTTP_X_REAL_IP"                 => "172.31.0.3",
                                 "MetaCPAN::Web.request_id"       => "62e7a7214d68b7143e9a01ca1bd224e878e95dee",
                                 "PATH_INFO"                      => "/",
                                 "plack.original_request_method"  => "GET",
                                 "psgi.errors"                    => *main::STDERR,
                                 "psgi.input"                     => \*HTTP::Server::PSGI::$input,
                                 "psgi.multiprocess"              => "",
                                 "psgi.multithread"               => "",
                                 "psgi.nonblocking"               => "",
                                 "psgi.run_once"                  => "",
                                 "psgi.streaming"                 => 1,
                                 "psgi.url_scheme"                => "http",
                                 "psgi.version"                   => [1, 1],
                                 "psgix.assets"                   => [
                                                                       "/static/js/jquery.min.js",
                                                                       "/static/js/jquery.tablesorter.js",
                                                                       "/static/js/jquery.relatize_date.js",
                                                                       "/static/js/jquery.qtip.min.js",
                                                                       "/static/js/jquery.autocomplete.min.js",
                                                                       "/static/js/mousetrap.min.js",
                                                                       "/static/js/shCore.js",
                                                                       "/static/js/shBrushPerl.js",
                                                                       "/static/js/shBrushPlain.js",
                                                                       "/static/js/shBrushYaml.js",
                                                                       "/static/js/shBrushJScript.js",
                                                                       "/static/js/shBrushDiff.js",
                                                                       "/static/js/shBrushCpp.js",
                                                                       "/static/js/shBrushCPANChanges.js",
                                                                       "/static/js/cpan.js",
                                                                       "/static/js/toolbar.js",
                                                                       "/static/js/github.js",
                                                                       "/static/js/dropdown.js",
                                                                       "/static/modules/bootstrap-v3.4.1/js/dropdown.js",
                                                                       "/static/modules/bootstrap-v3.4.1/js/collapse.js",
                                                                       "/static/modules/bootstrap-v3.4.1/js/modal.js",
                                                                       "/static/modules/bootstrap-v3.4.1/js/tooltip.js",
                                                                       "/static/modules/bootstrap-v3.4.1/js/affix.js",
                                                                       "/static/js/bootstrap-slidepanel.js",
                                                                       "/static/js/syntaxhighlighter.js",
                                                                       "/static/js/less.min.js",
                                                                       "/static/css/jquery.autocomplete.css",
                                                                       "/static/css/jquery.qtip.min.css",
                                                                       "/static/css/shCore.css",
                                                                       "/static/css/shThemeDefault.css",
                                                                       "/static/css/user.css",
                                                                       "/static/less/style.less",
                                                                     ],
                                 "psgix.harakiri"                 => 1,
                                 "psgix.input.buffered"           => 1,
                                 "psgix.io"                       => bless(Symbol::gensym(), "IO::Socket::INET"),
                                 "psgix.session"                  => {},
                                 "psgix.session.options"          => { id => 1632404375.64926, no_store => 1 },
                                 "QUERY_STRING"                   => "",
                                 "REMOTE_ADDR"                    => "172.31.0.3",
                                 "REMOTE_PORT"                    => 57598,
                                 "REQUEST_METHOD"                 => "GET",
                                 "REQUEST_URI"                    => "/",
                                 "SCRIPT_NAME"                    => "",
                                 "SERVER_NAME"                    => 0,
                                 "SERVER_PORT"                    => 80,
                                 "SERVER_PROTOCOL"                => "HTTP/1.1",
                               },
    final_args              => 'fix',
    headers                 => bless({
                                 "::std_case"                => {
                                                                  "cookie"                    => "Cookie",
                                                                  "upgrade-insecure-requests" => "UPGRADE-INSECURE-REQUESTS",
                                                                  "x-forwarded-for"           => "X-FORWARDED-FOR",
                                                                  "x-forwarded-host"          => "X-FORWARDED-HOST",
                                                                  "x-forwarded-port"          => "X-FORWARDED-PORT",
                                                                  "x-forwarded-proto"         => "X-FORWARDED-PROTO",
                                                                  "x-forwarded-server"        => "X-FORWARDED-SERVER",
                                                                  "x-real-ip"                 => "X-REAL-IP",
                                                                },
                                 "accept"                    => "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
                                 "accept-encoding"           => "gzip, deflate",
                                 "accept-language"           => "en-GB,en-US;q=0.9,en;q=0.8",
                                 "cache-control"             => "max-age=0",
                                 "host"                      => "web.metacpan.localhost",
                                 "upgrade-insecure-requests" => 1,
                                 "user-agent"                => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.134 Safari/537.36",
                                 "x-forwarded-for"           => "172.31.0.3",
                                 "x-forwarded-host"          => "web.metacpan.localhost",
                                 "x-forwarded-port"          => 80,
                                 "x-forwarded-proto"         => "http",
                                 "x-forwarded-server"        => "5bd018d3b7f9",
                                 "x-real-ip"                 => "172.31.0.3",
                               }, "HTTP::Headers"),
    match                   => "/",
    method                  => "GET",
    parameters              => {},
    protocol                => "HTTP/1.1",
    query_parameters        => {},
    remote_user             => undef,
    secure                  => 0,
    uploads                 => {},
    uri                     => bless(do{\(my $o = "http://web.metacpan.localhost/")}, "URI::http"),
  }, "Moose::Meta::Class::__ANON__::SERIAL::15");
  *{$a->{env}{"psgix.io"}} = {
    io_socket_domain   => 2,
    io_socket_peername => pack("H*","0200e0feac1f00020000000000000000"),
    io_socket_proto    => 6,
    io_socket_timeout  => undef,
    io_socket_type     => 1,
  };
  $a->{final_args} = $a->{arguments};
  $a;
}
Response
bless({
  _log => bless({ abort => undef, autoflush => 1, watch_delay => 0 }, "Log::Log4perl::Catalyst"),
  _response_cb => sub { ... },
  body => undef,
  cookies => {},
  encodable_content_type => qr/text|xml$|javascript$/,
  encoding => bless({ Name => "utf-8-strict", strict_utf8 => 1 }, "Encode::utf8"),
  finalized_headers => 0,
  headers => bless({
    "::std_case"   => { "x-catalyst" => "X-Catalyst" },
    "content-type" => "text/html; charset=utf-8",
    "x-catalyst"   => 5.90128,
  }, "HTTP::Headers"),
  status => 200,
}, "Moose::Meta::Class::__ANON__::SERIAL::16")
Stash
{ template => "home.tx" }
Config
do {
  my $a = {
    "Action::RenderView"                          => {
                                                       ignore_classes => [
                                                                           "DBIx::Class::ResultSource::Table",
                                                                           "DBIx::Class::ResultSourceHandle",
                                                                           "DateTime",
                                                                         ],
                                                       scrubber_func  => sub { ... },
                                                     },
    "api"                                         => "http://api:5000",
    "api_external"                                => "http://localhost:5000",
    "api_external_secure"                         => "http://localhost:5000",
    "api_secure"                                  => "http://api:5000",
    "consumer_key"                                => "metacpan.dev",
    "consumer_secret"                             => "ClearAirTurbulence",
    "Controller::Account::Turing"                 => { public_key => "6LeH2MsSAAAAANwz3AA73Gw5OjCVjT6I51Ev-ior" },
    "cookie_secret"                               => "seekrit",
    "default_view"                                => "HTML",
    "disable_component_resolution_regex_fallback" => 1,
    "home"                                        => "/metacpan-web",
    "mark_unauthorized_releases"                  => 0,
    "name"                                        => "MetaCPAN::Web",
    "Plugin::Authentication"                      => {
                                                       default => {
                                                         class => "+MetaCPAN::Web::Authentication::Realm",
                                                         credential => { class => "NoPassword" },
                                                         store => { class => "+MetaCPAN::Web::Authentication::Store" },
                                                         use_session => 0,
                                                       },
                                                       use_session => 0,
                                                     },
    "Plugin::ConfigLoader"                        => {},
    "Plugin::Static::Simple"                      => {
                                                       debug => 1,
                                                       dirs => [],
                                                       ignore_dirs => [],
                                                       ignore_extensions => ["tmpl", "tt", "tt2", "html", "xhtml"],
                                                       include_path => [
                                                         bless({
                                                           dirs => ["", "metacpan-web", "root"],
                                                           file_spec_class => undef,
                                                           volume => "",
                                                         }, "Path::Class::Dir"),
                                                       ],
                                                       mime_types => {},
                                                       mime_types_obj => bless({}, "MIME::Types"),
                                                       no_logs => 1,
                                                     },
    "root"                                        => 'fix',
    "setup_components"                            => { search_extra => [] },
    "source_host"                                 => "http://localhost:5000",
    "static"                                      => 'fix',
    "View::HTML"                                  => {
                                                       AUTO_FILTER        => "html",
                                                       COMPILE_DIR        => "/var/tmp/templates",
                                                       COMPILE_PERL       => 0,
                                                       ENCODING           => "utf8",
                                                       INCLUDE_PATH       => "root/",
                                                       STAT_TTL           => 1,
                                                       TAG_STYLE          => "asp",
                                                       TEMPLATE_EXTENSION => ".html",
                                                       WRAPPER            => "wrapper.html",
                                                     },
    "View::Raw"                                   => { WRAPPER => "" },
    "web_host"                                    => "http://localhost:5001",
  };
  $a->{"root"} = $a->{"Plugin::Static::Simple"}{include_path}[0];
  $a->{"static"} = $a->{"Plugin::Static::Simple"};
  $a;
}
MetaCPAN::Web on Catalyst 5.90128
oalders commented 2 years ago

Right, that won't fix the Catalyst error, but at least it won't prevent you from working because of an issue in another container (like the MongoDB error that you've already fixed).

    "api"                                         => "http://api:5000",
    "api_external"                                => "http://localhost:5000",
    "api_external_secure"                         => "http://localhost:5000",
    "api_secure"                                  => "http://api:5000",

Those would need to be changed if you're running web as a standalone container, though. They should default to https://fastapi.metacpan.org

PaulGWebster commented 2 years ago

I did PR that mongo fix here https://github.com/metacpan/metacpan-docker/pull/90

PaulGWebster commented 2 years ago

They appear to be defined here, I will set these to the public api end point

➜  metacpan-docker git:(master) ✗ grep -r api_external_secure
configs/metacpan-web/metacpan_web.conf:api_external_secure = http://localhost:5000
➜  metacpan-docker git:(master) ✗ cat configs/metacpan-web/metacpan_web.conf
# rename this file to metacpan::web.yml and put a ':' after 'name' if
# you want to use YAML like in old versions of Catalyst
name MetaCPAN::Web
default_view HTML

api             = http://api:5000
api_external    = http://localhost:5000
api_secure      = http://api:5000
api_external_secure = http://localhost:5000
PaulGWebster commented 2 years ago

The API pointers unfortunately do not seem to be the problem:

    "api"                                         => "https://fastapi.metacpan.org",
    "api_external"                                => "https://fastapi.metacpan.org",
    "api_external_secure"                         => "https://fastapi.metacpan.org",
    "api_secure"                                  => "https://fastapi.metacpan.org",

still throws the same error:

web_1                     | HTTP::Server::PSGI: Accepting connections at http://0:5001/
web_1                     | [2021/09/23 14:14:00] [INFO] [/] *** Request 1 (0.014/s) [9] [Thu Sep 23 14:14:00 2021] ***
web_1                     | [2021/09/23 14:14:00] [DEBUG] [/] Path is "/"
web_1                     | [2021/09/23 14:14:00] [DEBUG] [/] "GET" request for "/" from "192.168.1.83"
web_1                     | [2021/09/23 14:14:00] [WARN] [/] Attempted to use view 'MetaCPAN::Web::View::HTML', but does not exist
web_1                     | [2021/09/23 14:14:00] [ERROR] [/] Caught exception in MetaCPAN::Web::Controller::Root->end "Catalyst::Action::RenderView could not find a view to forward to."
web_1                     | 192.168.1.83 - - [23/Sep/2021:14:14:00 +0000] "GET / HTTP/1.1" 500 21841 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.134 Safari/537.36"
web_1                     | [2021/09/23 14:14:00] [DEBUG] [/] Response Code: 500; Content-Type: text/html; charset=utf-8; Content-Length: unknown
web_1                     | [2021/09/23 14:14:00] [INFO] [/] Request took 0.014136s (70.741/s)
web_1                     | .------------------------------------------------------------+-----------.
web_1                     | | Action                                                     | Time      |
web_1                     | +------------------------------------------------------------+-----------+
web_1                     | | /index                                                     | 0.000120s |
web_1                     | | /end                                                       | 0.000599s |
web_1                     | '------------------------------------------------------------+-----------'
web_1                     |
web_1                     | 192.168.1.83 - - [23/Sep/2021:14:14:00 +0000] "GET /favicon.ico HTTP/1.1" 200 18094 "http://192.168.1.87:5001/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.134 Safari/537.36"
web_1                     | 192.168.1.83 - - [23/Sep/2021:14:14:00 +0000] "GET /favicon.ico HTTP/1.1" 200 18094 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.134 Safari/537.36"

The browser output: https://gist.github.com/PaulGWebster/b3e26dc1a72838359fe53459fa8e5c4f

oalders commented 2 years ago

@PaulGWebster is this fixed for you now?

PaulGWebster commented 2 years ago

Going to double check but it looks to not have resolved the issue, I did do a docker-compose pull to pull in any potential image changes as well as pull'd master for metacpan-docker

also rebuild the -web image: ➜ metacpan-web git:(master) ✗ docker build . -t metacpan/metacpan-web

Log of both frontend and backend: https://gist.github.com/PaulGWebster/d9b8af216c6c9fcf97a7f8f6c9ab0c3f