Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't import host to foreman #57

Open
amateo opened this issue Jul 31, 2018 · 7 comments
Open

Can't import host to foreman #57

amateo opened this issue Jul 31, 2018 · 7 comments
Labels

Comments

@amateo
Copy link

amateo commented Jul 31, 2018

I'm trying this plugin.
My puppetdb server is version 5.2.4.
Dashboard is working and puppetdb nodes are displayed, but in this window, I can delete hosts, but I can't import them into foreman. When I try to import a host I get:

Failed to import host from PuppetDB: wrong number of arguments (given 1, expected 2)

I have foreman 1.16.0 and puppetdb plugin installed from packages (version 3.1.2-1).
My configuration is:

@timogoebel
Copy link
Member

@amateo: Thanks. Is there a way you can provide a full stack trace of the error maybe from the logs?

@amateo
Copy link
Author

amateo commented Jul 31, 2018

How can I get it?

@timogoebel
Copy link
Member

@amateo: In /var/log/foreman/production.log

@amateo
Copy link
Author

amateo commented Jul 31, 2018

This is the log while importing node:

2018-07-31T11:00:52 6e0a8699 [app] [I] Started PUT "/puppetdb_foreman/nodes/tapirus20.um.es/import" for 155.54.194.128 at 2018-07-31 11:00:52 +0200
2018-07-31T11:00:52 6e0a8699 [app] [I] Processing by PuppetdbForeman::NodesController#import as HTML
2018-07-31T11:00:52 6e0a8699 [app] [I]   Parameters: {"authenticity_token"=>"qouec2zXJd/NC8sQl2QGb46tWAk0L19pIMdFgYIa8HwaKJZFAXoO9G+rKSJAWwuxhK8uSp/L8FT0ym44gBFh3w==", "id"=>"tapirus20.um.es"}
2018-07-31T11:00:52 6e0a8699 [app] [I] Current user: amateo_adm (administrator)
2018-07-31T11:00:52 6e0a8699 [audit] [I] [tapirus20.um.es] deleted 0 (9.9ms)
2018-07-31T11:00:52 6e0a8699 [audit] [I] [tapirus20.um.es] updated 0 (0.7ms)
2018-07-31T11:00:54 6e0a8699 [audit] [I] [tapirus20.um.es] added 453 (2018.2ms)
2018-07-31T11:00:54 6e0a8699 [app] [I] Import facts for 'tapirus20.um.es' completed. Added: 453, Updated: 0, Deleted 0 facts
2018-07-31T11:00:57 6e0a8699 [app] [I] Redirected to https://foremantest.um.es/puppetdb_foreman/nodes
2018-07-31T11:00:57 6e0a8699 [app] [I] Completed 302 Found in 5072ms (ActiveRecord: 2822.3ms)
2018-07-31T11:00:57 c45bc55c [app] [I] Started GET "/notification_recipients" for 155.54.194.128 at 2018-07-31 11:00:57 +0200
2018-07-31T11:00:57 c45bc55c [app] [I] Processing by NotificationRecipientsController#index as JSON
2018-07-31T11:00:57 c45bc55c [app] [I] Current user: amateo_adm (administrator)
2018-07-31T11:00:57 c45bc55c [app] [I] Completed 200 OK in 5ms (Views: 0.1ms | ActiveRecord: 3.5ms)
2018-07-31T11:00:57 26f526d1 [app] [I] Started GET "/puppetdb_foreman/nodes" for 155.54.194.128 at 2018-07-31 11:00:57 +0200
2018-07-31T11:00:57 26f526d1 [app] [I] Processing by PuppetdbForeman::NodesController#index as HTML
2018-07-31T11:00:57 26f526d1 [app] [I] Current user: amateo_adm (administrator)
2018-07-31T11:00:57 26f526d1 [app] [I]   Rendered vendor/ruby/2.3.0/gems/puppetdb_foreman-3.1.2/app/views/puppetdb_foreman/nodes/index.html.erb within layouts/application (570.5ms)
2018-07-31T11:00:57 26f526d1 [app] [I]   Rendered layouts/_application_content.html.erb (0.4ms)
2018-07-31T11:00:57 26f526d1 [app] [I]   Rendered home/_user_dropdown.html.erb (1.6ms)
2018-07-31T11:00:57 26f526d1 [app] [I] Read fragment views/tabs_and_title_records-4 (0.1ms)
2018-07-31T11:00:57 26f526d1 [app] [I]   Rendered home/_topbar.html.erb (3.1ms)
2018-07-31T11:00:57 26f526d1 [app] [I]   Rendered layouts/base.html.erb (4.5ms)
2018-07-31T11:00:57 26f526d1 [app] [I] Completed 200 OK in 646ms (Views: 583.8ms | ActiveRecord: 10.8ms)
2018-07-31T11:00:58 a9638c57 [app] [I] Started GET "/javascripts/locale/en/app.js" for 155.54.194.128 at 2018-07-31 11:00:58 +0200
2018-07-31T11:00:58 a9638c57 [app] [F] 
 | ActionController::RoutingError (No route matches [GET] "/javascripts/locale/en/app.js"):
 |   lib/middleware/tagged_logging.rb:18:in `call'
 | 
 | 
2018-07-31T11:00:58 67caadd9 [app] [I] Started GET "/notification_recipients" for 155.54.194.128 at 2018-07-31 11:00:58 +0200
2018-07-31T11:00:58 67caadd9 [app] [I] Processing by NotificationRecipientsController#index as JSON
2018-07-31T11:00:58 67caadd9 [app] [I] Current user: amateo_adm (administrator)
2018-07-31T11:00:58 67caadd9 [app] [I] Completed 200 OK in 5ms (Views: 0.1ms | ActiveRecord: 3.5ms)

@amateo
Copy link
Author

amateo commented Jul 31, 2018

It seems the node has been imported, and I can see it now in foreman.

@timogoebel timogoebel added the bug label Jul 31, 2018
@timogoebel
Copy link
Member

@amateo: I see, we should improve logging in the plugin so that we can actually find out what is wrong.

@LeandroSalvas
Copy link

I am having this same issue. I can import only one host to Foreman, and I noticed that the "certname" is always "puppet" instead the real certname.
I changed it directly on database, and I could add another, but it is imported as "puppet".
What can I do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants