Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on run otel-collector-migrate-init: jobs.batch "signoz-schema-migrator" not found #363

Open
voriol opened this issue Dec 15, 2023 · 13 comments
Assignees

Comments

@voriol
Copy link

voriol commented Dec 15, 2023

Error on run otel-collector-migrate-init:

signoz-otel-collector-migrate-init Error from server (NotFound): jobs.batch "signoz-schema-migrator" not found

No more logs. The pod crashes with this message

Helm chart version: 0.31.1
signoz/signoz-otel-collector version: 0.88.3

@srikanthccv srikanthccv transferred this issue from SigNoz/signoz-otel-collector Dec 15, 2023
@srikanthccv
Copy link
Member

@prashant-shahi

@Volodymyr-Kuchinskyi
Copy link

Hello
Having the same issue, found this discussion - https://knowledgebase.signoz.io/t/issue-with-upgrading-helm-and-schema-migrator-failure/2Ka466

@Volodymyr-Kuchinskyi
Copy link

@prashant-shahi I think I've managed to reproduce the issue:

I was not able to reproduce the issue in case I uninstall previously successfully installed chart, and try to reinstall.

I've managed to reproduce the issue when I've uninstalled a chart, dropped the namespace with all the resources that chart was not able to delete (schema-migrator job also was not deleted by a helmchart), and install chart from scratch.

The fix that works now for me as a workaround, is to create schema-migrator job during the installation of the helm chart.

I assume it is somehow related to this pre-install vs post-install helm hooks mechanics
In my opinion helm is not creating this job during the installation phase because it is defined as a post-install hook, but at the same time otel-collector depends on this job and not being able to startup without it.
Also because of that helmchart fails to install and there is no post-install phase so there is not job created.

@prashant-shahi
Copy link
Member

@Vladimir-Kuchinskiy can you share versions of your Helm and signoz helm chart that is being used?

@Volodymyr-Kuchinskyi
Copy link

@prashant-shahi I am using latest helm terraform provider 2.12.1 https://registry.terraform.io/providers/hashicorp/helm/latest/docs
regarding signoz chart, it is 0.31.1 version

@4nte
Copy link

4nte commented Dec 20, 2023

I have the same issue.
chart version: 0.31.2
helm v3.13.3

Error from server (NotFound): jobs.batch "signoz-schema-migrator" not found

@scorpionknifes
Copy link

scorpionknifes commented Jan 18, 2024

Here is a temporary fix for helm terraform - set wait to false, thank you @prashant-shahi pointing out the hooks

resource "helm_release" "my_signoz" {
  name = "my-signoz"

  repository = "https://charts.signoz.io"
  chart      = "signoz"
  namespace  = "observability"

  wait = false
}

@haimgel
Copy link

haimgel commented Feb 18, 2024

I saw the same issue with 0.34.3 -> 0.35.2 upgrade, the signoz-otel-collector-metrics and signoz-otel-collector pods failed to start because the init containers failed with this "job not found error". So Helm never advanced to the post-install stage where this job is created.

I'm using Pulumi and also "solved" this by setting skipAwait: true, but this is not great overall, this could mark the release as healthy when there's a genuine issue.

@codekoala
Copy link

Also seeing this when upgrading from chart 0.37.1 to 0.39.0. Rather than using wait = false, I opted to try @Volodymyr-Kuchinskyi 's workaround. I created two Job resources: one called signoz-schema-migrator and another called signoz-schema-migrator-upgrade. This was sufficient to appease the two crashing pods, and the actual upgrade process still appeared to take place after the pods started successfully.

@afreakk
Copy link

afreakk commented Jun 21, 2024

I get this everytime I try to change anything, using pulumi

❯ kubectl logs signoz-otel-collector-7876b4f447-6mx96 -c signoz-otel-collector-migrate-init
Error from server (NotFound): jobs.batch "signoz-schema-migrator-upgrade" not found
helm.NewRelease(ctx, "signoz", &helm.ReleaseArgs{
		WaitForJobs:     pulumi.Bool(false),
		Chart:           pulumi.String("signoz"),
		Version:         pulumi.String("0.44.0"),
		Name:            pulumi.String("signoz"),
		Namespace:       pulumi.String("signoz"),
		CreateNamespace: pulumi.Bool(true),
		RepositoryOpts: helm.RepositoryOptsArgs{
			Repo: pulumi.String("https://charts.signoz.io"),
		},
		Values: pulumi.Map{
			"otelCollectorMetrics": pulumi.Map{
				"enabled": pulumi.Bool(false),
			},

			"k8s-infra": pulumi.Map{
				"enabled": pulumi.Bool(false),
			},
		},
	}, opts...)

Everytime i try to update a live installation with new helm-values i get the error.

@wfhartford
Copy link

I'm experiencing this issue as well using a helm install. It looks like it was caused when I messed up the first install, removed it using helm, then tried to reinstall.

@RoguedBear
Copy link

RoguedBear commented Oct 19, 2024

I faced the same problem upgrading from chart version 0.53.1 to 0.54.2. Using @scorpionknifes method to set wait = false worked as a workaround

@muhamedkapoevolt
Copy link

I'm having same issue. Im not using terraform to install/upgrade signoz chart. Im doing it with helm directly. I installed 0.54.2, after couple of changes in values.yaml, I tried upgrade but it fails. Init containers in otel-collector and otel-collector-metrics keep throwing ExitCode: 1 with an issue Error from server (NotFound): jobs.batch "signoz-schema-migrator-upgrade" not found``

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests