Help creating a foreman plugin 2

I wasn't sure if I should add my issue to the other thread or create a new
one so this one is called #2 to make it easier to find in a search. (I hope)

On a fresh VM install of Ubuntu 14.04 and a fresh install of foreman 1.8
(dev environment), when I run the commands from 'How to create a foreman
plugin' I get this error after the 'bundle install' and subsequent
'service apache2 restart'.

some permissions were not found (ArgumentError)
/usr/share/foreman/app/models/role.rb:131:in add_permissions' /usr/share/foreman/app/models/role.rb:146:inadd_permissions!'
/usr/share/foreman/app/services/foreman/plugin.rb:198:in `block in role'

/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in
`transaction'

/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/transactions.rb:208:in
transaction' /usr/share/foreman/app/services/foreman/plugin.rb:196:inrole'
/home/emanners/git/my_plugin/lib/my_plugin/engine.rb:27:in block (2 levels) in <class:Engine>' /usr/share/foreman/app/services/foreman/plugin.rb:62:ininstance_eval'
/usr/share/foreman/app/services/foreman/plugin.rb:62:in register' /home/emanners/git/my_plugin/lib/my_plugin/engine.rb:18:inblock in
<class:Engine>'

/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/initializable.rb:30:in
`instance_exec'

/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/initializable.rb:30:in
`run'

/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/initializable.rb:55:in
`block in run_initializers'

/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/initializable.rb:54:in
`each'

/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/initializable.rb:54:in
`run_initializers'

/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/application.rb:136:in
`initialize!'

/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/railtie/configurable.rb:30:in
method_missing&#39; /usr/share/foreman/config/environment.rb:12:in<top (required)>'
config.ru:3:in require&#39; config.ru:3:inblock in <main>'

/usr/share/foreman/vendor/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in
`instance_eval'

/usr/share/foreman/vendor/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in
initialize&#39; config.ru:1:innew'
config.ru:1:in &lt;main&gt;&#39; /usr/share/passenger/helper-scripts/rack-preloader.rb:112:ineval'
/usr/share/passenger/helper-scripts/rack-preloader.rb:112:in preload_app&#39; /usr/share/passenger/helper-scripts/rack-preloader.rb:158:in<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in
&lt;module:PhusionPassenger&gt;&#39; /usr/share/passenger/helper-scripts/rack-preloader.rb:28:in<main>'

> I wasn't sure if I should add my issue to the other thread or create a new
> one so this one is called #2 to make it easier to find in a search. (I hope)
>
> On a fresh VM install of Ubuntu 14.04 and a fresh install of foreman 1.8
> (dev environment), when I run the commands from 'How to create a foreman
> plugin' I get this error after the 'bundle install' and subsequent
> 'service apache2 restart'.
>
> some permissions were not found (ArgumentError)
> /usr/share/foreman/app/models/role.rb:131:in add_permissions&#39; &gt; /usr/share/foreman/app/models/role.rb:146:inadd_permissions!'
> /usr/share/foreman/app/services/foreman/plugin.rb:198:in `block in role'

>
> /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in
> transaction&#39; &gt; &gt; /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/transactions.rb:208:in &gt;transaction'
> /usr/share/foreman/app/services/foreman/plugin.rb:196:in role&#39; &gt; /home/emanners/git/my_plugin/lib/my_plugin/engine.rb:27:inblock (2
> levels) in <class:Engine>'

You'll probably have to customzie the engine.rb. If it's just the
default after running rename.rb you probably have a line like this on
27:

role "ForemanMyPlugin", [:view_my_plugin]

The error is telling you that :view_my_plugin permission doesn't exist,
which should've been created just a few lines above. That might help
narrow down the problem, but we'd really have to see the code to help
more.

(You might also get more help on the developer mailing list http://groups.google.com/group/foreman-dev).

··· On Mon, May 18, 2015 at 02:04:13PM -0700, Edson Manners wrote:

/usr/share/foreman/app/services/foreman/plugin.rb:62:in instance_eval' /usr/share/foreman/app/services/foreman/plugin.rb:62:inregister’
/home/emanners/git/my_plugin/lib/my_plugin/engine.rb:18:in `block in
class:Engine

/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/initializable.rb:30:in
`instance_exec’

/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/initializable.rb:30:in
`run’

/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/initializable.rb:55:in
`block in run_initializers’

/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/initializable.rb:54:in
`each’

/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/initializable.rb:54:in
`run_initializers’

/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/application.rb:136:in
`initialize!’

/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/railtie/configurable.rb:30:in
method_missing' /usr/share/foreman/config/environment.rb:12:in<top (required)>'
config.ru:3:in require' config.ru:3:inblock in ’

/usr/share/foreman/vendor/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in
`instance_eval’

/usr/share/foreman/vendor/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in
initialize' config.ru:1:innew’
config.ru:1:in <main>' /usr/share/passenger/helper-scripts/rack-preloader.rb:112:ineval’
/usr/share/passenger/helper-scripts/rack-preloader.rb:112:in preload_app' /usr/share/passenger/helper-scripts/rack-preloader.rb:158:inmodule:App
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in
<module:PhusionPassenger>' /usr/share/passenger/helper-scripts/rack-preloader.rb:28:in


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Best Regards,

Stephen Benjamin
Red Hat Engineering

Thanks Stephen. I'll move to the foreman-dev group.

··· On Monday, May 18, 2015 at 5:36:40 PM UTC-4, stephen wrote: > > On Mon, May 18, 2015 at 02:04:13PM -0700, Edson Manners wrote: > > I wasn't sure if I should add my issue to the other thread or create a > new > > one so this one is called #2 to make it easier to find in a search. (I > hope) > > > > On a fresh VM install of Ubuntu 14.04 and a fresh install of foreman 1.8 > > (dev environment), when I run the commands from 'How to create a foreman > > plugin' I get this error after the 'bundle install' and subsequent > > 'service apache2 restart'. > > > > some permissions were not found (ArgumentError) > > /usr/share/foreman/app/models/role.rb:131:in `add_permissions' > > /usr/share/foreman/app/models/role.rb:146:in `add_permissions!' > > /usr/share/foreman/app/services/foreman/plugin.rb:198:in `block in > role' > > > > > > > /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in > > > `transaction' > > > > > /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/transactions.rb:208:in > > > `transaction' > > /usr/share/foreman/app/services/foreman/plugin.rb:196:in `role' > > /home/emanners/git/my_plugin/lib/my_plugin/engine.rb:27:in `block (2 > > levels) in ' > > You'll probably have to customzie the engine.rb. If it's just the > default after running rename.rb you probably have a line like this on > 27: > > role "ForemanMyPlugin", [:view_my_plugin] > > The error is telling you that :view_my_plugin permission doesn't exist, > which should've been created just a few lines above. That might help > narrow down the problem, but we'd really have to see the code to help > more. > > (You might also get more help on the developer mailing list > http://groups.google.com/group/foreman-dev). > > > > > /usr/share/foreman/app/services/foreman/plugin.rb:62:in > `instance_eval' > > /usr/share/foreman/app/services/foreman/plugin.rb:62:in `register' > > /home/emanners/git/my_plugin/lib/my_plugin/engine.rb:18:in `block in > > ' > > > > > /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/initializable.rb:30:in > > > `instance_exec' > > > > > /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/initializable.rb:30:in > > > `run' > > > > > /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/initializable.rb:55:in > > > `block in run_initializers' > > > > > /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/initializable.rb:54:in > > > `each' > > > > > /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/initializable.rb:54:in > > > `run_initializers' > > > > > /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/application.rb:136:in > > > `initialize!' > > > > > /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.2.21/lib/rails/railtie/configurable.rb:30:in > > > `method_missing' > > /usr/share/foreman/config/environment.rb:12:in `' > > config.ru:3:in `require' > > config.ru:3:in `block in ' > > > > > /usr/share/foreman/vendor/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in > > > `instance_eval' > > > > > /usr/share/foreman/vendor/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in > > > `initialize' > > config.ru:1:in `new' > > config.ru:1:in `' > > /usr/share/passenger/helper-scripts/rack-preloader.rb:112:in `eval' > > /usr/share/passenger/helper-scripts/rack-preloader.rb:112:in > `preload_app' > > /usr/share/passenger/helper-scripts/rack-preloader.rb:158:in > > `' > > /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in > > `' > > /usr/share/passenger/helper-scripts/rack-preloader.rb:28:in `' > > > > -- > > You received this message because you are subscribed to the Google > Groups "Foreman users" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to foreman-user...@googlegroups.com . > > To post to this group, send email to forema...@googlegroups.com > . > > Visit this group at http://groups.google.com/group/foreman-users. > > For more options, visit https://groups.google.com/d/optout. > > > -- > Best Regards, > > Stephen Benjamin > Red Hat Engineering >