DEV Community

Avinash reddy
Avinash reddy

Posted on • Updated on

Error: can please some one help

[ERROR] Angular compilation initialization failed. [plugin angular-compiler]

TypeError: Cannot read properties of undefined (reading 'moduleName')
at file:///home/jenkins/agent/workspace/D-20604-1B-UI-Pipeline-Dev-Story/node_modules/@angular/compiler-cli/bundles/chunk-YFIBJR5K.js:3187:43
at ModuleJob.run (node:internal/modules/esm/module_job:217:25)
at async ModuleLoader.import
(node:internal/modules/esm/loader:316:24)
at async importModuleDynamicallyWrapper (node:internal/vm/module:431:15)
at async AngularCompilation.loadCompilerCli (/home/jenkins/agent/workspace/D-20604-1B-UI-Pipeline-Dev-Story/node_modules/@angular-devkit/build-angular/src/tools/esbuild/angular/compilation/angular-compilation.js:44:13)
at async AotCompilation.initialize (/home/jenkins/agent/workspace/D-20604-1B-UI-Pipeline-Dev-Story/node_modules/@angular-devkit/build-angular/src/tools/esbuild/angular/compilation/aot-compilation.js:48:47)
at async initialize (/home/jenkins/agent/workspace/D-20604-1B-UI-Pipeline-Dev-Story/node_modules/@angular-devkit/build-angular/src/tools/esbuild/angular/compilation/parallel-worker.js:33:50)
at async /home/jenkins/agent/workspace/D-20604-1B-UI-Pipeline-Dev-Story/node_modules/piscina/dist/src/worker.js:141:26

Top comments (18)

Collapse
 
avinash917 profile image
Avinash reddy
This is the sample deployment file.apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    tags.datadoghq.com/service: {{ .Values.app.name }}          # Application deployment name
    tags.datadoghq.com/version: {{ .Values.app.deployment.spec.version }}   # Application version
    admission.datadoghq.com/enabled: "true" 
    admission.datadoghq.com/config.mode: "service"
{{ toYaml .Values.app.datadog | nindent 4 }}    # Add tags from values file
spec:
  template:
    metadata:
      labels:
        app: {{ .Values.app.name }}
        uuid: '{{ uuidv4 }}'
        tags.datadoghq.com/service: {{ .Values.app.name }}    # Application deployment name
        tags.datadoghq.com/version: {{ .Values.app.deployment.spec.version }}   # Application version
        admission.datadoghq.com/enabled: "true"
        admission.datadoghq.com/config.mode: "service"
{{ toYaml .Values.app.datadog | nindent 8  }}   # Add tags from values file
      annotations:
        admission.datadoghq.com/java-lib.custom-image: "199866546485.dkr.ecr.us-east-1.amazonaws.com/gcr.io/iaas-gcr-reg-prd-ad3d/golden/datadog-lib-java-init:latest"
    spec:
      containers:
          env:
          - name: DD_AGENT_HOST
            valueFrom:
              fieldRef:
                fieldPath: status.hostIP
          - name: DD_TRACE_SAMPLE_RATE
            value: "1"
          - name: DD_LOGS_INJECTION
            value: "true"
          - name: DD_PROFILING_ENABLED
            value: "true"
          - name: DD_VERSION
            value: {{ .Values.app.deployment.spec.version }}    # Application version
          - name: DD_SERVICE
            value: {{ .Values.app.name }}          # Application deployment name
