phetsims / perennial

Maintenance tools that won't change with different versions of chipper checked out
MIT License
2 stars 5 forks source link

Build Error: `TypeError: Cannot read properties of undefined (reading 'COULOMBS_LAW/coulombs-law.title')` #326

Open zepumph opened 1 year ago

zepumph commented 1 year ago

From 3:06 this morning. @jbphet, @chrisklus and I are investigating. We're going to start with a trigger build.

Build failure: Error: Build aborted, Error: grunt --brands=phet --locales=ku --lint=false --allHTML --debugHTML in ../release-branches/coulombs-law-1.0/coulombs-law failed with exit code 1
stdout:
Running "clean" task

Running "build" task
Building runnable repository (coulombs-law, brands: phet)
Building brand: phet
>> require.js optimization for brand: phet complete (5082222 bytes)
>> Minification for phet complete
>> Require.js: 2379879 bytes
>> Preloads: 238910 bytes
>> Mipmaps: 54598 bytes
Fatal error: Perennial task failed:
TypeError: Cannot read properties of undefined (reading 'COULOMBS_LAW/coulombs-law.title')
  at module.exports (/data/share/phet/build-server/release-branches/coulombs-law-1.0/chipper/js/grunt/packageRunnable.js:42:45)
  at module.exports (/data/share/phet/build-server/release-branches/coulombs-law-1.0/chipper/js/grunt/buildRunnable.js:172:72)
  at processTicksAndRejections (node:internal/process/task_queues:96:5)
  at /data/share/phet/build-server/release-branches/coulombs-law-1.0/chipper/js/grunt/Gruntfile.js:173:11
  at wrap (/data/share/phet/build-server/release-branches/coulombs-law-1.0/chipper/js/grunt/Gruntfile.js:59:7)

Full Error details:
{}

stderr:
(node:354492) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:354492) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'echo' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'tempdir' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'pwd' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'exec' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'ls' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'find' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'grep' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'head' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'ln' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'mkdir' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'rm' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'mv' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'sed' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'set' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'sort' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'tail' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'test' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'to' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency
(node:354492) Warning: Accessing non-existent property 'which' of module exports inside circular dependency
(node:354492) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
. Sim = coulombs-law Version = 1.0.22 Brands = phet Locales = ku Shas = {"comment":"# coulombs-law 1.0.22 Wed May 24 2023 13:24:18 GMT-0600 (Mountain Daylight Time)","assert":{"sha":"928741cfc8fe804334d5b35292140314511f8678","branch":"HEAD"},"axon":{"sha":"7751fab50cc37447a5603b50d776cc267bd437ac","branch":"HEAD"},"brand":{"sha":"0682b96493639aa7576a21310e701c874f435f54","branch":"HEAD"},"chipper":{"sha":"41ac3fbe9df9ebf5d0ae311c776b145e99fdbb3c","branch":"HEAD"},"coulombs-law":{"sha":"c4ad819c01f84c7841ffeadc6fdecc7ea637be96","branch":"HEAD"},"dot":{"sha":"dcccfddd20aa5200bc2d8558b47c40a5d2510d5e","branch":"HEAD"},"inverse-square-law-common":{"sha":"180e1bb6c8254db88a46bd4f55616458da241fbe","branch":"HEAD"},"joist":{"sha":"d672127f938333bbd1a2d47af8c355f2a381cb8f","branch":"HEAD"},"kite":{"sha":"380cef530ae6a8ae4aa644ff4f09baf85326ad9f","branch":"HEAD"},"phet-core":{"sha":"3db3458b43b71f4dead23de1c4c693df82db3e13","branch":"HEAD"},"phet-io":{"sha":"a7436d70e1671c0a12e007356b9a4c8d42e6e5b3","branch":"HEAD"},"phet-io-wrappers":{"sha":"0a4a3153723d7d1c853b77dae395803c905da1ec","branch":"HEAD"},"phetcommon":{"sha":"57657659ba215a96cd70ecab3dc5023529c0997f","branch":"HEAD"},"phetmarks":{"sha":"5ea3e608ca6a6f2d04c84adb539a8b029cbf6580","branch":"HEAD"},"query-string-machine":{"sha":"9ae63aab514937ff2119f5844c1da37db0ba49d5","branch":"HEAD"},"scenery":{"sha":"c0043acb22feaaf9cc304bd6e81a698dd2ecabc0","branch":"HEAD"},"scenery-phet":{"sha":"6fce9b00007e38df651bbea3b705a6c7e22c66f4","branch":"HEAD"},"sherpa":{"sha":"0989d371163d6f63b86d64735d192297d75b23f2","branch":"HEAD"},"sun":{"sha":"34fa39fe1e557d724b54183c69d5a8c952f57264","branch":"HEAD"},"tambo":{"sha":"abe0693baa072316454e38be7d6ec1e445e7c482","branch":"HEAD"},"tandem":{"sha":"f9cfcc67c13c21c30b1787fe628b0def4c09be58","branch":"HEAD"}}
zepumph commented 1 year ago

