heroku problem with 1.3

94 views
Skip to first unread message

Mark Sobkowicz

unread,
Jun 1, 2011, 9:27:27 AM6/1/11
to Hobo Users
Steps: Create a new hobo app with RC. Runs fine in development. Using heroku gem, create a new heroku app, and push the new app to heroku. It works, basically, but you get an error on the home page where the admin user is created. This app has some modifications to the user model, but the same thing happens with a brand new empty app created with the generator. Here is some log output:

2011-06-01T13:24:09+00:00 app[web.1]: Started GET "/" for 108.20.187.128 at Wed Jun 01 06:24:09 -0700 2011
2011-06-01T13:24:09+00:00 app[web.1]: Processing by FrontController#index as HTML
2011-06-01T13:24:09+00:00 app[web.1]: Rendered front/index.dryml (116.7ms)
2011-06-01T13:24:09+00:00 app[web.1]: Completed in 136ms
2011-06-01T13:24:09+00:00 app[web.1]:
2011-06-01T13:24:09+00:00 app[web.1]: ActionView::Template::Error (undefined method `name' for nil:NilClass):
2011-06-01T13:24:09+00:00 app[web.1]: 62:
2011-06-01T13:24:09+00:00 app[web.1]: 63: <% if User.count == 0 -%>
2011-06-01T13:24:09+00:00 app[web.1]: 64: <h3 style="margin-top: 20px;">There are no user accounts - please provide the details of the site administrator</h3>
2011-06-01T13:24:09+00:00 app[web.1]: 65: <form with="&this || User.new" without-cancel>
2011-06-01T13:24:09+00:00 app[web.1]: 66: <field-list: fields="first_name, last_name, email_address, password, password_confirmation"/>
2011-06-01T13:24:09+00:00 app[web.1]: 67: <submit: label="Register Administrator"/>
2011-06-01T13:24:09+00:00 app[web.1]: 68: </form>
2011-06-01T13:24:09+00:00 app[web.1]: app/views/taglibs/auto/rapid/forms.dryml:18:in `form__for_user'


I have an app in production on heroku using pre25, so this is a newer problem than that (or I'm just making a mistake that I didn't make then).

Thanks for looking!

Mark


Tiago Franco

unread,
Jun 1, 2011, 10:03:05 AM6/1/11
to hobo...@googlegroups.com
Hi Mark,

Is it possible to take a look at: app/views/taglibs/auto/rapid/forms.dryml ?

TF
On Jun 1, 2011, at 2:27 PM, Mark Sobkowicz wrote:

> app/views/taglibs/auto/rapid/forms.dryml:18:in `form__for_user'

Mark Sobkowicz

unread,
Jun 1, 2011, 10:13:26 AM6/1/11
to hobo...@googlegroups.com
Here is the relevant form, which is auto generated from the user model.


<def tag="form" for="User">
<form merge param="default">
<error-messages param/>
<field-list fields="last_name, first_name, message, email_address, administrator, state" param/>
<div param="actions">
<submit label="#{ht 'user.actions.save', :default=>['Save']}" param/><or-cancel param="cancel"/>
</div>
</form>
</def>

> --
> You received this message because you are subscribed to the Google Groups "Hobo Users" group.
> To post to this group, send email to hobo...@googlegroups.com.
> To unsubscribe from this group, send email to hobousers+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
>

Mark Sobkowicz

unread,
Jun 2, 2011, 5:19:56 PM6/2/11
to hobo...@googlegroups.com
I ended up solving my problem, but I don't understand it. On the hobo generated index page, the form tag is called with:

<form with="&this || User.new" without-cancel>

This works fine in development, but gives an error when deployed to heroku. I changed it to:

<form with="&User.new" without-cancel>

and it worked fine. Any ideas why the first fails? The line is inside <% if User.count == 0 %>, so i don't understand why it says "&this || User.new" anyway. What is "this" supposed to be when the front controller supplies it?

Mark


On Jun 1, 2011, at 10:03 AM, Tiago Franco wrote:

Matt Jones

unread,
Jun 2, 2011, 6:01:28 PM6/2/11
to hobo...@googlegroups.com

On Jun 2, 2011, at 5:19 PM, Mark Sobkowicz wrote:

> I ended up solving my problem, but I don't understand it. On the hobo generated index page, the form tag is called with:
>
> <form with="&this || User.new" without-cancel>
>
> This works fine in development, but gives an error when deployed to heroku. I changed it to:
>
> <form with="&User.new" without-cancel>
>
> and it worked fine. Any ideas why the first fails? The line is inside <% if User.count == 0 %>, so i don't understand why it says "&this || User.new" anyway. What is "this" supposed to be when the front controller supplies it?

Haven't dug around to make sure, but I believe the 'this' part is there so that if the create action fails validation the form can be re-rendered. The weirder part is why "this || User.new" wouldn't work *exactly* the same as "User.new" for the standard front_controller - "this" should be nil at that point...

Can you post a complete backtrace of the error? The most likely suspect is the code in Hobo::Controller::Model, but that doesn't make any sense since it's not supposed to be mixed into a plain hobo_controller...

--Matt

Piotr Stepniak

unread,
Jun 9, 2011, 9:14:24 AM6/9/11
to Hobo Users
Hello!

I am having similar problem.

2011-06-09T12:15:23+00:00 app[web.1]: !! Unexpected error while
processing request: Permission denied - /app/app/views/taglibs/auto/
rapid/cards.dryml
2011-06-09T12:15:23+00:00 heroku[router]: Error H13 (Connection closed
without response) -> GET mobica-staging.heroku.com/ dyno=web.1 queue=
wait= service= bytes=
2011-06-09T12:15:23+00:00 heroku[router]: GET mobica-
staging.heroku.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=4ms
bytes=0
2011-06-09T05:15:24-07:00 heroku[nginx]: GET /favicon.ico HTTP/1.1 |
91.64.48.10 | 251 | http | 200

I just got response for my ticket and here it is:

> caio, Jun-09 05:16 am (PDT):
>
> Hi,
>
>Are you trying to write to that file? You may be running into our read-only filesystem: http://devcenter.heroku.com/articles/ read-only-filesystem
>
> An easy way to test this locally is to chmod the relevant dirs to be read-only.
>
>Hope this helps.


To be honest I have no idea what to do now.

Tim Griffin

unread,
Jun 9, 2011, 10:12:21 AM6/9/11
to hobo...@googlegroups.com
Hi Piotr;

I can draw your attention to this posting in the Hobo Dev group:

https://groups.google.com/d/topic/hobodev/41nldyesE9I/discussion

with a note from DD that reads:

For read only file systems there is a specific config.hobo.read_only_file_system heroku-aware (i.e. it is automatically set to true when the app is started on heroku), that you can also explicitly set in your application.rb or <environment>.rb, that will prevent generation of dryml taglibs and auto generated routes.

Besides the setup_wizard will ask you whether you want git to ignore the auto generated taglibs and routes, because having them checked in will avoid you a manual deploy in heroku apps, so it may be preferred.

Hope that helps.
Tim

Domizio Demichelis

unread,
Jun 9, 2011, 1:14:56 PM6/9/11
to hobo...@googlegroups.com
Tim,
your post certainly helped me, I didn't know that I wrote that :-)

ciao
dd

--
You received this message because you are subscribed to the Google Groups "Hobo Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/hobousers/-/nyUKjvoQgjIJ.

Piotr Stepniak

unread,
Jun 10, 2011, 9:58:36 AM6/10/11
to Hobo Users
Hi Tim,

I am not sure if I understood it correctly or I took it too literally.

I added to my enviroment.rb line
>config.hobo.read_only_file_system heroku-aware
(inside Rails::Initializer.run do |config| section) but I have in my
logs:

2011-06-10T12:59:23+00:00 heroku[web.1]: State changed from up to
bouncing
2011-06-10T12:59:23+00:00 heroku[web.1]: State changed from created to
starting
2011-06-10T05:59:24-07:00 heroku[slugc]: Slug compilation finished
2011-06-10T12:59:26+00:00 heroku[web.1]: Starting process with
command: `thin -p 22080 -e test -R /home/heroku_rack/heroku.ru start`
2011-06-10T12:59:27+00:00 app[web.1]: /app/config/environment.rb:17/
app/.gems/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning:
Gem::Dependency#version_requirements is deprecated and will be removed
on or after August 2010. Use #requirement
2011-06-10T12:59:27+00:00 app[web.1]: : undefined method `hobo' for
#<Rails::Configuration:0x7f41ca559020> (NoMethodError)
2011-06-10T12:59:27+00:00 app[web.1]: from /app/.gems/gems/
rails-2.3.5/lib/initializer.rb:111:in `run'
2011-06-10T12:59:27+00:00 app[web.1]: from /app/config/environment.rb:
9
2011-06-10T12:59:27+00:00 app[web.1]: from /usr/ruby1.8.7/lib/ruby/
site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
2011-06-10T12:59:27+00:00 app[web.1]: from /usr/ruby1.8.7/lib/ruby/
site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
...

I tried to paste this into test/production.rb but it didn't help

Tim Griffin

unread,
Jun 14, 2011, 1:56:15 PM6/14/11
to hobo...@googlegroups.com
Hi Piotr;

I think the line that DD was referring to needs to go in your config/environments/production.rb file as follows;

  config.hobo.read_only_file_system = true

I don't have direct experience with this configuration element, so perhaps DD can comment further.

For the simple experiments I've done on Heroku, I've typically kept my auto-generated taglibs as part of my GIT repository and insured they are are up to date before pushing to Heroku, otherwise Hobo will try to regenerate them (which it can't do in Heroku's read-only file system.)

Tim

Domizio Demichelis

unread,
Jun 14, 2011, 4:32:09 PM6/14/11
to hobo...@googlegroups.com
For the simple experiments I've done on Heroku, I've typically kept my auto-generated taglibs as part of my GIT repository and insured they are are up to date before pushing to Heroku, otherwise Hobo will try to regenerate them (which it can't do in Heroku's read-only file system.)

More or less :-)

You actually don't need to set

   config.hobo.read_only_file_system = true

explicitly anywhere, if your app will run on heroku, because it will be automatically detected and set to true for you. When it is true hobo will not try to generate any file (auto taglibs, and hobo_routes). In that case you have to provide the files to heroku:

a) by including them in your repo (there is an option that you can choose in the setup_wizard that will add the files to the repo) OR
b) uploading them in any other way

ciao
dd

Piotr Stepniak

unread,
Jun 17, 2011, 8:06:13 AM6/17/11
to Hobo Users
Thank you for your responses.
The thing is my app stopped to work after last git push - it seems to
me that heroku changed its configuration (when I redeployed working
version of application it refused to start as newest release).

Anyway, just in case I added the line on the bottom of production.rb
(whole file is pasted below)
# Settings specified here will take precedence over those in config/
environment.rb

# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true

# Full error reports are disabled and caching is turned on
config.action_controller.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.action_view.cache_template_loading = true

# See everything in the log (default is :info)
# config.log_level = :debug

# Use a different logger for distributed setups
# config.logger = SyslogLogger.new

# Use a different cache store in production
# config.cache_store = :mem_cache_store

# Enable serving of images, stylesheets, and javascripts from an asset
server
# config.action_controller.asset_host = "http://assets.example.com"

# Disable delivery errors, bad email addresses will be ignored
config.action_mailer.raise_delivery_errors = false

# Enable threaded mode
# config.threadsafe!

config.hobo.read_only_file_system = true

When it comes to auto-generated taglibs all content of /app/views/
taglibs is already included in git repo.
I don't know where to find hobo_routes ( however there is something
in /vendor/plugins/.../model_router.rb already added to git)

Domizio Demichelis

unread,
Jun 17, 2011, 8:30:51 AM6/17/11
to hobo...@googlegroups.com
you should find hobo_routes.rb. in the same dir of routes.rb

ciao
dd

--
You received this message because you are subscribed to the Google Groups "Hobo Users" group.

Piotr Stepniak

unread,
Jun 17, 2011, 8:53:15 AM6/17/11
to Hobo Users
routes.rb is in config/ with boot.rb, environment.rb, database.yml
and /environments /initializers, /locales

I just noticed thing that may be it - actually application is using
hobo 1.0.1
In meantime I'll try to upgrade it and see if it solves the problem

Domizio Demichelis

unread,
Jun 17, 2011, 8:57:57 AM6/17/11
to hobo...@googlegroups.com
hobo 1.0.1 is a completely different story!
ciao
dd

Reply all
Reply to author
Forward
0 new messages