jywarren / plots2

The Public Lab website!
http://publiclab.org
GNU General Public License v3.0
17 stars 2 forks source link

Fresh setup errors #226

Closed amaaov closed 10 years ago

amaaov commented 10 years ago

I did successfully bundle and db:merge, but got errors then.

First of all this (for any page):

ActionView::Template::Error (undefined method `title' for nil:NilClass):
    15:   <h4>Recent wiki edits</h4>
    16:   <ul class="nav wikis bullet">
    17:     <% @wikis.each do |wiki| %>
    18:       <li><a href="<%= wiki.path %>"><i class="icon-book"></i> <%= wiki.latest.title %></a> <small style="col
or:#888;">updated <%= time_ago_in_words(wiki.updated_at) %> ago by <a href="/profile/<%= wiki.latest.author.name %>">
<%= wiki.latest.author.name %></a></small></li>
    19:     <% end %>
    20:   </ul>
    21:   <% end %>
  app/views/sidebar/_user.html.erb:18:in `block in _app_views_sidebar__user_html_erb__144073595141957407_31812520'
  app/views/sidebar/_user.html.erb:17:in `each'
  app/views/sidebar/_user.html.erb:17:in `_app_views_sidebar__user_html_erb__144073595141957407_31812520'
  app/views/home/dashboard.html.erb:1:in `_app_views_home_dashboard_html_erb__2278537300766379777_31777100'

I tried to fix previous error and got this when I tried to create new wiki page:

ActiveRecord::StatementInvalid (Mysql2::Error: Table 'plots_production.node_access' doesn't exist: SHOW FIELDS FROM `node_access`):
  app/models/drupal_node.rb:118:in `new'
  app/models/drupal_node.rb:118:in `create_access'
  app/models/drupal_node.rb:89:in `setup'
  app/models/drupal_node.rb:527:in `block in new_wiki'
  app/models/drupal_node.rb:526:in `new_wiki'
  app/controllers/wiki_controller.rb:66:in `create'
jywarren commented 10 years ago

ah - i think this is because you have no data in your database! Try making a first post at /post

We've never "cold-started" this project, as it was built on an existing database. But it's not a bad idea to retrofit it to make that possible, and would make it easier for new contributors to get involved.

You may also have to create a new user... at /signup

On Thu, Feb 27, 2014 at 1:27 PM, Andrey notifications@github.com wrote:

I did successfully bundle and db:merge, but got errors then.

First of all this (for any page): ActionView::Template::Error (undefined method title' for nil:NilClass): 15:

Recent wiki edits

16: 21: <% end %> app/views/sidebar/_user.html.erb:18:inblock in app views_sidebaruser_html_erb144073595141957407_31812520' app/views/sidebar/ _user.html.erb:17:in `each' app/views/sidebar/_user.html.erb:17:in _app_views_sidebaruser_html_erb144073595141957407_31812520' app/views/home/dashboard.html.erb:1:inapp views_home_dashboard_html_erb__2278537300766379777_31777100'

I tried to fix previous error and got this when I tried to create new wiki page: ActiveRecord::StatementInvalid (Mysql2::Error: Table 'plots_production.node_access' doesn't exist: SHOW FIELDS FROM node_access ): app/models/drupal_node.rb:118:in new' app/models/drupal_node.rb:118:increate_access' app/models/drupal_node.rb:89:in setup' app/models/drupal_node.rb:527:inblock in new_wiki' app/models/drupal_node.rb:526:in new_wiki' app/controllers/wiki_controller.rb:66:increate'

Reply to this email directly or view it on GitHubhttps://github.com/jywarren/plots2/issues/226 .

jywarren commented 10 years ago

Oh, also, we are starting to use https://github.com/publiclab/plots2/ as our primary repository and issue tracker.

On Thu, Feb 27, 2014 at 1:29 PM, Jeffrey Warren jeff@unterbahn.com wrote:

ah - i think this is because you have no data in your database! Try making a first post at /post

We've never "cold-started" this project, as it was built on an existing database. But it's not a bad idea to retrofit it to make that possible, and would make it easier for new contributors to get involved.

You may also have to create a new user... at /signup

On Thu, Feb 27, 2014 at 1:27 PM, Andrey notifications@github.com wrote:

I did successfully bundle and db:merge, but got errors then.

First of all this (for any page): ActionView::Template::Error (undefined method title' for nil:NilClass): 15:

Recent wiki edits

16: 21: <% end %> app/views/sidebar/_user.html.erb:18:inblock in app views_sidebaruser_html_erb144073595141957407_31812520' app/views/sidebar/ _user.html.erb:17:in `each' app/views/sidebar/_user.html.erb:17:in _app_views_sidebaruser_html_erb144073595141957407_31812520' app/views/home/dashboard.html.erb:1:inapp views_home_dashboard_html_erb__2278537300766379777_31777100'

I tried to fix previous error and got this when I tried to create new wiki page: ActiveRecord::StatementInvalid (Mysql2::Error: Table 'plots_production.node_access' doesn't exist: SHOW FIELDS FROM node_access): app/models/drupal_node.rb:118:in new' app/models/drupal_node.rb:118:increate_access' app/models/drupal_node.rb:89:in setup' app/models/drupal_node.rb:527:inblock in new_wiki' app/models/drupal_node.rb:526:in new_wiki' app/controllers/wiki_controller.rb:66:increate'

Reply to this email directly or view it on GitHubhttps://github.com/jywarren/plots2/issues/226 .

amaaov commented 10 years ago

The same stuff happens:

ActiveRecord::StatementInvalid (Mysql2::Error: Table 'plots_production.node_access' doesn't exist: SHOW FIELDS FROM `node_access`):
  app/models/drupal_node.rb:118:in `new'
  app/models/drupal_node.rb:118:in `create_access'
  app/models/drupal_node.rb:89:in `setup'
  app/models/drupal_node.rb:490:in `block in new_note'
  app/models/drupal_node.rb:489:in `new_note'
  app/controllers/notes_controller.rb:59:in `create'
amaaov commented 10 years ago

@jywarren okay, got the idea of new repo, thanks! Anyways, here's database-related issue (some migrations missing?).

jywarren commented 10 years ago

I guess, before we go down this rabbit hole.... are you more interested in getting the code running and working on it, or are you potentially interested in helping to get the codebase functional from an empty database, which has its own benefits but also challenges? If the former, I can probably send you a dummy database to work with, to skip this all.

On Thu, Feb 27, 2014 at 1:35 PM, Andrey notifications@github.com wrote:

The same stuff happens:

ActiveRecord::StatementInvalid (Mysql2::Error: Table 'plots_production.node_access' doesn't exist: SHOW FIELDS FROM node_access): app/models/drupal_node.rb:118:in new' app/models/drupal_node.rb:118:increate_access' app/models/drupal_node.rb:89:in setup' app/models/drupal_node.rb:490:inblock in new_note' app/models/drupal_node.rb:489:in new_note' app/controllers/notes_controller.rb:59:increate'

Reply to this email directly or view it on GitHubhttps://github.com/jywarren/plots2/issues/226#issuecomment-36274906 .

amaaov commented 10 years ago

I am interested in both deals. (: Well, you are welcome: please send me schemas here: xdersd@gmail.com

jywarren commented 10 years ago

Let me check with some of the other devs about cleaning out user data of an old db so we can send it to you. Are you on the plots-dev list? I'm going to email them there if you want to listen in.

On Thu, Feb 27, 2014 at 1:48 PM, Andrey notifications@github.com wrote:

I am interested in both deals. (: Well, you are welcome: please send me schemas here: xdersd@gmail.com

Reply to this email directly or view it on GitHubhttps://github.com/jywarren/plots2/issues/226#issuecomment-36276383 .

amaaov commented 10 years ago

I am not on the plots-dev list.

jywarren commented 10 years ago

I posted here: https://groups.google.com/forum/#!topic/plots-dev/b5tycGqtckA we'll see! Thanks!

re: the error you got, is there a schema entry for the "node_access" table?

amaaov commented 10 years ago

No schema for table node_access, as well as I can't find any migrations related to this table.

amaaov commented 10 years ago

@jywarren any news here?

jywarren commented 10 years ago

Sorry, I'm traveling; will check in later today but the schema.rb should have this... I'll re commit my current schema. On Mar 3, 2014 8:35 AM, "Andrey" notifications@github.com wrote:

@jywarren https://github.com/jywarren any news here?

Reply to this email directly or view it on GitHubhttps://github.com/jywarren/plots2/issues/226#issuecomment-36510045 .

jywarren commented 10 years ago

Huh, odd -- can you check that your db/schema.rb has these lines?

https://github.com/publiclab/plots2/blob/master/db/schema.rb#L1263

I think it's likely that the migrations did not run completely. Can you try flushing your database and re-running rake db:migrate?

amaaov commented 10 years ago

No such lines, ugh! I should check out new repo. Thanks!

amaaov commented 10 years ago

Also, I got stuck on gem geokit-rails3, it's better to use gem 'geokit-rails', and then no errors. (:

amaaov commented 10 years ago

Evenmore, publiclab/plots2 has duplicate columns lat and lon in migrations, that I tried to fix here, please check it out.

amaaov commented 10 years ago

So, there's no such table node_access in migrations as it is said above.

$ RAILS_ENV=production bundle exec rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
==  AddProfileTags: migrating =================================================
-- create_table(:tags)
   -> 0.0075s
==  AddProfileTags: migrated (0.0078s) ========================================

==  CreateRusers: migrating ===================================================
-- create_table(:rusers)
   -> 0.0078s
==  CreateRusers: migrated (0.0080s) ==========================================

==  AddOpenidIdentifierToUsers: migrating =====================================
-- add_column(:rusers, :openid_identifier, :string)
   -> 0.0074s
==  AddOpenidIdentifierToUsers: migrated (0.0076s) ============================

==  AddSessionsTable: migrating ===============================================
-- create_table(:rsessions)
   -> 0.0048s
-- add_index(:rsessions, :session_id)
   -> 0.0131s
-- add_index(:rsessions, :updated_at)
   -> 0.0107s
==  AddSessionsTable: migrated (0.0292s) ======================================

==  CreateImages: migrating ===================================================
-- create_table(:images)
   -> 0.0060s
==  CreateImages: migrated (0.0063s) ==========================================

==  CreateLikeAndFollow: migrating ============================================
-- create_table(:tagselections, {:id=>false})
   -> 0.0029s
-- add_index(:tagselections, [:user_id, :tid], {:unique=>true})
   -> 0.0101s
-- create_table(:userselections, {:id=>false})
   -> 0.0036s
-- add_index(:userselections, [:self_id, :other_id], {:unique=>true})
   -> 0.0093s
-- create_table(:nodeselections, {:id=>false})
   -> 0.0057s
-- add_index(:nodeselections, [:user_id, :nid], {:unique=>true})
   -> 0.0090s
-- change_table(:node)
   -> 0.0048s
==  CreateLikeAndFollow: migrated (0.0462s) ===================================

==  RenameLikeAndFollow: migrating ============================================
-- remove_index(:nodeselections, [:user_id, :nid])
   -> 0.0066s
-- drop_table(:nodeselections)
   -> 0.0012s
-- remove_index(:userselections, [:self_id, :other_id])
   -> 0.0066s
-- drop_table(:userselections)
   -> 0.0018s
-- remove_index(:tagselections, [:user_id, :tid])
   -> 0.0081s
-- drop_table(:tagselections)
   -> 0.0028s
-- create_table(:tag_selections, {:id=>false})
   -> 0.0056s
-- add_index(:tag_selections, [:user_id, :tid], {:unique=>true})
   -> 0.0126s
-- create_table(:user_selections, {:id=>false})
   -> 0.0070s
-- add_index(:user_selections, [:self_id, :other_id], {:unique=>true})
   -> 0.0133s
-- create_table(:node_selections, {:id=>false})
   -> 0.0066s
-- add_index(:node_selections, [:user_id, :nid], {:unique=>true})
   -> 0.0147s
==  RenameLikeAndFollow: migrated (0.0884s) ===================================

==  SyncRuserIdDrupalUsersUid: migrating ======================================
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
==  SyncRuserIdDrupalUsersUid: migrated (0.1755s) =============================

==  AddRoles: migrating =======================================================
-- add_column(:rusers, :role, :string, {:default=>"basic"})
   -> 0.0205s
==  AddRoles: migrated (0.0212s) ==============================================

==  AddResetKey: migrating ====================================================
-- add_column(:rusers, :reset_key, :string, {:default=>nil})
   -> 0.0115s
==  AddResetKey: migrated (0.0118s) ===========================================

==  AddMapAuthorship: migrating ===============================================
-- add_column(:content_type_map, :authorship, :string, {:default=>nil})
   -> 0.0041s
==  AddMapAuthorship: migrated (0.0044s) ======================================

** Invoke db:_dump (first_time)
** Execute db:_dump
** Invoke db:schema:dump (first_time)
** Invoke environment 
** Invoke db:load_config 
** Execute db:schema:dump
mysql> SHOW TABLES;
+-----------------------------+
| Tables_in_plots_production  |
+-----------------------------+
| comments                    |
| community_tags              |
| content_field_bbox          |
| content_field_image_gallery |
| content_field_main_image    |
| content_field_map           |
| content_field_map_editor    |
| content_field_mappers       |
| content_group               |
| content_group_fields        |
| content_node_field          |
| content_node_field_instance |
| content_type_map            |
| content_type_note           |
| content_type_page           |
| content_type_place          |
| content_type_report         |
| content_type_tool           |
| context                     |
| files                       |
| images                      |
| node                        |
| node_counter                |
| node_images                 |
| node_revisions              |
| node_selections             |
| rsessions                   |
| rusers                      |
| schema_migrations           |
| tag_selections              |
| tags                        |
| term_data                   |
| term_node                   |
| url_alias                   |
| user_selections             |
| users                       |
+-----------------------------+
36 rows in set (0.01 sec)
amaaov commented 10 years ago

Well, I pushed a fix in main repo.

So, I've got new error while registering new person in system:

NameError (uninitialized constant SCrypt):
  app/controllers/users_controller.rb:14:in `new'
  app/controllers/users_controller.rb:14:in `create'
jywarren commented 10 years ago

I'll be on a train soon and can take a look... I think that since we started with an existing database, we never properly wrote the initial migration. schema.rb is in a similar format and is the current database state (as far as Rails is aware) so it could be used as a basis for a revised initial migration. Maybe the first migration does not actually set up many of the tables original to Drupal.

The crypt thing may be an OpenID related gem dependency. Does Googling indicate which gem includes that class?

Its great that you're taking the time to unravel this. I'll see about cleaning out a database if I have time on the train today but attacking both problems is great. On Mar 3, 2014 4:12 PM, "Andrey" notifications@github.com wrote:

Well, I pushed a fix in main repo.

So, I've got new error while registering new person in system:

NameError (uninitialized constant SCrypt): app/controllers/users_controller.rb:14:in new' app/controllers/users_controller.rb:14:increate'

Reply to this email directly or view it on GitHubhttps://github.com/jywarren/plots2/issues/226#issuecomment-36560253 .

amaaov commented 10 years ago

It's gem 'scrypt'.

amaaov commented 10 years ago

Finally, I can create wiki page, can register user! Yep!

amaaov commented 10 years ago

Sent you new migration according error that I got. Tested.

amaaov commented 10 years ago

So it works, but still some errors. I will try to make full migrations according data you gave me, I did it partially. (:

amaaov commented 10 years ago

Also got this:

Started GET "/about" for 212.109.6.119 at 2014-03-10 06:12:36 -0400
Processing by WikiController#root as HTML
  Parameters: {"id"=>"about"}
Completed 500 Internal Server Error in 2ms

NoMethodError (undefined method `latest' for nil:NilClass):
  app/controllers/wiki_controller.rb:159:in `root'
Started GET "/subscribe/tag/near-infrared-camera" for 212.109.6.119 at 2014-03-10 06:19:40 -0400
Processing by SubscriptionController#add as HTML
  Parameters: {"type"=>"tag", "name"=>"near-infrared-camera"}
Completed 500 Internal Server Error in 16ms

NoMethodError (undefined method `tid' for nil:NilClass):
  app/controllers/subscription_controller.rb:37:in `add'
amaaov commented 10 years ago

More and more! :)

Started GET "/research" for 212.109.6.119 at 2014-03-15 13:49:05 -0400
Processing by NotesController#index as HTML
  Rendered sidebar/_post_button.html.erb (28.3ms)
  Rendered sidebar/_user.html.erb (52.5ms)
  Rendered notes/index.html.erb within layouts/application (53.2ms)
Completed 500 Internal Server Error in 57ms

ActionView::Template::Error (undefined method `title' for nil:NilClass):
    17:   <h4>Recent wiki edits</h4>
    18:   <ul class="nav wikis bullet">
    19:     <% @wikis.each do |wiki| %>
    20:       <li><a href="<%= wiki.path %>"><i class="icon-book"></i> <%= wiki.latest.title %></a> <small style="color:#888;">updated <%= time_ago_in_words(wiki.updated_at) %> ago by <a href="/profile/<%= wiki.latest.author.name %>"><%= wiki.latest.author.name %></a></small></li>
    21:     <% end %>
    22:   </ul>
    23:   <% end %>
  app/views/sidebar/_user.html.erb:20:in `block in _app_views_sidebar__user_html_erb___2493863059314736432_43408300'
  app/views/sidebar/_user.html.erb:19:in `each'
  app/views/sidebar/_user.html.erb:19:in `_app_views_sidebar__user_html_erb___2493863059314736432_43408300'
  app/views/notes/index.html.erb:6:in `_app_views_notes_index_html_erb___1776120668482006370_49375620'
jywarren commented 10 years ago

So i believe this is resolved due to contributions (seed file) by sirMackk:

https://github.com/publiclab/plots2/pull/44 https://github.com/jywarren/plots2/pull/229