This is my application deployment file 
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Values.app.name }}
spec:
  replicas: {{ .Values.app.deployment.replicas }}
  selector:
    matchLabels:
      app: {{ .Values.app.name }}
  template:
    metadata:
{{- with .Values.app.deployment.labels }}
      labels:
        uuid: '{{ uuidv4 }}'
{{ toYaml . | indent 8 }}{{ end }}
    spec:
      topologySpreadConstraints:
      - maxSkew: 1
        topologyKey: zone
        whenUnsatisfiable: ScheduleAnyway
        labelSelector:
          matchLabels:
            app: {{ .Values.app.name }}
      - maxSkew: 1
        topologyKey: kubernetes.io/hostname
        whenUnsatisfiable: DoNotSchedule
        labelSelector:
          matchLabels:
            app: {{ .Values.app.name }}
      containers:
        - name: {{ .Values.app.name }}
          image: {{ .Values.app.deployment.spec.image }}:{{ .Values.app.deployment.spec.version }}
          imagePullPolicy: Always
          envFrom:
          - configMapRef:
              name: {{ .Values.app.name }}
          env:
          - name: SPRING_APPLICATION_NAME
            value: gcs-pet-print-fulfillment-service
          - name: SERVER_PORT
            value: '8080'
          ports:
            - containerPort: 8080
          startupProbe:
            httpGet:
              path: /print-fulfillment/actuator/health
              port: 8080
            initialDelaySeconds: 90
            periodSeconds: 20
            successThreshold: 1
            failureThreshold: 5
            timeoutSeconds: 20
          readinessProbe:
            httpGet:
              path: /print-fulfillment/actuator/health
              port: 8080
            initialDelaySeconds: 60
            periodSeconds: 20
            successThreshold: 1
            failureThreshold: 5
            timeoutSeconds: 20
          livenessProbe:
            httpGet:
              path: /print-fulfillment/actuator/health
              port: 8080
            initialDelaySeconds: 60
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 5
            timeoutSeconds: 20
          resources:
{{ toYaml .Values.app.deployment.spec.resources | indent 12 }}
can you create a new yaml file from above sample deployment file to integrate data dog apm

Enter fullscreen mode Exit fullscreen mode
Collapse
 
avinash917 profile image
Avinash reddy

client.go:195: [debug] error updating the resource "gcs-pet-print-fulfillment-service":
08:36:40 cannot patch "gcs-pet-print-fulfillment-service" with kind Deployment: Deployment.apps "gcs-pet-print-fulfillment-service" is invalid: spec.template.metadata.labels: Invalid value: map[string]string{"admission.datadoghq.com/config.mode":"service", "admission.datadoghq.com/enabled":"true", "tags.datadoghq.com/alliance":"USIS", "tags.datadoghq.com/business_application":"BAP0008751", "tags.datadoghq.com/business_service":"ASVE0041266", "tags.datadoghq.com/cluster":"gcs-non-prod-eks-cluster", "tags.datadoghq.com/env":"qa", "tags.datadoghq.com/region":"us-east-1", "tags.datadoghq.com/service":"gcs-pet-print-fulfillment-service", "tags.datadoghq.com/tribe":"D2C-Revenue", "tags.datadoghq.com/version":"0.37.0-feature-datadog-integration-SNAPSHOT", "uuid":"42f75432-3906-46e2-a3ea-4f6cdac4877d"}: selector does not match template labels
08:36:40 client.go:403: [debug] Looks like there are no changes for Ingress "gcs-pet-print-fulfillment-service-nginx"
08:36:40 upgrade.go:293: [debug] warning: Upgrade "gcs-pet-print-fulfillment-service" failed: cannot patch "gcs-pet-print-fulfillment-service" with kind Deployment: Deployment.apps "gcs-pet-print-fulfillment-service" is invalid: spec.template.metadata.labels: Invalid value: map[string]string{"admission.datadoghq.com/config.mode":"service", "admission.datadoghq.com/enabled":"true", "tags.datadoghq.com/alliance":"USIS", "tags.datadoghq.com/business_application":"BAP0008751", "tags.datadoghq.com/business_service":"ASVE0041266", "tags.datadoghq.com/cluster":"gcs-non-prod-eks-cluster", "tags.datadoghq.com/env":"qa", "tags.datadoghq.com/region":"us-east-1", "tags.datadoghq.com/service":"gcs-pet-print-fulfillment-service", "tags.datadoghq.com/tribe":"D2C-Revenue", "tags.datadoghq.com/version":"0.37.0-feature-datadog-integration-SNAPSHOT", "uuid":"42f75432-3906-46e2-a3ea-4f6cdac4877d"}: selector does not match template labels
08:36:40 Error: UPGRADE FAILED: cannot patch "gcs-pet-print-fulfillment-service" with kind Deployment: Deployment.apps "gcs-pet-print-fulfillment-service" is invalid: spec.template.metadata.labels: Invalid value: map[string]string{"admission.datadoghq.com/config.mode":"service", "admission.datadoghq.com/enabled":"true", "tags.datadoghq.com/alliance":"USIS", "tags.datadoghq.com/business_application":"BAP0008751", "tags.datadoghq.com/business_service":"ASVE0041266", "tags.datadoghq.com/cluster":"gcs-non-prod-eks-cluster", "tags.datadoghq.com/env":"qa", "tags.datadoghq.com/region":"us-east-1", "tags.datadoghq.com/service":"gcs-pet-print-fulfillment-service", "tags.datadoghq.com/tribe":"D2C-Revenue", "tags.datadoghq.com/version":"0.37.0-feature-datadog-integration-SNAPSHOT", "uuid":"42f75432-3906-46e2-a3ea-4f6cdac4877d"}: selector does not match template labels
08:36:40 helm.go:75: [debug] cannot patch "gcs-pet-print-fulfillment-service" with kind Deployment: Deployment.apps "gcs-pet-print-fulfillment-service" is invalid: spec.template.metadata.labels: Invalid value: map[string]string{"admission.datadoghq.com/config.mode":"service", "admission.datadoghq.com/enabled":"true", "tags.datadoghq.com/alliance":"USIS", "tags.datadoghq.com/business_application":"BAP0008751", "tags.datadoghq.com/business_service":"ASVE0041266", "tags.datadoghq.com/cluster":"gcs-non-prod-eks-cluster", "tags.datadoghq.com/env":"qa", "tags.datadoghq.com/region":"us-east-1", "tags.datadoghq.com/service":"gcs-pet-print-fulfillment-service", "tags.datadoghq.com/tribe":"D2C-Revenue", "tags.datadoghq.com/version":"0.37.0-feature-datadog-integration-SNAPSHOT", "uuid":"42f75432-3906-46e2-a3ea-4f6cdac4877d"}: selector does not match template labels

Collapse
 
avinash917 profile image
Avinash reddy
This is deployment.yaml file
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Values.app.name }}
  labels:
    tags.datadoghq.com/service: {{ .Values.app.name }}          # Application deployment name
    tags.datadoghq.com/version: {{ .Values.app.deployment.spec.version }}   # Application version
    admission.datadoghq.com/enabled: "true" 
    admission.datadoghq.com/config.mode: "service"
{{ toYaml .Values.app.datadog | nindent 4 }}    # Add tags from values file
spec:
  replicas: {{ .Values.app.deployment.replicas }}
  selector:
    matchLabels:
      app: {{ .Values.app.name }}
  template:
    metadata:
      labels:
        uuid: '{{ uuidv4 }}'
        tags.datadoghq.com/service: {{ .Values.app.name }}    # Application deployment name
        tags.datadoghq.com/version: {{ .Values.app.deployment.spec.version }}   # Application version
        admission.datadoghq.com/enabled: "true"
        admission.datadoghq.com/config.mode: "service"
{{ toYaml .Values.app.datadog | nindent 8  }}   # Add tags from values file
      annotations:
        admission.datadoghq.com/java-lib.custom-image: "199866546485.dkr.ecr.us-east-1.amazonaws.com/gcr.io/iaas-gcr-reg-prd-ad3d/golden/datadog-lib-java-init:latest"
    spec:
      topologySpreadConstraints:
      - maxSkew: 1
        topologyKey: zone
        whenUnsatisfiable: ScheduleAnyway
        labelSelector:
          matchLabels:
            app: {{ .Values.app.name }}
      - maxSkew: 1
        topologyKey: kubernetes.io/hostname
        whenUnsatisfiable: DoNotSchedule
        labelSelector:
          matchLabels:
            app: {{ .Values.app.name }}
      containers:
        - name: {{ .Values.app.name }}
          image: {{ .Values.app.deployment.spec.image }}:{{ .Values.app.deployment.spec.version }}
          imagePullPolicy: Always
          envFrom:
          - configMapRef:
              name: {{ .Values.app.name }}
          env:
          - name: SPRING_APPLICATION_NAME
            value: gcs-pet-print-fulfillment-service
          - name: SERVER_PORT
            value: '8080'
          - name: DD_AGENT_HOST
            valueFrom:
              fieldRef:
                fieldPath: status.hostIP
          - name: DD_TRACE_SAMPLE_RATE
            value: "1"
          - name: DD_LOGS_INJECTION
            value: "true"
          - name: DD_PROFILING_ENABLED
            value: "true"
          - name: DD_VERSION
            value: {{ .Values.app.deployment.spec.version }}    # Application version
          - name: DD_SERVICE
            value: {{ .Values.app.name }}          # Application deployment name
          ports:
            - containerPort: 8080
          startupProbe:
            httpGet:
              path: /print-fulfillment/actuator/health
              port: 8080
            initialDelaySeconds: 90
            periodSeconds: 20
            successThreshold: 1
            failureThreshold: 5
            timeoutSeconds: 20
          readinessProbe:
            httpGet:
              path: /print-fulfillment/actuator/health
              port: 8080
            initialDelaySeconds: 60
            periodSeconds: 20
            successThreshold: 1
            failureThreshold: 5
            timeoutSeconds: 20
          livenessProbe:
            httpGet:
              path: /print-fulfillment/actuator/health
              port: 8080
            initialDelaySeconds: 60
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 5
            timeoutSeconds: 20
          resources: 
{{ toYaml .Values.app.deployment.spec.resources | indent 12 }}

This is value.yaml file
app:
  name: gcs-pet-print-fulfillment-service

  service:
    type: ClusterIP
    path: '/'
    dns: ''

  deployment:
    replicas: 1
    strategy: RollingUpdate
    spec:
      image: ''
      version: latest
      resources: {}
    labels:
      app: 'gcs-pet-print-fulfillment-service'
      name: 'gcs-pet-print-fulfillment-service'
      cmdb_bus_svc_id: 'ASVE0035728'
      dataclass: '5'
      businessunit: 'gcs'
      environment: 'dev'
      costcenter: '3723'
      division: '0037'

  configmap:
    data:
      SPRING_CLOUD_CONFIG_URI: 'https://gcs-us-config.gcsdevelopment.com/configuration-server'
Enter fullscreen mode Exit fullscreen mode

What are the changes that i should make

Collapse
 
avinash917 profile image
Avinash reddy

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    tags.datadoghq.com/service: {{ .Values.app.name }}          # Application deployment name
    tags.datadoghq.com/version: {{ .Values.app.deployment.spec.version }}   # Application version
    admission.datadoghq.com/enabled: "true" 
    admission.datadoghq.com/config.mode: "service"
{{ toYaml .Values.app.datadog | nindent 4 }}    # Add tags from values file
spec:
  template:
    metadata:
      labels:
        app: {{ .Values.app.name }}
        uuid: '{{ uuidv4 }}'
        tags.datadoghq.com/service: {{ .Values.app.name }}    # Application deployment name
        tags.datadoghq.com/version: {{ .Values.app.deployment.spec.version }}   # Application version
        admission.datadoghq.com/enabled: "true"
        admission.datadoghq.com/config.mode: "service"
{{ toYaml .Values.app.datadog | nindent 8  }}   # Add tags from values file
      annotations:
        admission.datadoghq.com/java-lib.custom-image: "199866546485.dkr.ecr.us-east-1.amazonaws.com/gcr.io/iaas-gcr-reg-prd-ad3d/golden/datadog-lib-java-init:latest"
        ad.datadoghq.com/apm.tracer.source.paths: "/usr/local/share/java/datadog/dd-java-agent.jar"
    spec:
      containers:
      - name: {{ .Values.app.name }}
        image: {{ .Values.app.deployment.spec.image }}:{{ .Values.app.deployment.spec.version }}
        imagePullPolicy: Always
        env:
        - name: DD_AGENT_HOST
          valueFrom:
            fieldRef:
              fieldPath: status.hostIP
        - name: DD_TRACE_SAMPLE_RATE
          value: "1"
        - name: DD_LOGS_INJECTION
          value: "true"
        - name: DD_PROFILING_ENABLED
          value: "true"
        - name: DD_VERSION
          value: {{ .Values.app.deployment.spec.version }}    # Application version
        - name: DD_SERVICE
          value: {{ .Values.app.name }}          # Application deployment name
        - name: DD_JMXFETCH_ENABLED
          value: "true"
        - name: DD_APM_ENABLED
          value: "true"
        - name: DD_JMXFETCH_CONFIG_DIR
          value: "/conf.d/"
        - name: DD_APM_ANALYZED_SPANS
          value: "sql, http, web, rpc"
        - name: DD_APM_NON_LOCAL_TRAFFIC
          value: "true"
        - name: DD_APM_DD_HTTP_TRANSPORT_ENABLED
          value: "true"
        - name: DD_APM_SERVICE_NAME
          value: "my-service"
        - name: DD_JMXFETCH_CONFIG_DIR
          value: "/etc/datadog-agent/conf.d"
        - name: DD_APM_ENV
          value: "prod"
        - name: DD_APM_ANALYTICS_ENABLED
          value: "true"
        - name: DD_TRACE_ENABLED
          value: "true"
        - name: DD_APM_DD_FILE
          value: "/var/log/datadog/apm.log"
        - name: DD_TRACE_AGENT_PORT
          value: "8126"
        - name: DD_APM_TRACER_VERSION
          value: "0.68.1"
        - name: DD_APM_ANALYTICS_SAMPLE_RATE
          value: "1.0"
        - name: DD_APM_DD_HTTP_TRANSPORT_ENABLED
          value: "true"
        - name: DD_APM_IGNORE_RESOURCES
          value: "health|metrics|ping|status|threadDump|trace"
      topologySpreadConstraints:
      - maxSkew: 1
        topologyKey: zone
        whenUnsatisfiable: ScheduleAnyway
        labelSelector:
          matchLabels:
            app: {{ .Values.app.name }}
      - maxSkew: 1
        topologyKey: kubernetes.io/hostname
        whenUnsatisfiable: DoNotSchedule
        labelSelector:
          matchLabels:
            app: {{ .Values.app.name }}
      containers:
        - name: {{ .Values.app.name }}
          image: {{ .Values.app.deployment.spec.image }}:{{ .Values.app.deployment.spec.version }}
          imagePullPolicy: Always
          envFrom:
          - configMapRef:
              name: {{ .Values.app.name }}
          env:
          - name: SPRING_APPLICATION_NAME
            value: gcs-pet-print-fulfillment-service
          - name: SERVER_PORT
            value: '8080'
          ports:
            - containerPort: 8080
          startupProbe:
            httpGet:
              path: /print-fulfillment/actuator/health
              port: 8080
            initialDelaySeconds: 90
            periodSeconds: 20
            successThreshold: 1
            failureThreshold: 5
            timeoutSeconds: 20
          readinessProbe:
            httpGet:
              path: /print-fulfillment/actuator/health
              port: 8080
            initialDelaySeconds: 60
            periodSeconds: 20
            successThreshold: 1
            failureThreshold: 5
            timeoutSeconds: 20
          livenessProbe:
            httpGet:
              path: /print-fulfillment/actuator/health
              port: 8080
            initialDelaySeconds: 60
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 5
            timeoutSeconds: 20
          resources:
{{ toYaml .Values.app.deployment.spec.resources | indent 12 }}

Enter fullscreen mode Exit fullscreen mode
Collapse
 
avinash917 profile image
Avinash reddy

helm template gcs-pet-print-fulfillment-service -f values.yaml -f values-qa.yaml --set app.configmap.data.SPRING_PROFILES_ACTIVE=qa --set app.configmap.data.ENV=qa --set app.configmap.data.DATA_REGION=us --set app.deployment.spec.image=filler --set app.deployment.spec.version=1.0.0 -s templates/deployment.yaml .
12:59:49 Error: parse error at (gcs-pet-print-fulfillment-service/templates/deployment.yaml:99): unexpected EOF

Collapse
 
avinash917 profile image
Avinash reddy

upgrade.go:84: [debug] preparing upgrade for gcs-pet-print-fulfillment-service
12:52:20 Error: UPGRADE FAILED: error validating "": error validating data: ValidationError(Deployment.spec): missing required field "selector" in io.k8s.api.apps.v1.DeploymentSpec
12:52:20 helm.go:75: [debug] error validating "": error validating data: ValidationError(Deployment.spec): missing required field "selector" in io.k8s.api.apps.v1.DeploymentSpec

Collapse
 
avinash917 profile image
Avinash reddy

helm upgrade --install --namespace ren-beta-us --timeout 20m gcs-pet-saas -f pipeline-gen-helm-values.yaml -f values-beta.yaml --timeout 900s --debug ./ --wait --set app.configmap.data.SPRING_PROFILES_ACTIVE=beta --set app.configmap.data.ENV=beta --set app.configmap.data.DATA_REGION=us
09:19:31 history.go:52: [debug] getting history for release gcs-pet-saas
09:19:31 upgrade.go:84: [debug] preparing upgrade for gcs-pet-saas
09:19:32 upgrade.go:92: [debug] performing update for gcs-pet-saas
09:19:32 Error: UPGRADE FAILED: unable to build kubernetes objects from current release manifest: unable to recognize "": no matches for kind "HorizontalPodAutoscaler" in version "autoscaling/v2beta2"
09:19:32 helm.go:75: [debug] unable to recognize "": no matches for kind "HorizontalPodAutoscaler" in version "autoscaling/v2beta2"
09:19:32 unable to build kubernetes objects from current release manifest

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
avinash917 profile image
Avinash reddy

Error: template: gcs-pet-print-fulfillment-service/templates/deployment.yaml:15:44: executing "gcs-pet-print-fulfillment-service/templates/deployment.yaml" at <.values.app.name>: nil pointer evaluating interface {}.app

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
avinash917 profile image
Avinash reddy

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Enter fullscreen mode Exit fullscreen mode
Collapse
 
avinash917 profile image
Avinash reddy

export HOMEBREW_PREFIX="$HOME/homebrew"
curl -fsSL github.com/Homebrew/brew/tarball/m... | tar xz --strip 1 -C "$HOMEBREW_PREFIX"

Collapse
 
avinash917 profile image
Avinash reddy

SYSTEM_UNAVAILABLE ns:operationStatusMessageService unavailable, Service State:DATASOURCE_UNAVAILABLE/ns:operationStatusMessage
ns1:operationErrorSYSTEM_UNAVAILABLE/ns1:operationError

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
Sloan, the sloth mascot
Comment deleted
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
kaamkiya profile image
Kaamkiya

You can tag this #help to get help from fellow Angular users.

Sorry, I don't use Angular, so I can't help :(