Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 326677 - GSoC 2010 Rails apps: council, recruiting
Summary: GSoC 2010 Rails apps: council, recruiting
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Infrastructure
Classification: Unclassified
Component: Other web server issues (show other bugs)
Hardware: All Linux
: High normal with 1 vote (vote)
Assignee: Gentoo Infrastructure
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: jbartosik
  Show dependency tree
 
Reported: 2010-07-02 20:52 UTC by Petteri Räty (RETIRED)
Modified: 2011-02-17 13:21 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
A simple script to restart rails application running on passenger. (restart.sh,650 bytes, text/plain)
2010-11-09 18:46 UTC, Joachim Bartosik (RETIRED)
Details
20101127T1002Z-gentoo.recruiting-fix-Gemfile.patch (20101127T1002Z-gentoo.recruiting-fix-Gemfile.patch,2.45 KB, patch)
2010-11-27 10:03 UTC, Robin Johnson
Details | Diff
20101127T1002Z-gentoo.recruiting-fix-dryml.patch (20101127T1002Z-gentoo.recruiting-fix-dryml.patch,668 bytes, patch)
2010-11-27 10:04 UTC, Robin Johnson
Details | Diff
rack_test_rails-2.3.8_compat.rb (rack_test_rails-2.3.8_compat.rb,549 bytes, text/plain)
2011-01-06 18:42 UTC, Petteri Räty (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petteri Räty (RETIRED) gentoo-dev 2010-07-02 20:52:11 UTC
For two GSoC projects we need rails hosting if we want to run the projects on Gentoo infrastructure.

> To get things started, a bug should be opened.  Ideally there would be a
> tree-quality ebuild for the code with all the deps listed.  If there are
> deps like LDAP access, this should be noted in the bug.  Hopefully this
> is enough to get your student started.

We don't have any standard for installing rails applications through gems so tree quality would require a lot of thinking.

20:45 <@Betelgeuse> robbat2|na: What kind of an ebuild do you expect?
20:46 <@Betelgeuse> I'll open a general bug at least for noe.
20:47 <@robbat2|na> Betelgeuse, ebuilds for the gem deps, no usage of config.gem in environment.rb. if there's a Capfile for deploying his app itself (incl pulling a tag from Git), that would be great
20:47 <@robbat2|na> config.gem makes a mess of things, it calls gem install manually and installs stuff itself :-(
20:48 <@Betelgeuse> robbat2|na: not unless you ask it to
20:48 <@robbat2|na> or tries to anyway, failing when it doesn't have root
20:48 <@robbat2|na> if you want gem:build to compile stuff that's in vendor/gems/, you get all the gem install for other config.gems too
20:49 <@Betelgeuse> robbat2|na: we might switch to bundler
20:49 <@robbat2|na> Betelgeuse, that would be better, it supports installing to a local dir
20:49 <@robbat2|na> bbiab
20:50 <@Betelgeuse> robbat2|na: we can work off system gems

If we want to work off ebuilds only then we need to package gems like Hobo. If bundler is acceptable then we can use the local copies it maintains until stuff is properly packaged and in stable.
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-07-02 22:10:45 UTC
Bundler is good as it makes sure that NOTHING gets installed outside the application, except by emerge or direct cfengine.

Capistrano or somebody for ease of deployment of the application itself. Something that works off tags in the repo of the app basically.

Related questions:
What servers are being used? mod_rails, thin, mongrel, something else?
What database needs?
Comment 2 Petteri Räty (RETIRED) gentoo-dev 2010-07-03 06:41:07 UTC
(In reply to comment #1)
> 
> Capistrano or somebody for ease of deployment of the application itself.
> Something that works off tags in the repo of the app basically.
> 

We do public demos on Heroku meaning so far for deployment only git has been enough. Maybe we could have something similar?

> Related questions:
> What servers are being used? mod_rails, thin, mongrel, something else?

On Heroku there's thin but I don't think we have any specific requirements for server. Whatever works for you. Thin could be future proofer in the sense that if there's ever a need to do asynchronous stuff there's already support in thin.

One extra daemon we need to be running is delayed_job for scheduling emails to the future. It can be started with rakes jobs:work but do you need an init script wrapper for that?

> What database needs?
> 

Heroku uses PostgreSQL but we have been keeping code database agnostic (I think locally most use SQLite). I prefer PostgreSQL myself as that's what I am usually working with.
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-07-04 01:45:13 UTC
(In reply to comment #2)
> We do public demos on Heroku meaning so far for deployment only git has been
> enough. Maybe we could have something similar?
Will have to see later on when it's time.

> > Related questions:
> > What servers are being used? mod_rails, thin, mongrel, something else?
> On Heroku there's thin but I don't think we have any specific requirements for
> server. Whatever works for you. Thin could be future proofer in the sense that
> if there's ever a need to do asynchronous stuff there's already support in
> thin.
One problem I have a lot of them is that the separate daemon+proxy model leads to unused processes eating memory when there isn't any demand for the site. mod_rails would just mean more memory in the Apache. For my work stuff, we run thin, but it leaks memory horribly, I was actually hoping you had better ideas here than I did.

> One extra daemon we need to be running is delayed_job for scheduling emails to
> the future. It can be started with rakes jobs:work but do you need an init
> script wrapper for that?
Does it actually need a daemon, or can it just be a cronjob? Either is doable, cronjob is probably more maintainable.

> > What database needs?
> Heroku uses PostgreSQL but we have been keeping code database agnostic (I think
> locally most use SQLite). I prefer PostgreSQL myself as that's what I am
> usually working with.
Hmm, Postgres deploy may be a possibility, however MySQL-5.1 is already available in the environment I was going to have it deployed in.
Comment 4 Petteri Räty (RETIRED) gentoo-dev 2010-07-04 17:53:21 UTC
(In reply to comment #3)
>
> Does it actually need a daemon, or can it just be a cronjob? Either is doable,
> cronjob is probably more maintainable.
> 

I don't think it has cron support out of the box but it shouldn't be much work to create it. I would like the cronjob to be launched quite frequently as it can send email as a result of user actions and would be nice to get those out as fast as possible instead of daily.

>
> Hmm, Postgres deploy may be a possibility, however MySQL-5.1 is already
> available in the environment I was going to have it deployed in.
> 

I am not against MySQL as long as I don't have to touch it. Hopefully it can handle the sub queries we have in a couple places.
Comment 5 Hans de Graaff gentoo-dev Security 2010-07-05 05:47:28 UTC
(In reply to comment #3)

> One problem I have a lot of them is that the separate daemon+proxy model leads
> to unused processes eating memory when there isn't any demand for the site.
> mod_rails would just mean more memory in the Apache. For my work stuff, we run
> thin, but it leaks memory horribly, I was actually hoping you had better ideas
> here than I did.

When you say mod_rails, do you really mean passenger? We're using that for our production servers and it seems to work fine, and it can be configured to only start processes when needed so the overhead for apache overall won't be that large.
Comment 6 Petteri Räty (RETIRED) gentoo-dev 2010-07-12 10:16:32 UTC
We will also require support for incoming emails. Will we have a dedicated Postfix and domain for this so passing the messages locally with ./script/runner is enough or will we add support for getting them in through HTTP?
Comment 7 Joachim Bartosik (RETIRED) gentoo-dev 2010-08-06 19:29:00 UTC
Hello,
GSoC is ending soon so I have some of questions about tests and preparations I should make (in brackets what I think answer is after reading discussion until now):
 - Application works with MySQL(5.1.46) database now, is that what is in production environment, or should I check for some different version?
 - How it will be put on the server (ebuild, git push)?
 - What server will run application (passenger)?
 - How will it receive emails?
 - How should application install gems(bundler)?
 - What about delayed_job (run as cron job)?

Comment 8 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-08-06 19:33:34 UTC
(In reply to comment #7)
> Hello,
> GSoC is ending soon so I have some of questions about tests and preparations I
> should make (in brackets what I think answer is after reading discussion until
> now):
>  - Application works with MySQL(5.1.46) database now, is that what is in
> production environment, or should I check for some different version?
5.0 might be present on the OSL DB if we use that initially, but there should be extremely little difference relevant to you.

>  - How it will be put on the server (ebuild, git push)?
Git for now, long term would prefer ebuild.

>  - What server will run application (passenger)?
passenger, help wanted with any apache config bits for running your app.

>  - How will it receive emails?
I can deliver to a maildir or pipe mails into a script as received, whichever is your preference.

>  - How should application install gems(bundler)?
bundler, so that they are local only, and NOT system-wide.

>  - What about delayed_job (run as cron job)?
cronjob. please provide a cron.d suitable spec (we'll substitute the correct username).

Comment 9 Joachim Bartosik (RETIRED) gentoo-dev 2010-08-29 13:15:25 UTC
(In reply to comment #8)
> (In reply to comment #7)
> >  - Application works with MySQL(5.1.46) database now, is that what is in
> > production environment, or should I check for some different version?
> 5.0 might be present on the OSL DB if we use that initially, but there should
> be extremely little difference relevant to you.

Ack :)
 
> >  - How it will be put on the server (ebuild, git push)?
> Git for now, long term would prefer ebuild.

Do you have anything ready or shall I prepare something?
 
> >  - What server will run application (passenger)?
> passenger, help wanted with any apache config bits for running your app.

I had no problems running my application with passenger. I:
- Emerged apache  and passenger.
- Added "-D PASSENGER" to APACHE2_OPTS in /etc/conf.d/apache2.
- Created copy of sources in /var/www/localhost/htdocs/gra .
- Did some reuired configuration.
- Set DocumentRoot "/var/www/localhost/htdocs/gra/public" for defaulut vhost.
- Restared apache.
- Saw it work.

I didn't do any extensive testing but it seems to work fine.
 
> >  - How will it receive emails?
> I can deliver to a maildir or pipe mails into a script as received, whichever
> is your preference.

I'll make a simple script to handle them.
 
> >  - How should application install gems(bundler)?
> bundler, so that they are local only, and NOT system-wide.

Ack and WIP.
 
> >  - What about delayed_job (run as cron job)?
> cronjob. please provide a cron.d suitable spec (we'll substitute the correct
> username).

Ack.
Comment 10 Joachim Bartosik (RETIRED) gentoo-dev 2010-11-09 18:46:42 UTC
Created attachment 253769 [details]
A simple script to restart rails application running on passenger.

First (and only) parameter is directory of application to restart. It will default to current directory.

It will exit with status 0 and output nothing if everything goes well. It will exit with status 1 and output some message to std error if somethings goes wrong.
Comment 11 Joachim Bartosik (RETIRED) gentoo-dev 2010-11-09 21:15:40 UTC
To give emails to the application pipe it to

curl -F 'email=<-' http://localhost:3000/users/receive_email

Now application doesn't accept emails if they don't come from 127.0.0.1 . Delayed jobs code isn't accepted yet but probably you'll have to do

cd /application/directory && rake jobs:work

Please let me know if it's enough to get the app running on Gentoo infrastructure.
Comment 12 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-11-24 20:49:10 UTC
Just responding here since I got Joachim's email prod.
- You said Bundler was WIP still. What's the status on that?
- Present Rails version on infra boxes is 2.3.8, is that suitable? Any other non-Bundler packages you need installed in the system?
- Is there anything for automated deploys, failing that, can I have an explicitly list of setup instructions for the Rails side of the app, esp Rake or manual tasks to setup your database.
- For passenger The only thing I need is any specific Apache config lines you need.
Comment 13 Petteri Räty (RETIRED) gentoo-dev 2010-11-26 11:58:56 UTC
(In reply to comment #12)
> Just responding here since I got Joachim's email prod.
> - You said Bundler was WIP still. What's the status on that?

It's in:
http://git.overlays.gentoo.org/gitweb/?p=proj/recruiting-webapp.git;a=summary

> - Present Rails version on infra boxes is 2.3.8, is that suitable? Any other
> non-Bundler packages you need installed in the system?

In my other projects I skipped versions 2.3.6-2.3.9 because I was unable to get my test suites working. Now it's again working with 2.3.10. I am not entirely sure at what point the issues got fixed. If the recruiting web app test suite works with 2.3.8 then we could use that.
Comment 14 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-11-27 00:26:56 UTC
(In reply to comment #13)
> my test suites working. Now it's again working with 2.3.10. I am not entirely
> sure at what point the issues got fixed. If the recruiting web app test suite
> works with 2.3.8 then we could use that.
Ok, I fired up the bundle stuff now. I'll pass a patch shortly for changing your Gemfile to use Rails 2.3.8 & Rack 1.1.0

Other issues:
- Where are your migrations?

And Passenger is crashing for your app:
[Sat Nov 27 00:25:12 2010] [notice] Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8n Phusion_Passenger/2.2.15 configured -- resuming normal operations
[ pid=15954 file=ext/apache2/Hooks.cpp:749 time=2010-11-27 00:25:13.413 ]:
  Unexpected error in mod_passenger: The ApplicationPool server unexpectedly closed the connection while we're reading a response for the 'get' command.
  Backtrace:
     (backtrace support disabled during compile time)

[Sat Nov 27 00:25:14 2010] [notice] child pid 15949 exit signal Segmentation fault (11)
Comment 15 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-11-27 09:51:04 UTC
graaff helped me debug passenger, we had to upgrade to 3.0.0-r1 to get it going.

However now there is a ActionView::TemplateError you need to fix.

Processing FrontController#index (for CENSORED at 2010-11-27 09:48:01) [GET]
Rendering front/index
  DRYML: Compiled vendor/bundle/ruby/1.8/gems/hobo-1.0.1/taglibs/core.dryml in 0.02s
  DRYML: Compiled vendor/bundle/ruby/1.8/gems/hobo-1.0.1/taglibs/rapid_core.dryml in 0.38s
  DRYML: Compiled vendor/bundle/ruby/1.8/gems/hobo-1.0.1/taglibs/rapid_support.dryml in 0.01s
  DRYML: Compiled vendor/bundle/ruby/1.8/gems/hobo-1.0.1/taglibs/rapid_document_tags.dryml in 0.12s
  DRYML: Compiled vendor/bundle/ruby/1.8/gems/hobo-1.0.1/taglibs/rapid_pages.dryml in 0.31s
  DRYML: Compiled vendor/bundle/ruby/1.8/gems/hobo-1.0.1/taglibs/rapid_editing.dryml in 0.06s
  DRYML: Compiled vendor/bundle/ruby/1.8/gems/hobo-1.0.1/taglibs/rapid_forms.dryml in 0.48s
  DRYML: Compiled vendor/bundle/ruby/1.8/gems/hobo-1.0.1/taglibs/rapid_navigation.dryml in 0.16s
  DRYML: Compiled vendor/bundle/ruby/1.8/gems/hobo-1.0.1/taglibs/rapid_plus.dryml in 0.19s
  DRYML: Compiled vendor/bundle/ruby/1.8/gems/hobo-1.0.1/taglibs/rapid_generics.dryml in 0.14s
  DRYML: Compiled vendor/bundle/ruby/1.8/gems/hobo-1.0.1/taglibs/rapid_lifecycles.dryml in 0.01s
  DRYML: Compiled vendor/bundle/ruby/1.8/gems/hobo-1.0.1/taglibs/rapid_summary.dryml in 0.22s
  DRYML: Compiled vendor/bundle/ruby/1.8/gems/hobo-1.0.1/taglibs/rapid_user_pages.dryml in 0.35s
  DRYML: Compiled vendor/bundle/ruby/1.8/gems/hobo-1.0.1/taglibs/rapid.dryml in 2.45s

ActionView::TemplateError (No such taglib: /var/www/recruiting.gentoo.org/htdocs/app/views {:type=>:include, :src=>"taglibs/auto/rapid/cards", :template_dir=>"app/views/taglibs"} /var/www/recruiting.gentoo.org/htdocs/app/views/taglibs/auto/rapid/cards.dryml) in app/views/front/index.dryml:

    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/taglib.rb:45:in `taglib_filename'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/taglib.rb:12:in `get'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/dryml_builder.rb:121:in `import_taglib'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/dryml_builder.rb:94:in `build'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/dryml_builder.rb:78:in `each'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/dryml_builder.rb:78:in `build'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/template.rb:73:in `compile'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/taglib.rb:91:in `load'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/taglib.rb:53:in `initialize'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/taglib.rb:17:in `new'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/taglib.rb:17:in `get'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/dryml_builder.rb:121:in `import_taglib'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/dryml_builder.rb:76:in `build'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/dryml_builder.rb:76:in `each'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/dryml_builder.rb:76:in `build'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/template.rb:73:in `compile'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml.rb:173:in `compile_renderer_class'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml.rb:159:in `make_renderer_class'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml.rb:112:in `page_renderer'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml.rb:78:in `page_renderer_for_template'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/template_handler.rb:19:in `render_for_rails22'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/template_handler.rb:142:in `render_dryml'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_view/base.rb:306:in `with_template'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/template_handler.rb:138:in `render_dryml'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/template_handler.rb:106:in `render'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_view/template.rb:205:in `render_template'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_view/base.rb:265:in `render'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:1250:in `render_for_file_without_dryml'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/dryml/template_handler.rb:83:in `render_for_file'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:936:in `render_without_benchmark'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/benchmarking.rb:51:in `render'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/benchmarking.rb:51:in `render'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:1326:in `default_render'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:1332:in `perform_action_without_filters'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/filters.rb:617:in `call_filters'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/filters.rb:638:in `run_before_filters'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/controller.rb:23:in `call'
    vendor/bundle/ruby/1.8/gems/hobo-1.0.1/lib/hobo/controller.rb:23:in `included_in_class'
    vendor/bundle/ruby/1.8/gems/activesupport-2.3.8/lib/active_support/callbacks.rb:182:in `call'
    vendor/bundle/ruby/1.8/gems/activesupport-2.3.8/lib/active_support/callbacks.rb:182:in `evaluate_method'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/filters.rb:184:in `call'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/filters.rb:635:in `run_before_filters'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/filters.rb:615:in `call_filters'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/flash.rb:151:in `perform_action'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:532:in `send'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:532:in `process_without_filters'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/filters.rb:606:in `process'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:391:in `process'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:386:in `call'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:438:in `call'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:87:in `dispatch'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:121:in `_call'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
    vendor/bundle/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:29:in `call'
    vendor/bundle/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:29:in `call'
    vendor/bundle/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
    vendor/bundle/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:9:in `cache'
    vendor/bundle/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:28:in `call'
    vendor/bundle/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/string_coercion.rb:25:in `call'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/params_parser.rb:15:in `call'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/session/cookie_store.rb:99:in `call'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/failsafe.rb:26:in `call'
    vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:106:in `call'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/rack/request_handler.rb:96:in `process_request'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/classic_rails/application_spawner.rb:275:in `send'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/classic_rails/application_spawner.rb:275:in `handle_spawn_application'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/utils.rb:479:in `safe_fork'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/abstract_server.rb:357:in `__send__'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/abstract_server.rb:180:in `start'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/abstract_server.rb:357:in `__send__'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
    /usr/lib64/ruby/site_ruby/1.8/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
    /usr/share/phusion-passenger/helper-scripts/passenger-spawn-server:99

Rendering /var/www/recruiting.gentoo.org/htdocs/public/500.html (500 Internal Server Error)
Comment 16 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-11-27 09:59:32 UTC
- Doing sed 's,/auto/rapid,,g'  in app/views/taglibs/application.dryml, and the application sort of comes up. I say sort of because there are a LOT of pages that serve nothing at all.
- Running "rake prepare" repeatedly loses the entire database.
- Signup is broken:
ActionView::TemplateError (undefined method `signup_page' for #<ActionView::Base:0x37e2843fdb0>) on line #1 of app/views/users/signup.dryml:
Comment 17 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-11-27 10:03:46 UTC
Created attachment 255559 [details, diff]
20101127T1002Z-gentoo.recruiting-fix-Gemfile.patch
Comment 18 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-11-27 10:04:00 UTC
Created attachment 255561 [details, diff]
20101127T1002Z-gentoo.recruiting-fix-dryml.patch
Comment 19 Joachim Bartosik (RETIRED) gentoo-dev 2010-11-27 11:20:19 UTC
The script I attached should do almost everything that's needed to [re]start application, but I missed one bit: you should run 

    rake hobo:generate_taglibs

before starting application. The script will not update database. I'll update the the script latyer today. We don't keep migrations because

    ./script/generate hobo_migration

can generate migration from currently used schema to a new one (based on models used in application). If there is nothing in the DB you can use

    rake db:schema:load
Comment 20 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-11-27 11:32:35 UTC
Comment on attachment 255561 [details, diff]
20101127T1002Z-gentoo.recruiting-fix-dryml.patch

Not needed with new rake task
Comment 21 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-11-27 11:36:45 UTC
Ok, it's temporarily up on.
https://recruiting.gentoo.org/
With the hobo:generate_taglibs task, I don't get any more blank pages.

I'm going to move it to another host tomorrow probably (and data in the DB will be moved as well).

I'm not familar w/ Hobo. So if I wanted to add an index, instead of just adding a migration, I'd directly modify db/schema.rb?
Comment 22 Petteri Räty (RETIRED) gentoo-dev 2010-12-02 15:33:15 UTC
(In reply to comment #21)
> 
> I'm not familar w/ Hobo. So if I wanted to add an index, instead of just adding
> a migration, I'd directly modify db/schema.rb?
> 

Now that we are starting to go to production I think we should commit an initial migration generated with ./script/generate hobo_migration and then update the production database with migrations like it's usually done with rails applications. I will push a commit for this later today.
Comment 23 Petteri Räty (RETIRED) gentoo-dev 2010-12-02 15:35:02 UTC
(In reply to comment #21)
> 
> I'm not familar w/ Hobo. So if I wanted to add an index, instead of just adding
> a migration, I'd directly modify db/schema.rb?
> 

If you want to add an index please take a look at:
http://cookbook.hobocentral.net/manual/hobofields/migration_generator

Basically the indexes (at least the basic ones that Hobo supports) are declared in the models and then we can automatically created the migrations creating the indexes from the models.
Comment 24 Joachim Bartosik (RETIRED) gentoo-dev 2010-12-20 15:38:59 UTC
I think code of application for recruiters in [0] is ready to use.

One commit[1] waits for review but it is only an update of bundle.lock.  

[0] http://git.overlays.gentoo.org/gitweb/?p=proj/recruiting-webapp.git
[1] https://github.com/ahenobarbi/Gentoo-Recruiters-App/commit/f192df6c889b499fad5d85f7c0081e9ba8f6df14
Comment 25 Joachim Bartosik (RETIRED) gentoo-dev 2011-01-06 18:22:26 UTC
With Rails 2.3.8 a lot of automated tests of recruiters application fail. The application seems to work fine. Maybe Rails 2.3.8 only breaks tests but I think it's safer to use Rails 2.3.5. Is using that version possible?
Comment 26 Petteri Räty (RETIRED) gentoo-dev 2011-01-06 18:42:51 UTC
Created attachment 259089 [details]
rack_test_rails-2.3.8_compat.rb

(In reply to comment #25)
> With Rails 2.3.8 a lot of automated tests of recruiters application fail. The
> application seems to work fine. Maybe Rails 2.3.8 only breaks tests but I think
> it's safer to use Rails 2.3.5. Is using that version possible?
> 

You can try this initializer. But yes releases since 2.3.5 have been quite problematic. I did eventually get one of my apps migrated to 2.3.10.
Comment 27 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-01-06 22:02:01 UTC
I want to run both recruiting and glsamaker2 on the same machine. glsamaker2 needs Rails 2.3.8. Ergo one of the apps needs to change. Either recruiters => 2.3.8 or glsamaker2 => 2.3.5.
Comment 28 Joachim Bartosik (RETIRED) gentoo-dev 2011-01-06 23:31:04 UTC
Robin says there are good reasons to use the same version of rails for all applications running on one box so Recruiters Application should use 2.3.8. 

Apparently application works fine with Rails 2.3.8, only test are broken so maybe we'll start using it (while I'm fixing tests)?
Comment 29 Joachim Bartosik (RETIRED) gentoo-dev 2011-01-06 23:32:14 UTC
The initializer Petteri suggested doesn't solve the problem.
Comment 30 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-01-07 00:36:47 UTC
(In reply to comment #28)
> Apparently application works fine with Rails 2.3.8, only test are broken so
> maybe we'll start using it (while I'm fixing tests)?
Ok, I'm fairly certain it's JUST the tests that are broken. The flash isn't appearing at all...

diff --git a/features/approve_answers.feature b/features/approve_answers.feature
index a4a9185..21dee74 100644
--- a/features/approve_answers.feature
+++ b/features/approve_answers.feature
...
-    Then I should see "Changes to the answer were saved" within ".flash.notice"
+    Then I should see "Changes to the answer were saved"
...
-    Then I should see "Changes to the answer were saved" within ".flash.notice"
+    Then I should see "Changes to the answer were saved

(::) failed steps (::)

expected the following element's content to include "Changes to the answer were saved":
Answer : Gentoo Recruiters App
    Logged in as mentor
        Account
        Log out
    Gentoo Recruiters App
    Search
    Search Resultsclose
     
    Home
    Question Categories
    Question Groups
    Suggest Questions
                Answer 1
            Approved
            recruit1
                Edit Answer
    Answer of recruit1 for question "q1"
    (Edit)
    Question:
    fake
    Answer:
    Approved
    fake
    (Not Available)
      No comments to display
    Comment this answer
    var hoboParts = {};var pluralisations = {question_category: 'question_categories', user_category: 'user_categories'}; urlBase = ''; hoboPagePath = 'answers/show'
 (Spec::Expectations::ExpectationNotMetError)
./features/step_definitions/web_steps.rb:145:in `/^(?:|I )should see "([^\"]*)"$/'
features/approve_answers.feature:16:in `Then I should see "Changes to the answer were saved"'

Failing Scenarios:
cucumber features/approve_answers.feature:6 # Scenario: Mentor approves and then disapproves text answer of his/her recruit
Comment 31 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-01-07 00:43:10 UTC
The OpenID test is even more telling. The block for 'When I follow "Log out"' is NOT logging out.

diff --git a/features/openid.feature b/features/openid.feature
index 71de6d5..63ffe74 100644
--- a/features/openid.feature
+++ b/features/openid.feature
@@ -16,8 +16,12 @@ Feature: OpenID
     And I press "Save"
     Then I should see "Changes to your account were saved" within ".flash.notice"
 
+    # I should be on the homepage, logged in
     When I follow "Log out"
-    And I follow "Log in"
+    Then I should see "You have logged out"
+
+    # I should be on the homepage, not logged in
+    When I follow "Log in"
     And I follow "log in using openID"
     And I fill in "login" with "https://example.com/id"
     And I press "Log in"

==== end of patch
$  rake cucumber:ok  RAILS_ENV=test FEATURE=features/openid.feature
(::) failed steps (::)

expected the following element's content to include "You have logged out":
Home : Gentoo Recruiters App
    Logged in as Example name
        Account
        Log out
    Gentoo Recruiters App
    Search
    Search Resultsclose
     
    Home
    Question Categories
    Question Groups
    Suggest Questions
  Welcome, Example name.
      Your current role is: recruit,
      view your profile.
          You answered all multiple choice questions, correctly.
    var hoboParts = {};var pluralisations = {question_category: 'question_categories', user_category: 'user_categories'}; urlBase = ''; hoboPagePath = 'front/index'
 (Spec::Expectations::ExpectationNotMetError)
./features/step_definitions/web_steps.rb:145:in `/^(?:|I )should see "([^\"]*)"$/'
features/openid.feature:21:in `Then I should see "You have logged out"'

Failing Scenarios:
cucumber features/openid.feature:5 # Scenario: Use OpenID to register and login
Comment 32 Petteri Räty (RETIRED) gentoo-dev 2011-01-07 08:26:59 UTC
(In reply to comment #27)
> I want to run both recruiting and glsamaker2 on the same machine. glsamaker2
> needs Rails 2.3.8. Ergo one of the apps needs to change. Either recruiters =>
> 2.3.8 or glsamaker2 => 2.3.5.
> 

You can run two apps on the same machine using different rails versions. What are the downsides to this?
Comment 33 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-01-07 08:34:51 UTC
The slot is 2.3. Anyway, see the rest of my comments here, looks like a bug explicitly when running under webrat that some links/buttons don't get followed.
Comment 34 Petteri Räty (RETIRED) gentoo-dev 2011-01-07 08:42:35 UTC
(In reply to comment #33)
> The slot is 2.3. Anyway, see the rest of my comments here, looks like a bug
> explicitly when running under webrat that some links/buttons don't get
> followed.
> 

Yes 2.3.8 is very buggy. Cookies don't work properly with rack-test.
Comment 35 Petteri Räty (RETIRED) gentoo-dev 2011-01-07 08:43:31 UTC
(In reply to comment #33)
> The slot is 2.3. Anyway, see the rest of my comments here, looks like a bug
> explicitly when running under webrat that some links/buttons don't get
> followed.
> 

The recruiting app could use a bundler installed private copy. You need some bundler installed gems any way as not everything is in Portage.
Comment 36 Hans de Graaff gentoo-dev Security 2011-01-07 09:10:37 UTC
My advice would be to use either 2.3.5 or 2.3.10. I would already have marked 2.3.10 stable if it were not for problems further down the dependency chain. 2.3.8 should be removed asap but it's waiting for a keywording bug.
Comment 37 Joachim Bartosik (RETIRED) gentoo-dev 2011-01-07 17:20:18 UTC
Gist [0] made cucumber tests work with rails 2.3.8. There are two commits in rails_2.3.8 branch [1] that make cucumber tests pass.

[0] https://gist.github.com/431811
[1] https://github.com/ahenobarbi/Gentoo-Recruiters-App/tree/rails_2.3.8
Comment 38 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-02-16 22:28:21 UTC
Your changes are already deployed. I don't see what's blocking for me on the recruiting app. Just go and use it already.

rake results:
70 scenarios (70 passed)
541 steps (541 passed)
2m12.498s

Where is the council app and it's deployment instructions? All of the answers here have been generic or for the recruiting app.
Comment 39 Petteri Räty (RETIRED) gentoo-dev 2011-02-17 10:05:09 UTC
(In reply to comment #38)
> 
> Where is the council app and it's deployment instructions? All of the answers
> here have been generic or for the recruiting app.
> 

That project didn't product anything that should be taken into use right now. I think we can close this bug for now and then I can open new bugs if something new needs to be handled.
Comment 40 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-02-17 13:21:29 UTC
Closing bug then.