title: gem therubyracer Precompile freezing during kubernetes deploy
body: <p>We encountered strange gem behavior when working with the stack</p>
  <p>Jenkins - Kubernetes Version: v1.20.6</p>
  <p>When doing a job</p>
  <pre><code>
          image: imagename
  
          command: ['sh', '-c', 'rake assets:precompile']
  
          envFrom:
  
          - configMapRef:
  
              name: ehr-init-configmap
  
          - configMapRef:
  
              name: ehr-pg-configmap
  
          volumeMounts:
  
            - mountPath: &quot;/app/public&quot;
  
              name: ehr
  
        containers:
  
        - name: done
  
          imagePullPolicy: IfNotPresent
  
          image: busybox
  
          command: ['sh', '-c', 'echo &quot;run-migrations and precompile-assets completed&quot;']
  
        imagePullSecrets:
  
        - name: credockerhub
  </code></pre>
  <p>Pod precompile-assets hangs in Notready state</p>
  <p>The main oddity is that the problem does not reproduce regularly. About 1 time out of 5.</p>
  <p>Gem version therubyracer (0.12.3)</p>
  <p>Pod logs with --trace</p>
  <pre><code>** Invoke assets:precompile (first_time)
  
  ** Invoke assets:environment (first_time)
  
  ** Execute assets:environment
  
  ** Invoke environment (first_time)
  
  ** Execute environment
  
  W, [2022-03-23T15:45:46.425409 #6]  WARN -- : Ehr::Direction::ServiceRequest: overriding method 'invalid?'!
  
  W, [2022-03-23T15:45:46.426528 #6]  WARN -- : Ehr::Direction::ServiceRequest: overriding method 'not_sent?'!
  
  ** Invoke yarn:install (first_time)
  
  ** Execute yarn:install
  
  ** Execute assets:precompile
  
  W, [2022-03-23T15:46:05.260395 #6]  WARN -- : Removed sourceMappingURL comment for missing asset 'jsoneditor.map' from /app/app/assets/javascripts/jsoneditor.js
  
  W, [2022-03-23T15:46:05.260635 #6]  WARN -- : Removed sourceMappingURL comment for missing asset 'jsoneditor.map' from /app/app/assets/javascripts/jsoneditor.js
  
  W, [2022-03-23T15:46:05.265931 #6]  WARN -- : Removed sourceMappingURL comment for missing asset 'jsoneditor.map' from /app/app/assets/javascripts/jsoneditor.js
  </code></pre>
  <p>when the job does not work correctly in the logs of jenkins, it constantly repeats</p>
  <pre><code>13:45:12  One or more Pods still initializing
  
  13:45:12 
  
  13:45:12  [Pipeline] sleep
  
  13:45:12  Sleeping for 3 sec
  
  13:45:15  [Pipeline] sh
  
  13:45:15  + kubectl get jobs --kubeconfig=/var/jenkins_home/.kube/dev -n dev -l pre-deploy==ehr -o jsonpath={.items[].status.conditions[?(@.type==&quot;Complete&quot;)].status} --ignore-not-found=true
  
  13:45:15  [Pipeline] sh
  
  13:45:15  + date --iso-8601=seconds
  
  13:45:15  [Pipeline] sh
  
  13:45:16  + kubectl logs ehr-pre-deploy-mzvml --kubeconfig=/var/jenkins_home/.kube/dev -n dev --all-containers=true --since-time=2022-03-23T13:45:11+02:00 --tail=-1
  
  13:45:16  + echo One or more Pods still initializing
  </code></pre>
  <p>when the job is working correctly, deploy successfully end with message:</p>
  <pre><code>Copying assets (preserving modes) to /app/public/assets/tinymce
  </code></pre>