Skip to content

APISource importer with repository.secretRef fails at runtime with The given id must not be null (operator path) #256

@adrims

Description

@adrims

Describe the bug

When creating APISource resources with spec.importers[].repository.secretRef (PAT secret provided via SecretSource), the APISource reconciles to READY, but importer execution fails at runtime with:

java.lang.IllegalArgumentException: The given id must not be null

This blocks private repository imports via importer jobs.

Expected behavior

APISource importers using repository.secretRef should create functional import jobs and import from private repos successfully (same secret already available in Microcks).

Actual behavior

Microcks, SecretSource, and APISource show READY
Importer job starts, then fails in Microcks runtime with null id error
Direct artifact download with the same secret works

How to Reproduce?

Deploy Microcks with operator.
Create a SecretSource that creates a Microcks secret with PAT credentials.
Create an APISource with importer + repository.secretRef referencing that secret.
Observe APISource status becomes READY.
Check Microcks app logs when importer runs.

From Microcks app logs:

Starting import for job 'XXX'
Servlet.service() ... java.lang.IllegalArgumentException: The given id must not be null
stack points to io.github.microcks.service.JobService.doImportJob(JobService.java:70)

Microcks version or git rev

1.14.0-RC1 & 1.14.0-RC2

Install method (docker-compose, helm chart, operator, docker-desktop extension,...)

operator

Additional information

spec.artifacts with secretRef works for the same private URL/secret (imports service/mocks).
Direct call to artifact download endpoint with same secret succeeds.
Failure seems specific to importer job path (spec.importers).

Suspected root cause
In operator importer mapping (APISourceReconciler.updateWithImporterSpec()), SecretRef.name is set from repository.secretRef, but SecretRef.secretId is not set.
At runtime, JobService.doImportJob() resolves secret by job.secretRef.secretId, causing null-id failure.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions