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 (12)

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
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

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
 
Sloan, the sloth mascot
Comment deleted
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
 
Sloan, the sloth mascot
Comment deleted
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 :(