lanej / zendesk2

Zendesk API V2 client using Cistern
http://lanej.io/zendesk2/
MIT License
25 stars 28 forks source link

uninitialized constant Zendesk2::Client::Real::USER_AGENT #39

Closed nozpheratu closed 9 years ago

nozpheratu commented 9 years ago

Attempting any operation on the client, e.g, client.tickets results in:

NameError - uninitialized constant Zendesk2::Client::Real::USER_AGENT:
  activesupport (4.1.13) lib/active_support/dependencies.rb:519:in `load_missing_constant'
  activesupport (4.1.13) lib/active_support/dependencies.rb:180:in `const_missing'
  zendesk2 (1.7.3) lib/zendesk2/client/real.rb:56:in `request'
  zendesk2 (1.7.3) lib/zendesk2/client/request.rb:122:in `real'
  zendesk2 (1.7.3) lib/zendesk2/client/request.rb:52:in `_real'
  cistern (2.2.3) lib/cistern/request.rb:14:in `get_tickets'
  zendesk2 (1.7.3) lib/zendesk2/client/collections/tickets.rb:31:in `collection_page'
  zendesk2 (1.7.3) lib/zendesk2/paged_collection.rb:93:in `all'
  cistern (2.2.3) lib/cistern/collection.rb:61:in `load_records'
  cistern (2.2.3) lib/cistern/collection.rb:96:in `to_a'
  cistern (2.2.3) lib/cistern/collection.rb:118:in `method_missing'
  app/views/documentation/index.html.haml:1:in `_app_views_documentation_index_html_haml___1773035227459600018_69718400'
  actionview (4.1.13) lib/action_view/template.rb:145:in `block in render'
  activesupport (4.1.13) lib/active_support/notifications.rb:161:in `instrument'
  actionview (4.1.13) lib/action_view/template.rb:339:in `instrument'
  actionview (4.1.13) lib/action_view/template.rb:143:in `render'
  actionview (4.1.13) lib/action_view/renderer/template_renderer.rb:55:in `block (2 levels) in render_template'
  actionview (4.1.13) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
  activesupport (4.1.13) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.1.13) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.1.13) lib/active_support/notifications.rb:159:in `instrument'
  actionview (4.1.13) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
  actionview (4.1.13) lib/action_view/renderer/template_renderer.rb:54:in `block in render_template'
  actionview (4.1.13) lib/action_view/renderer/template_renderer.rb:62:in `render_with_layout'
  actionview (4.1.13) lib/action_view/renderer/template_renderer.rb:53:in `render_template'
  actionview (4.1.13) lib/action_view/renderer/template_renderer.rb:17:in `render'
  actionview (4.1.13) lib/action_view/renderer/renderer.rb:42:in `render_template'
  actionview (4.1.13) lib/action_view/renderer/renderer.rb:23:in `render'
  actionview (4.1.13) lib/action_view/rendering.rb:99:in `_render_template'
  actionpack (4.1.13) lib/action_controller/metal/streaming.rb:217:in `_render_template'
  actionview (4.1.13) lib/action_view/rendering.rb:82:in `render_to_body'
  actionpack (4.1.13) lib/action_controller/metal/rendering.rb:32:in `render_to_body'
  actionpack (4.1.13) lib/action_controller/metal/renderers.rb:32:in `render_to_body'
  actionpack (4.1.13) lib/abstract_controller/rendering.rb:25:in `render'
  actionpack (4.1.13) lib/action_controller/metal/rendering.rb:16:in `render'
  actionpack (4.1.13) lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
  activesupport (4.1.13) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
  /home/cyle/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/benchmark.rb:303:in `realtime'
  activesupport (4.1.13) lib/active_support/core_ext/benchmark.rb:12:in `ms'
  actionpack (4.1.13) lib/action_controller/metal/instrumentation.rb:44:in `block in render'
  actionpack (4.1.13) lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
  activerecord (4.1.13) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
  actionpack (4.1.13) lib/action_controller/metal/instrumentation.rb:43:in `render'
  meta-tags (2.0.0) lib/meta_tags/controller_helper.rb:26:in `render_with_meta_tags'
  actionpack (4.1.13) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
  actionpack (4.1.13) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
  actionpack (4.1.13) lib/abstract_controller/base.rb:189:in `process_action'
  actionpack (4.1.13) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (4.1.13) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
  activesupport (4.1.13) lib/active_support/callbacks.rb:113:in `call'
  activesupport (4.1.13) lib/active_support/callbacks.rb:552:in `block (2 levels) in compile'
  activesupport (4.1.13) lib/active_support/callbacks.rb:502:in `call'
  activesupport (4.1.13) lib/active_support/callbacks.rb:86:in `run_callbacks'
  actionpack (4.1.13) lib/abstract_controller/callbacks.rb:19:in `process_action'
  actionpack (4.1.13) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (4.1.13) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
  activesupport (4.1.13) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.1.13) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.1.13) lib/active_support/notifications.rb:159:in `instrument'
  actionpack (4.1.13) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (4.1.13) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
  activerecord (4.1.13) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (4.1.13) lib/abstract_controller/base.rb:136:in `process'
  actionview (4.1.13) lib/action_view/rendering.rb:30:in `process'
  actionpack (4.1.13) lib/action_controller/metal.rb:196:in `dispatch'
  actionpack (4.1.13) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  actionpack (4.1.13) lib/action_controller/metal.rb:232:in `block in action'
  actionpack (4.1.13) lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
  actionpack (4.1.13) lib/action_dispatch/routing/route_set.rb:50:in `call'
  actionpack (4.1.13) lib/action_dispatch/journey/router.rb:73:in `block in call'
  actionpack (4.1.13) lib/action_dispatch/journey/router.rb:59:in `call'
  actionpack (4.1.13) lib/action_dispatch/routing/route_set.rb:692:in `call'
  warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.3) lib/warden/manager.rb:34:in `call'
  rack (1.5.5) lib/rack/etag.rb:23:in `call'
  rack (1.5.5) lib/rack/conditionalget.rb:25:in `call'
  rack (1.5.5) lib/rack/head.rb:11:in `call'
  actionpack (4.1.13) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  actionpack (4.1.13) lib/action_dispatch/middleware/flash.rb:254:in `call'
  rack (1.5.5) lib/rack/session/abstract/id.rb:225:in `context'
  rack (1.5.5) lib/rack/session/abstract/id.rb:220:in `call'
  actionpack (4.1.13) lib/action_dispatch/middleware/cookies.rb:562:in `call'
  activerecord (4.1.13) lib/active_record/query_cache.rb:36:in `call'
  activerecord (4.1.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
  actionpack (4.1.13) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.1.13) lib/active_support/callbacks.rb:82:in `run_callbacks'
  actionpack (4.1.13) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (4.1.13) lib/action_dispatch/middleware/reloader.rb:73:in `call'
  actionpack (4.1.13) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
  rollbar (2.4.0) lib/rollbar/middleware/rails/rollbar.rb:24:in `block in call'
  rollbar (2.4.0) lib/rollbar.rb:842:in `scoped'
  rollbar (2.4.0) lib/rollbar/middleware/rails/rollbar.rb:22:in `call'
  better_errors (2.1.1) lib/better_errors/middleware.rb:84:in `protected_app_call'
  better_errors (2.1.1) lib/better_errors/middleware.rb:79:in `better_errors_call'
  better_errors (2.1.1) lib/better_errors/middleware.rb:57:in `call'
  actionpack (4.1.13) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  rollbar (2.4.0) lib/rollbar/middleware/rails/show_exceptions.rb:22:in `call_with_rollbar'
  actionpack (4.1.13) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.1.13) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.1.13) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.1.13) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.1.13) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.1.13) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.1.13) lib/rails/rack/logger.rb:20:in `call'
  quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets'
  request_store (1.2.0) lib/request_store/middleware.rb:8:in `call'
  actionpack (4.1.13) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.5) lib/rack/runtime.rb:17:in `call'
  activesupport (4.1.13) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
  rack (1.5.5) lib/rack/lock.rb:17:in `call'
  actionpack (4.1.13) lib/action_dispatch/middleware/static.rb:84:in `call'
  rack (1.5.5) lib/rack/sendfile.rb:112:in `call'
  railties (4.1.13) lib/rails/engine.rb:514:in `call'
  railties (4.1.13) lib/rails/application.rb:144:in `call'
  rack (1.5.5) lib/rack/content_length.rb:14:in `call'
  unicorn (4.8.3) lib/unicorn/http_server.rb:576:in `process_client'
  unicorn (4.8.3) lib/unicorn/http_server.rb:670:in `worker_loop'
  unicorn (4.8.3) lib/unicorn/http_server.rb:525:in `spawn_missing_workers'
  unicorn (4.8.3) lib/unicorn/http_server.rb:140:in `start'
  unicorn-rails (1.1.0) lib/unicorn/rails.rb:24:in `run'
  rack (1.5.5) lib/rack/server.rb:264:in `start'
  railties (4.1.13) lib/rails/commands/server.rb:69:in `start'
  railties (4.1.13) lib/rails/commands/commands_tasks.rb:81:in `block in server'
  railties (4.1.13) lib/rails/commands/commands_tasks.rb:76:in `server'
  railties (4.1.13) lib/rails/commands/commands_tasks.rb:40:in `run_command!'
  railties (4.1.13) lib/rails/commands.rb:17:in `<top (required)>'
  bin/rails:4:in `<main>'

Using ruby 2.2.2p95.

nozpheratu commented 9 years ago

My cursory guess is this is some kind of authentication error.

Maybe it's worth pointing out that I disregarded the note in the readme about setting up the .zendesk2.yaml file and instead just opted to pass all the authentication params into the client initializer, not sure if that matters.

nozpheratu commented 9 years ago

Scratch that, I was over-thinking it. The constant is simply out of scope here: https://github.com/lanej/zendesk2/blob/master/lib/zendesk2/client/real.rb#L56

lanej commented 9 years ago

@nozpheratu yanked 1.7.3 and released 1.7.4 with the USER_AGENT fix