Foreman Ansible Roles import

Hello,
I have a problem after the import. The import works. If I then assign this role to a host, an error occurs
Debian 11
Foreman 3.12
ruby-foreman-ansible/plugins,now 7.0.2-1
ansible-core/focal,now 2.12.2-1ppa~focal

No one has any idea what the problem is?

@Ron_Lavi maybe you can help, from the error log it looks like that foreman-vendor.bundle-v10.0.2 in Foreman 3.1.2 doesn’t work with foreman-ansible-7.0.2-1 due to the PF4 paginations updates.

foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292 TypeError: Cannot read properties of undefined (reading 'map')
    at t.preparePerPageOptions (paginationHelper.js:4)
    at v (RolesTable.js:45)
    at Ka (foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292)
    at _l (foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292)
    at cs (foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292)
    at ls (foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292)
    at Jl (foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292)
    at foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
    at t.unstable_runWithPriority (foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:336)
    at Wo (foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292)
el @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
a.componentDidCatch.n.callback @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
pa @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
al @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
fs @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
t.unstable_runWithPriority @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:336
Wo @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
ps @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
Jl @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
(anonymous) @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
t.unstable_runWithPriority @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:336
Wo @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
Go @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
Uo @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
Kl @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
hi @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
Promise.then (async)
onNewData @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
next @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
b @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
y @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
value @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
(anonymous) @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
ce @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
next @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
(anonymous) @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
ce @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
next @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
b @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
y @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
value @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
(anonymous) @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
Promise.then (async)
(anonymous) @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
b @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
y @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
value @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
(anonymous) @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
ce @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
next @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
b @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
y @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
value @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
(anonymous) @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
(anonymous) @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
next @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
b @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
y @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
value @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
(anonymous) @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
Promise.then (async)
(anonymous) @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
e @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
value @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
e.consumeQueue @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
(anonymous) @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
setTimeout (async)
e.scheduleQueueConsumption @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
(anonymous) @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
e @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
value @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
complete @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
t.start @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
t @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
e.getObservableFromLink @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
e.getResultsFromLink @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
h @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
e.fetchQueryByPolicy @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
w @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
e.fetchQueryObservable @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
(anonymous) @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
e.reobserve @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
t.reobserve @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
t.onSubscribe @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
(anonymous) @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
e @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
value @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:389
t.startQuerySubscription @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
t.getExecuteResult @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
t.execute @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
m @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
g @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
y @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:1
fetchFn @ index.js:26
a @ withLoading.js:47
Ka @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
_l @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
cs @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
ls @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
Jl @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
(anonymous) @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
t.unstable_runWithPriority @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:336
Wo @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
Go @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
Uo @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
E @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
Zt @ foreman-vendor.bundle-v10.0.2-production-b143521739869caa8de3.js:292
Show 40 more frames

Should we bump the version of foreman-vendor in foreman-3.1.2?

Hi, if I read this correctly,
it looks like the options that are passed in RolesTable#preparePerPageOptions(usePaginationOptions()); are undefined

I don’t think this is related to "@theforeman/vendor" package as that method is in Foreman: Foreman#PaginationHooks,js

I am not sure what could cause it, maybe if that usePaginationOptions() was declared a line earlier and only then passed as options there was less chance that it would be undefined?
cc @amirfefer

Is there any news or things that you can test yourself?

although it’s fixed in the next version with Foreman 3.2,
I opened a PR to try to fix it in Fixes #34575 - Fix table roles pagination failure by Ron-Lavi · Pull Request #516 · theforeman/foreman_ansible · GitHub
@lstejska could you try to test if it solve the issue?

thnks for this information.

I was looking at the PR and I can’t reproduce the issue [0] on my dev setup neither on the production setup with 3.1.2 branch.

Fixing the issue and releasing it in new foreman-ansible version is going to be rather slow process, so my suggestion would be to update the Foreman to 3.2 version.
It’s not stable yet, but it’s in a release candidate phase now [1] so it could be worth of try.

[0] Fixes #34575 - Fix table roles pagination failure by Ron-Lavi · Pull Request #516 · theforeman/foreman_ansible · GitHub
[1] Foreman :: Manual

1 Like

I have tested it with Debian 11 and Foreman 3.2 a new installation. I have seen what should be changed in the Rolestable. When I do that and restart everything, it still loads all the old ones without the changes.

apt list | grep foreman
foreman-cli/bullseye,now 3.2.0~rc2-1 all [installed]
foreman/bullseye,now 3.2.0~rc2-1 amd64 [installed,automatic]
ruby-foreman-ansible/plugins,now 7.0.2-1 all [installed]

foreman-vendor.bundl…8e4a47165b8a.js:292 TypeError: Cannot read properties of undefined (reading 'map')
    at t.preparePerPageOptions (paginationHelper.js:4)
    at v (RolesTable.js:45)
    at Ka (foreman-vendor.bundl…8e4a47165b8a.js:292)
    at hl (foreman-vendor.bundl…8e4a47165b8a.js:292)
    at sc (foreman-vendor.bundl…8e4a47165b8a.js:292)
    at lc (foreman-vendor.bundl…8e4a47165b8a.js:292)
    at Jl (foreman-vendor.bundl…8e4a47165b8a.js:292)
    at foreman-vendor.bundl…8e4a47165b8a.js:292
    at t.unstable_runWithPriority (foreman-vendor.bundl…8e4a47165b8a.js:336)
    at Hr (foreman-vendor.bundl…8e4a47165b8a.js:292)
el	@