Undefined method upstream_authentication_token

When trying to create a new repository, I receive the following error:
undefined method `upstream_authentication_token=’ for #Katello::RootRepository:0x000000001685f6e0 Did you mean? upstream_authentication_token upstream_authentication_token_in_db

Foreman version3.0.0 Katello 4.2.1
I was able to add repositories previously. Have not updated since last repo creation. Everything shows up and operational and everything else seems to be working normally.

I suspect there isn’t if you haven’t updated, but are there any pending migrations?

1 Like

No,
[root[TEST]@test-foreman scripts]# foreman-rake katello:upgrade_check
This script makes no modifications and can be re-run multiple times for the most up to date results.
Checking upgradeability…

Checking for running tasks…
[SUCCESS] - There are 0 active tasks.
You may proceed with the upgrade.

Can you try running foreman-rake db:migrate, then restarting foreman and dynflow services?

Okay, ran that command, seemed to be okay but no change. Here is the output:
[root[TEST]@test-foreman scripts]# hammer ping
database:
Status: ok
Server Response: Duration: 0ms
candlepin:
Status: ok
Server Response: Duration: 445ms
candlepin_auth:
Status: ok
Server Response: Duration: 75ms
candlepin_events:
Status: ok
message: 0 Processed, 0 Failed
Server Response: Duration: 0ms
katello_events:
Status: ok
message: 0 Processed, 0 Failed
Server Response: Duration: 0ms
pulp3:
Status: ok
Server Response: Duration: 388ms
foreman_tasks:
Status: ok
Server Response: Duration: 7ms

[root[TEST]@test-foreman scripts]# foreman-rake db:migrate
== 20210831161843 AddUpstreamAuthTokenToRootRepository: migrating =============
– add_column(:katello_root_repositories, :upstream_authentication_token, :string, {:limit=>1024})
→ 0.0073s
== 20210831161843 AddUpstreamAuthTokenToRootRepository: migrated (0.0075s) ====

== 20211112130803 CleanupEnvironmentFromCoreTables: migrating =================
– column_exists?(:hostgroups, :environment_id)
→ 0.0063s
– column_exists?(:hosts, :environment_id)
→ 0.0054s
== 20211112130803 CleanupEnvironmentFromCoreTables: migrated (0.0306s) ========

[root[TEST]@test-foreman scripts]# foreman-maintain service stop
Running Stop Services

Check if command is run as root user: [OK]

Stop applicable services:

Stopping the following service(s):
rh-redis5-redis, postgresql, pulpcore-api, pulpcore-content, rh-redis5-redis, pulpcore-api.socket, pulpcore-content.socket, pulpcore-worker@1.service, pulpcore-worker@2.service, pulpcore-worker@3.service, pulpcore-worker@4.service, pulpcore-worker@5.service, pulpcore-worker@6.service, pulpcore-worker@7.service, pulpcore-worker@8.service, tomcat, dynflow-sidekiq@orchestrator, httpd, puppetserver, dynflow-sidekiq@worker-1, dynflow-sidekiq@worker-hosts-queue-1, foreman-proxy
\ stopping pulpcore-content.socket
Warning: postgresql.service changed on disk. Run ‘systemctl daemon-reload’ to reload units.

All services stopped [OK]

[root[TEST]@test-foreman scripts]# foreman-maintain service start
Running Start Services

Check if command is run as root user: [OK]

Start applicable services:

Starting the following service(s):
rh-redis5-redis, postgresql, pulpcore-api, pulpcore-content, rh-redis5-redis, pulpcore-worker@1.service, pulpcore-worker@2.service, pulpcore-worker@3.service, pulpcore-worker@4.service, pulpcore-worker@5.service, pulpcore-worker@6.service, pulpcore-worker@7.service, pulpcore-worker@8.service, tomcat, dynflow-sidekiq@orchestrator, httpd, puppetserver, dynflow-sidekiq@worker-1, dynflow-sidekiq@worker-hosts-queue-1, foreman-proxy
\ starting rh-redis5-redis
Warning: postgresql.service changed on disk. Run ‘systemctl daemon-reload’ to reload units.
/ All services started [OK]

[root[TEST]@test-foreman scripts]# hammer ping
database:
Status: ok
Server Response: Duration: 0ms
candlepin:
Status: ok
Server Response: Duration: 431ms
candlepin_auth:
Status: ok
Server Response: Duration: 69ms
candlepin_events:
Status: ok
message: 0 Processed, 0 Failed
Server Response: Duration: 0ms
katello_events:
Status: ok
message: 0 Processed, 0 Failed
Server Response: Duration: 1ms
pulp3:
Status: ok
Server Response: Duration: 487ms
foreman_tasks:
Status: ok
Server Response: Duration: 11ms

[root[TEST]@test-foreman scripts]#

Here is the current error:
undefined method `upstream_authentication_token=’ for #Katello::RootRepository:0x00007fdd80510b20 Did you mean? upstream_authentication_token upstream_authentication_token_in_db

Could you try restarting foreman specfically? systemctl restart foreman

Okay, different result:
Task dae9baa2-149f-4021-b5b8-51a37bdaf6a0: Katello::Errors::CandlepinError: An unexpected exception occurred while scheduling job “RegenEnvEntitlementCertsJob”

@apscism is there a corresponding stack trace for that error in /var/log/candlepin/candlepin.log of /var/log/candlepin/error.log ? Searching those files for “RegenEnvEntitlementCertsJob” should locate it. Please share here

Actually, another Foreman restart seems to have corrected the issue. I was able to create a repository for CentOS 7 and syncing now. Thank you guys for the help.

1 Like