CanineHQ/canine · error · Portainer::Client::MissingCredentialError
Please add your Portainer API token in the Credentials setti
Error message
Please add your Portainer API token in the Credentials settings.
What it means
Error "Please add your Portainer API token in the Credentials settings." thrown in CanineHQ/canine.
Source
Thrown at lib/portainer/stack.rb:23
def initialize(stack_manager)
@stack_manager = stack_manager
end
# Ugh, this is only used for testing.
def _connect_with_client(client)
@_client = client
self
end
def retrieve_access_token(user, allow_anonymous: false)
if !stack_manager.enable_role_based_access_control && stack_manager.access_token.present?
Portainer::Client::AccessToken.new(stack_manager.access_token)
elsif user.present? && user.stack_manager_access_token(stack_manager).present?
Portainer::Client::AccessToken.new(user.stack_manager_access_token(stack_manager))
elsif user.nil? && allow_anonymous && stack_manager.access_token.present?
Portainer::Client::AccessToken.new(stack_manager.access_token)
else
raise Portainer::Client::MissingCredentialError, "Please add your Portainer API token in the Credentials settings."
end
end
def connect(user, allow_anonymous: false)
provider_url = if Rails.configuration.remap_localhost.present?
K8::Kubeconfig.remap_localhost(stack_manager.provider_url)
else
stack_manager.provider_url
end
@_client = Portainer::Client.new(
provider_url,
retrieve_access_token(user, allow_anonymous:),
)
self
end
def clientView on GitHub (pinned to ba4ee3968d)
When it happens
Trigger: Thrown at lib/portainer/stack.rb:23 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of CanineHQ/canine@ba4ee3968d (2026-08-23).
Data as JSON: /api/errors/fc6a41d337f9711d.
Report an issue: GitHub.