duckduckgo / p5-app-duckpan

DuckDuckHack OpenSource Development Application
http://metacpan.org/module/App::DuckPAN
Other
53 stars 47 forks source link

DuckPAN errors when t/ directory exists beside root of repo, e.g. zeroclickinfo-goodies/ #11

Closed djinn closed 9 years ago

djinn commented 11 years ago

I suspect that I have missed some step or set some environment variable incorrectly. I was successfully able to install duckpan. When I try to run duckpan server, I receive two kinds of errors.

With this I have hit a dead end. Would like to know what I might be doing wrong?

moollaza commented 11 years ago

@djinn I'm unable to reproduce this. As far as I can tell, the repo and all plugins are in working order so you shouldn't have to modify or change anything to get duckPAN running correctly for Spice or Goodies.

Please provide in detail what steps you took that got you to this point and we can go from there!

djinn commented 11 years ago

I installed duckpan by running this command: curl http://duckpan.org/install.pl | perl This time around it installed smoothly.

ss@shakti:~/eproj/zeroclickinfo-spice$ duckpan check Checking for latest App::DuckPAN ... 0.116

Checking your environment for the DuckPAN requirements

Checking for latest DDG Perl package... 0.114 Checking for git... /usr/bin/git Checking for ssh... /usr/bin/ssh

EVERYTHING OK! You can now go hacking! :)

When I try this URL http://127.0.0.1:5000/?q=zipcode+110075 I receive following output

HTTP::Server::PSGI: Accepting connections at http://0:5000/ DDG::ZeroClickInfo::Spice { Parents Moo::Object public methods (9) : call, call_data, caller, call_path, call_type, has_call, has_call_data, has_call_type, new private methods (0) internals: { call "/js/spice/zipcode/110075/ZZ", caller "DDG::Spice::Zipcode", call_type "include", is_cached 1, is_unsafe 0 } } Can't locate object method "module_share_dir" via package "DDG::Spice::Zipcode" at /home/ss/perl5/lib/perl5/App/DuckPAN/Web.pm line 208 App::DuckPAN::Web::request('App::DuckPAN::Web=HASH(0x9be7f38)', 'Plack::Request=HASH(0x9dcdd60)') called at /home/ss/perl5/lib/perl5/App/DuckPAN/Web.pm line 71 App::DuckPAN::Web::run_psgi('App::DuckPAN::Web=HASH(0x9be7f38)', 'HASH(0x9bceb90)') called at /home/ss/perl5/lib/perl5/App/DuckPAN/Cmd/Server.pm line 99 App::DuckPAN::Cmd::Server::ANON('HASH(0x9bceb90)') called at /home/ss/perl5/lib/perl5/Plack/Middleware/Lint.pm line 24 Plack::Middleware::Lint::call('Plack::Middleware::Lint=HASH(0x9e1a6b0)', 'HASH(0x9bceb90)') called at /home/ss/perl5/lib/perl5/Plack/Component.pm line 50 Plack::Middleware::StackTrace::try {...} at /home/ss/perl5/lib/perl5/Try/Tiny.pm line 78 eval {...} at /home/ss/perl5/lib/perl5/Try/Tiny.pm line 74 Plack::Middleware::StackTrace::call('Plack::Middleware::StackTrace=HASH(0x9e1a818)', 'HASH(0x9bceb90)') called at /home/ss/perl5/lib/perl5/Plack/Component.pm line 50 Plack::Component::ANON('HASH(0x9bceb90)') called at /home/ss/perl5/lib/perl5/Plack/Middleware/AccessLog.pm line 24 Plack::Middleware::AccessLog::call('Plack::Middleware::AccessLog=HASH(0x9e1a980)', 'HASH(0x9bceb90)') called at /home/ss/perl5/lib/perl5/Plack/Component.pm line 50 Plack::Component::ANON('HASH(0x9bceb90)') called at /home/ss/perl5/lib/perl5/Plack/Middleware/ContentLength.pm line 10 Plack::Middleware::ContentLength::call('Plack::Middleware::ContentLength=HASH(0x9dc3254)', 'HASH(0x9bceb90)') called at /home/ss/perl5/lib/perl5/Plack/Component.pm line 50 Plack::Component::ANON('HASH(0x9bceb90)') called at /home/ss/perl5/lib/perl5/Plack/Util.pm line 142 eval {...} at /home/ss/perl5/lib/perl5/Plack/Util.pm line 142 Plack::Util::run_app('CODE(0x9e1d9dc)', 'HASH(0x9bceb90)') called at /home/ss/perl5/lib/perl5/HTTP/Server/PSGI.pm line 170 HTTP::Server::PSGI::handle_connection('HTTP::Server::PSGI=HASH(0x9e1d928)', 'HASH(0x9bceb90)', 'IO::Socket::INET=GLOB(0x9e1d8b0)', 'CODE(0x9e1d9dc)') called at /home/ss/perl5/lib/perl5/HTTP/Server/PSGI.pm line 129 HTTP::Server::PSGI::accept_loop('HTTP::Server::PSGI=HASH(0x9e1d928)', 'CODE(0x9e1ae30)') called at /home/ss/perl5/lib/perl5/HTTP/Server/PSGI.pm line 55 HTTP::Server::PSGI::run('HTTP::Server::PSGI=HASH(0x9e1d928)', 'CODE(0x9e1ae30)') called at /home/ss/perl5/lib/perl5/Plack/Handler/HTTP/Server/PSGI.pm line 14 Plack::Handler::HTTP::Server::PSGI::run('Plack::Handler::Standalone=HASH(0x9e1dc98)', 'CODE(0x9e1ae30)') called at /home/ss/perl5/lib/perl5/Plack/Loader.pm line 84 Plack::Loader::run('Plack::Loader=HASH(0x9e07668)', 'Plack::Handler::Standalone=HASH(0x9e1dc98)') called at /home/ss/perl5/lib/perl5/Plack/Runner.pm line 277 Plack::Runner::run('Plack::Runner=HASH(0x9dde8f4)') called at /home/ss/perl5/lib/perl5/App/DuckPAN/Cmd/Server.pm line 102 App::DuckPAN::Cmd::Server::run('App::DuckPAN::Cmd::Server=HASH(0x919f42c)') called at /home/ss/perl5/lib/perl5/App/DuckPAN/Cmd.pm line 22 App::DuckPAN::Cmd::execute('App::DuckPAN::Cmd::Server=HASH(0x919f42c)', 'ARRAY(0x82634c0)', 'ARRAY(0x9043df8)') called at /home/ss/perl5/lib/perl5/MooX/Cmd.pm line 118 MooX::Cmd::ANON('App::DuckPAN') called at /home/ss/perl5/bin/duckpan line 8 127.0.0.1 - - [12/Sep/2013:19:07:31 +0530] "GET /?q=zipcode+110075 HTTP/1.1" 500 2136307 "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:22.0) Gecko/20100101 Firefox/22.0"

