zowe / zlux

The top-level superproject for zLUX. zLUX includes the Zowe Desktop framework in addition to several built-in apps and an example server implementation.
Eclipse Public License 2.0
39 stars 42 forks source link

What causes zowe files to become 'untagged' in /components/app-server/share/zlux-server-framework/node_modules/express/node_modules/body-parser #1025

Open bobbydixon opened 2 weeks ago

bobbydixon commented 2 weeks ago

Describe the bug After upgrading to Zowe V2.16, we noticed the following error on one of the Zowe upgraded:

SyntaxError: Invalid or unexpected token
at Object.compileFunction (node:vm:360:18)
at wrapSafe (node:internal/modules/cjs/loader:1055:15)
at Module._compile (node:internal/modules/cjs/loader:1090:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (/appshare/4j00/zowe/components/app-server/share/zlux-server-framework/node_modules/express/lib/express.js at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (/appshare/4j00/zowe/components/app-server/share/zlux-server-framework/node_modules/express/index.js:11:18

Steps to Reproduce

  1. Upgrade Zowe to V2.16
  2. Start Zowe and the error occurs

Expected behavior We expect Zowe to start up like it does on the other systems that were also upgraded to Zowe V2.16

Screenshots If applicable, add screenshots to help explain your problem.

Logs We see the above mentioned error in the Zowe logs. Zowe tries a couple of times, then terminates.

Details

Web Browser Details (if the bug relates to Zowe Desktop usage):

REST API client (in case of REST API issue):

Shell Environment Details (if the bug relates to CLI):

Additional context While searching for other issues, I came across another case that also mentioned the "SyntaxError: Invalid or unexpected token" message, which suggested using the chtag command to tag the files.

When we drilled down in the directory on the system that's failing, we see the files are untagged:

zowe/components/app-server/share/zlux-server-framework/node_modules/express/node_modules/body-parser

$ ls -lT

total 160

The question we have is why these files became untagged? the same files on the working systems show 't' for tagged.

1000TurquoisePogs commented 1 week ago

I installed v2.16 to check, and do not see that folder.

/v216/components/app-server/share/zlux-server-framework/node_modules/express/node_modules> /bin/ls -lT
total 32
                    drwxr-xr-x   2 ME    GROUP     8192 May  2 10:36 cookie
                    drwxr-xr-x   6 ME    GROUP     8192 May  2 10:36 qs

there is no 'body-parser' folder.

But, body-parser is a known dependency of express, and lives in a different folder.

/v216/components/app-server/share/zlux-server-framework/node_modules/body-parser> /bin/ls -lT
total 128
t ISO8859-1   T=on  -rwxr-xr-x   1 ME    GROUP    16491 May  2 10:36 HISTORY.md
t ISO8859-1   T=on  -rwxr-xr-x   1 ME    GROUP     1172 May  2 10:36 LICENSE
t ISO8859-1   T=on  -rwxr-xr-x   1 ME    GROUP    18182 May  2 10:36 README.md
t ISO8859-1   T=on  -rwxr-xr-x   1 ME    GROUP     1193 May  2 10:36 SECURITY.md
t ISO8859-1   T=on  -rwxr-xr-x   1 ME    GROUP     2681 May  2 10:36 index.js
                    drwxr-xr-x   3 ME    GROUP     8192 May  2 10:36 lib
                    drwxr-xr-x   3 ME    GROUP     8192 May  2 10:36 node_modules
t ISO8859-1   T=on  -rwxr-xr-x   1 ME    GROUP     1472 May  2 10:36 package.json

My guess: something interesting happened with node or the filesystem that caused it to move body-parser into the other location.

What version of node are you using?

bobbydixon commented 1 week ago

The client did not answer the question about what version of node they are using, but did carry out the following steps that resolved the error:

1) I paxed the entire working /appshare/4j00/zowe directory from a working system

the directory included :

-rwxr-xr-x 1 P4GROOT OMVSGRP 2350 Aug 27 09:36 DEVELOPERS.md
-rwxr-xr-x 1 P4GROOT OMVSGRP 3772 Aug 27 09:36 README.md
drwxr-xr-x 2 P4GROOT OMVSGRP 8192 Feb 3 2023 SMPE
-rwxr-xr-x 1 P4GROOT OMVSGRP 1512464 Jan 27 2023 ZWEPAX.20230127_105258.manifest.txt
-rwxr-xr-x 1 P4GROOT OMVSGRP 1537002 Jul 27 2023 ZWEPAX.20230727_143417.manifest.txt
-rwxr-xr-x 1 P4GROOT OMVSGRP 1541030 Sep 12 2023 ZWEPAX.20230912_105230.manifest.txt
-rwxr-xr-x 1 P4GROOT OMVSGRP 1544787 Mar 8 2024 ZWEPAX.20240308_122932.manifest.txt
-rwxr-xr-x 1 P4GROOT OMVSGRP 1541659 May 23 13:38 ZWEPAX.20240523_123218.manifest.txt
-rwxr-xr-x 1 P4GROOT OMVSGRP 1564448 Aug 27 09:46 ZWEPAX.20240827_084015.manifest.txt
drwxr-xr-x 5 P4GROOT OMVSGRP 8192 Aug 27 09:36 bin
-rwxr-xr-x 1 P4GROOT OMVSGRP 3631 Sep 20 2023 ca.cert
-rwxr-xr-x 1 P4GROOT OMVSGRP 1525 Mar 17 2023 ca.cert2
drwxr-xr-x 19 P4GROOT OMVSGRP 8192 Aug 27 09:46 components
-rwxr-xr-x 1 P4GROOT OMVSGRP 25951 Aug 27 09:36 example-zowe.yaml
drwxr-xr-x 2 P4GROOT OMVSGRP 8192 Nov 8 2023 extensions
drwxr-xr-x 7 P4GROOT OMVSGRP 8192 Aug 27 09:38 files
drwxr-xr-x 2 P4GROOT OMVSGRP 8192 Aug 27 09:39 fingerprint
drwxr-xr-x 2 P4GROOT OMVSGRP 8192 Aug 27 09:35 licenses
-rwxr-xr-x 1 P4GROOT OMVSGRP 3631 Mar 17 2023 localca.cer
drwxr-xr-x 2 P4JZWSTC OMVSGRP 8192 Oct 21 15:20 logs
-rwxr-xr-x 1 P4GROOT OMVSGRP 14213 Aug 27 09:36 manifest.json
drwxr-xr-x 2 P4GROOT OMVSGRP 8192 Aug 27 09:36 schemas
drwxrwx--- 7 P4JZWSTC OMVSGRP 8192 Oct 21 15:13 workspace
-rwxr-xr-x 1 P4GROOT OMVSGRP 4209 Oct 9 13:32 zowe.yaml

2) I then unpaxed the entire folder on DDEV,

3) zowe & zwin are now working on DDEV.