Closed carolyncole closed 7 years ago
updated the configurations to allow for information to be gathered on production from google analytics. The directory and the private key configured were wrong.
Now there is another error undefined method `sufia__pageview' for #
At this point the following is running from the rails console:
importer = Sufia::UserStatImporter.new(verbose: true, delay_secs: 1.0)
importer.import
Why the rake task is still not running is mysterious. Will need to dig into that tomorrow.
Is the method not being defined from here: https://github.com/psu-stewardship/scholarsphere/blob/develop/lib/tasks/scholarsphere/stats.rake#L11
We are only allowed 10,000 queries to the reporting API per day.
rake scholarsphere:stats:user_stats exited with a non-zero status. WARNING: Use strings for Figaro configuration. false was converted to "false". DEPRECATION WARNING: The configuration option' Tasks: TOP => sufia:stats:user_stats (See full trace by running task with --trace) 2017-06-09 03:00:22 -0400 (26368) Sufia::UserStatImporter: Begin import of User stats. 2017-06-09 03:00:40 -0400 (26368) ActiveFedora: loading fedora config from /opt/heracles/deploy/scholarsphere/releases/20170605152656/config/fedora.yml 2017-06-09 03:00:40 -0400 (26368) ActiveFedora: loading solr config from /opt/heracles/deploy/scholarsphere/releases/20170605152656/config/solr.yml 2017-06-09 03:00:49 -0400 (26368) Attempted to init base path
config.serve_static_assets
has been renamed toconfig.serve_static_files
to clarify its role (it merely enables serving everything in thepublic
folder and is unrelated to the asset pipeline). Theserve_static_assets
alias will be removed in Rails 5.0. Please migrate your configuration files accordingly. (called from block in <top (required)> at /opt/heracles/deploy/scholarsphere/releases/20170605152656/config/environments/production.rb:50) rake aborted! NoMethodError: undefined methodeach' for true:TrueClass /opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.3.0/bundler/gems/sufia-603e8fc8bd4f/app/services/sufia/user_stat_importer.rb:120:in
tally_results' /opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.3.0/bundler/gems/sufia-603e8fc8bd4f/app/services/sufia/user_stat_importer.rb:53:inblock in process_files' /opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.3.0/bundler/gems/sufia-603e8fc8bd4f/app/services/sufia/user_stat_importer.rb:50:in
each' /opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.3.0/bundler/gems/sufia-603e8fc8bd4f/app/services/sufia/user_stat_importer.rb:50:inprocess_files' /opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.3.0/bundler/gems/sufia-603e8fc8bd4f/app/services/sufia/user_stat_importer.rb:30:in
block in import' /opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.3.0/bundler/gems/sufia-603e8fc8bd4f/app/services/sufia/user_stat_importer.rb:23:ineach' /opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.3.0/bundler/gems/sufia-603e8fc8bd4f/app/services/sufia/user_stat_importer.rb:23:in
import' /opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.3.0/bundler/gems/sufia-603e8fc8bd4f/tasks/stats_tasks.rake:6:inblock (3 levels) in <top (required)>' /opt/heracles/deploy/scholarsphere/shared/bundle/ruby/2.3.0/gems/rake-12.0.0/exe/rake:27:in
<top (required)>' /opt/heracles/deploy/.rbenv/versions/2.3.3/bin/bundle:22:inload' /opt/heracles/deploy/.rbenv/versions/2.3.3/bin/bundle:22:in
prod
, but it already exists 2017-06-09 03:00:49 -0400 (26368) Sufia::UserStatImporter: Retried FileViewStat on #<struct Struct::UserRecord id=1720, user_key="yft5050", last_stats_update=Sun, 24 Mar 2013 00:00:00 +0000> for file 12j62s508f too many times. 2017-06-09 03:00:49 -0400 (26368) Sufia::UserStatImporter: Last exception Private key file for Google analytics was expected at '/scholarsphere/config_production_new/scholarsphere/ga-privatekey.p12', but no file was found.