moollaza commented 11 years ago

@djinn thanks, can you also show me the output from when you startup the DuckPAN Server?

moollaza commented 11 years ago

@djinn did you run: $ duckpan installdeps from the root of the Spice repo before starting?

djinn commented 11 years ago

Yes I did. Here is output from duckpan server

duckpan server Checking for latest App::DuckPAN ... 0.116 Checking for latest DDG Perl package... 0.114

Using the following DDG plugins:

Trying to fetch current versions of the HTML from http://duckduckgo.com/

Some plugins maybe missing. I deleted them.

moollaza commented 11 years ago

@djinn have you tried again recently? I would suggest you try cloning the spice repo again and try running duckpan server. I'm still unable to recreate this problem

djinn commented 11 years ago

Will try that first thing tomorrow morning.

moollaza commented 11 years ago

@djinn I believe we've figured out the problem. Its most likely you have an outdated version of WWW::DuckDuckGo.

Please run $ cpanm WWW::DuckDuckGo and then using the latest Goodie release and DuckPAN release try it again. Everything should work.

moollaza commented 10 years ago

@djinn can you confirm this issue has been resolved?

moollaza commented 10 years ago

Closing. Issue is stale and there have been no reports of other installation issues.

kmg commented 10 years ago

Noting down for documentation here - this error can arise if you have a sibling directory named t along with the zeroclickinfo-spice / goodie / fathead / longtail like illustrated below -

toplevel_dir
- t
- zeroclickinfo-spice

This happens because DDG::Meta::ShareDir checks for a t dir in parent and changes $basedir

  if ( -e $basedir->parent->subdir('t') ) {
    $basedir = $basedir->parent;
  }

Deleting / Moving the t dir will fix one way of triggering this error :)

moollaza commented 10 years ago

@kmg many thanks for pointing that out -- definitely seems like a bug, DuckPAN probably shouldn't be concerning itself with directories outside of the current repo

zachthompson commented 9 years ago

Should be addressed by https://github.com/duckduckgo/duckduckgo/pull/117