Can't import Puppet classes after update

It seems like the Foreman app itself isn’t running if I’m interpreting that output correctly. Can you do a foreman-maintain service restart and try the rake task again?

I didn’t mention it, but I have already restarted foreman service after editing the rake task. (And just tried again right now)
In my opinion it’s the task which is not able to handle the katello check_ping because when running manually a hammer ping everything is ok:

# hammer ping
database:
    Status:          ok
    Server Response: Duration: 2ms
candlepin:
    Status:          ok
    Server Response: Duration: 23ms
candlepin_events:
    Status:          ok
    message:         0 Processed, 0 Failed
    Server Response: Duration: 0ms
candlepin_auth:
    Status:          ok
    Server Response: Duration: 21ms
katello_events:
    Status:          ok
    message:         0 Processed, 0 Failed
    Server Response: Duration: 0ms
pulp:
    Status:          ok
    Server Response: Duration: 75ms
pulp_auth:
    Status:          ok
    Server Response: Duration: 45ms
pulp3:
    Status:          ok
    Server Response: Duration: 43ms
foreman_tasks:
    Status:          ok
    Server Response: Duration: 4ms

I think we were talking about the correct_puppet_environments task, so although the thread you found spoke about pulp3_content_switchover what you should have done was (also) modify the former rake task. Sorry if I’ve misinterpreted as this thread is speaking about a number of issues!

Yes I have been trying many thigs to solve my problem
It seemed to me that the problem was up to the reimport.rake task because of this line in the error log

So I tried to do the trick in the reimport.rake

But with no luck until now…