@jbphet @chrisklus and I found that ReleaseBranch.updateCheckout is incredibly buggy. For babel, we are seeing that it is not pulling new translations in. For example, BASE had a kurdish translation come in last night, but the sim is in english (the fallback): https://phet.colorado.edu/sims/html/balloons-and-static-electricity/1.5.11/balloons-and-static-electricity_ku.html

This is because of these lines here:

https://github.com/phetsims/chipper/blob/1381d218ed830c3a140e52ca7e654c666653b57b/js/grunt/buildRunnable.js#L148-L154

Also noting https://github.com/phetsims/perennial/issues/83 because that punt has been hiding issues for the last month.

So for BASE, it had this workaround, but for Coulombs law, it predates this workaround pointing back to the fallback locale, and so it has a hard failure.

zepumph commented 1 year ago

@jonathanolson, this is a top priority regression that we need to fix. How can we make sure that each parallel checkout is completely up to date. Here is a patch with some ideas, but I do not understand things well enough to make a commit.

Subject: [PATCH] remove dispose code in keyboard help, https://github.com/phetsims/scenery-phet/issues/810
---
Index: js/common/ReleaseBranch.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/common/ReleaseBranch.js b/js/common/ReleaseBranch.js
--- a/js/common/ReleaseBranch.js    (revision aca2bd5294ba6b828401363b6c81a732ab453497)
+++ b/js/common/ReleaseBranch.js    (date 1686265919455)
@@ -212,7 +212,8 @@
           await gitCloneDirectory( repo, checkoutDirectory );
         }
         else {
-          await execute( 'git', [ 'fetch' ], repoPwd );
+          // Options two? Why are we only fetching, this seems really buggy
+          await execute( 'git', [ 'pull' ], repoPwd );
         }
       };

@@ -232,6 +233,11 @@

         await gitCheckoutDirectory( dependencies[ repo ].sha, repoPwd );

+        // Option one? Babel is always at the tip of a branch, can we pull that branch please? See
+        if ( repo === 'babel' ) {
+          await gitPullDirectory( repoPwd );
+        }
+
         if ( repo === 'chipper' || repo === 'perennial-alias' || repo === this.repo ) {
           winston.info( `npm ${repo} in ${checkoutDirectory}` );
zepumph commented 1 year ago
jonathanolson commented 1 year ago

Added your "option one" above.

jonathanolson commented 1 year ago

Can't just do locales=* builds (although I added ReleaseBranch.redeployProduction above, which will hopefully be helpful for the future), since it doesn't provide translator information for credits. Individual build requests will need to happen from rosetta for that (specifying translatorId in the build requests, one locale at a time) to get the credits correct.

jbphet commented 1 year ago

I've redeployed most of the sims that were problems. I say "most" because of the issue linked just above where user IDs are missing, which makes it tricky to redeploy the translation. I'll work on that next.

For reference, here is a list of some sims and locales that I verified were bad (either missing or deployed with all English fallbacks) due to this problem, and subsequently verified were fixed after the redeployment. This isn't an exhaustive list of all sims that suffered from this problem, but was useful for spot checking that the redeployment fixed things.

Sim Language Locale Code
balloons-and-static-electricity Kurdish ku
mean-share-and-balance Arfan Oromo om
quadrilateral Danish da
quadrilateral Polish pl
quadrilateral Portuguese, Brazil pt_BR
quadrilateral Romanian ro

Below is a list of all the redeployments that were attempted, though some failed due to the lack of a user ID in the translation files. This list was created by extracting all requested builds from the Rosetta log from May 23 until now. There are 56 sim/locale combinations on the list, though it's possible there are some duplicates.

```js [ { "simName": "ratio-and-proportion", "locale": "bg" }, { "simName": "gene-expression-essentials", "locale": "bg" }, { "simName": "natural-selection", "locale": "bg" }, { "simName": "neuron", "locale": "bg" }, { "simName": "build-a-nucleus", "locale": "bg" }, { "simName": "waves-intro", "locale": "bg" }, { "simName": "circuit-construction-kit-dc-virtual-lab", "locale": "bg" }, { "simName": "circuit-construction-kit-dc", "locale": "bg" }, { "simName": "circuit-construction-kit-ac", "locale": "bg" }, { "simName": "charges-and-fields", "locale": "bg" }, { "simName": "capacitor-lab-basics", "locale": "bg" }, { "simName": "balloons-and-static-electricity", "locale": "bg" }, { "simName": "friction", "locale": "bg" }, { "simName": "resistance-in-a-wire", "locale": "bg" }, { "simName": "forces-and-motion-basics", "locale": "bg" }, { "simName": "friction", "locale": "om" }, { "simName": "forces-and-motion-basics", "locale": "om" }, { "simName": "geometric-optics", "locale": "om" }, { "simName": "quadrilateral", "locale": "ro" }, { "simName": "quadrilateral", "locale": "pl" }, { "simName": "quadrilateral", "locale": "da" }, { "simName": "build-a-nucleus", "locale": "hu" }, { "simName": "forces-and-motion-basics", "locale": "om" }, { "simName": "geometric-optics", "locale": "om" }, { "simName": "mean-share-and-balance", "locale": "om" }, { "simName": "geometric-optics-basics", "locale": "om" }, { "simName": "number-compare", "locale": "om" }, { "simName": "ratio-and-proportion", "locale": "om" }, { "simName": "ph-scale", "locale": "om" }, { "simName": "beers-law-lab", "locale": "om" }, { "simName": "quadrilateral", "locale": "pt_BR" }, { "simName": "greenhouse-effect", "locale": "th" }, { "simName": "number-play", "locale": "om" }, { "simName": "energy-skate-park", "locale": "es" }, { "simName": "number-line-integers", "locale": "es" }, { "simName": "faradays-law", "locale": "es" }, { "simName": "density", "locale": "es" }, { "simName": "balloons-and-static-electricity", "locale": "ku" }, { "simName": "beers-law-lab", "locale": "ku" }, { "simName": "blackbody-spectrum", "locale": "ku" }, { "simName": "build-a-nucleus", "locale": "ku" }, { "simName": "make-a-ten", "locale": "th" }, { "simName": "fraction-matcher", "locale": "ku" }, { "simName": "area-model-algebra", "locale": "th" }, { "simName": "balloons-and-static-electricity", "locale": "ku" }, { "simName": "john-travoltage", "locale": "ku" }, { "simName": "vector-addition", "locale": "ku" }, { "simName": "energy-skate-park", "locale": "ku" }, { "simName": "density", "locale": "ro" }, { "simName": "density", "locale": "el" }, { "simName": "density", "locale": "kn" }, { "simName": "density", "locale": "pl" }, { "simName": "density", "locale": "fr" }, { "simName": "density", "locale": "it" }, { "simName": "quadrilateral", "locale": "da" }, { "simName": "density", "locale": "bg" } ] ```
jbphet commented 1 year ago

The following sim+locales could not be redeployed because of missing user IDs:

jbphet commented 1 year ago

@mattpen has let me know that the problem sims from the list in https://github.com/phetsims/perennial/issues/326#issuecomment-1585091178 need to be rebuilt again because of issues with the main website translation pages. These pages were not being updated to use the localized sim title. @mattpen has fixed this, so I'll kick off the script to trigger these builds and update this issue when it's done.

jbphet commented 1 year ago

Second iteration of batch trigger builds seems to have completed successfully. The "quad" translation page is now lookin' good. Here's a screenshot:

image

I also checked the other sims listed in https://github.com/phetsims/perennial/issues/326#issuecomment-1585091178 and they look good as well.

I'm not going to close this because I want to make sure the sims listed in https://github.com/phetsims/perennial/issues/326#issuecomment-1585181903 and redeployed after user IDs are added back to those translations. This is blocked until https://github.com/phetsims/rosetta/issues/412 is fully resolved.

chrisklus commented 1 year ago

@mattpen and I noticed that two more of this same type of build failure happened over the weekend. From the most recent failure, arithmetic on the 18th, it looks pretty clear that at 4:09 the translator submitted some common code translations for the locale ki and then triggered a build for arithmetic with no sim-specific translations (specifically no title translation). This caused the same no-title error because there wasn't a ki file in babel yet for arithmetic. When they submitted sim-specific translations at 5:41 and triggered another build, it succeeded. It looks like this is happening during a build, so we started looking for places this could fail in chipper. We will reach out to continue with @jonathanolson.

kathy-phet commented 1 year ago

@solaolateju - While the devs will look for some way to prevent or fix the above failure, can you please also up your training for translators to make sure they know not to submit only common code strings in this way. They need to translate the actual sim itself as well.

If you might be able to ask the translator about the origins here, as well. Did he/she intend for the rest of the sim specific strings to be in English for this translation, so the only thing that would ever be translated for this sim and language is common code strings??

jbphet commented 1 year ago

I'm going to unassign myself and hand this back to other devs that I know to be working on this. I'll make sure that the sims listed above are redeployed as part of fully addressing https://github.com/phetsims/rosetta/issues/412.

chrisklus commented 1 year ago

@zepumph and I investigated more this afternoon and think that this would be easiest to solve on rosetta's side. To make a change to the build process to use the backup english title to prevent errors would require maintenance releasing all release branches. If we instead stopped allowing translators to submit a translation with no title, this error should no longer be possible.

We chatted with @jbphet about this and he up for adding the validation to rosetta. We open an issue over there.

solaolateju commented 1 year ago

@kathy-phet I will inform translators at future trainings. It is unusual to begin translating from common strings.

I checked Arithmetic (ki) and found it uses over 80% common strings and about 9 or 53 are Sim-Specific Strings. which would have increased the likelihood of this happening.