papertrail / papertrail-cli

Command-line client for Papertrail hosted syslog & app log management service
http://papertrailapp.com/
MIT License
427 stars 46 forks source link

HTTPServerException when calling papertrail #104

Open marty331 opened 5 years ago

marty331 commented 5 years ago

I've recently install papertrail-cli, I have placed my token in my ~/.papertrail.yml file and when I execute papertrail from the command line I get the following error:

/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/net/http/response.rb:120:inerror!': 403 "Forbidden" (Net::HTTPServerException) from /Library/Ruby/Gems/2.3.0/gems/papertrail-0.11.0/lib/papertrail/http_client.rb:143:in on_complete' from /Library/Ruby/Gems/2.3.0/gems/papertrail-0.11.0/lib/papertrail/http_client.rb:84:inrequest' from /Library/Ruby/Gems/2.3.0/gems/papertrail-0.11.0/lib/papertrail/http_client.rb:62:in get' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/forwardable.rb:202:inget' from /Library/Ruby/Gems/2.3.0/gems/papertrail-0.11.0/lib/papertrail/search_query.rb:34:in next_results_page' from /Library/Ruby/Gems/2.3.0/gems/papertrail-0.11.0/lib/papertrail/cli.rb:139:inrun' from /Library/Ruby/Gems/2.3.0/gems/papertrail-0.11.0/bin/papertrail:5:in <top (required)>' from /usr/local/bin/papertrail:22:inload' from /usr/local/bin/papertrail:22:in <main>'

Just FYI, I'm running a Mac, version 10.14.5

SergeiPatiakin commented 4 years ago

I see the same issue on macOS 10.14.6:

/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/net/http/response.rb:120:in `error!': 403 "Forbidden" (Net::HTTPServerException)
    from /Library/Ruby/Gems/2.3.0/gems/papertrail-0.11.0/lib/papertrail/http_client.rb:143:in `on_complete'
    from /Library/Ruby/Gems/2.3.0/gems/papertrail-0.11.0/lib/papertrail/http_client.rb:84:in `request'
    from /Library/Ruby/Gems/2.3.0/gems/papertrail-0.11.0/lib/papertrail/http_client.rb:62:in `get'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/forwardable.rb:202:in `get'
    from /Library/Ruby/Gems/2.3.0/gems/papertrail-0.11.0/lib/papertrail/search_query.rb:34:in `next_results_page'
    from /Library/Ruby/Gems/2.3.0/gems/papertrail-0.11.0/lib/papertrail/cli.rb:131:in `block in run'
    from /Library/Ruby/Gems/2.3.0/gems/papertrail-0.11.0/lib/papertrail/cli.rb:130:in `loop'
    from /Library/Ruby/Gems/2.3.0/gems/papertrail-0.11.0/lib/papertrail/cli.rb:130:in `run'
    from /Library/Ruby/Gems/2.3.0/gems/papertrail-0.11.0/bin/papertrail:5:in `<top (required)>'
    from /usr/local/bin/papertrail:22:in `load'
    from /usr/local/bin/papertrail:22:in `<main>'
SergeiPatiakin commented 4 years ago

It seems this error occurs when you run a command without a system filter and your account lacks permissions for some systems. I fixed the issue by providing a -s parameter for the system I was interested in.