Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@opentelemetry/auto-instrumentations-node@0.39.2 unit tests are failing #2324

Open
swaruparameshpajju opened this issue Jul 10, 2024 · 4 comments
Labels
bug Something isn't working information-requested needs:reproducer This bug/feature is in need of a minimal reproducer triage

Comments

@swaruparameshpajju
Copy link

What happened?

2024-07-10 10:40:58,968 [ INFO ] oos_automation.build.@opentelemetry/auto-instrumentations-node@0.39.2 | log_utils.py | 175 :: Environment
+----------------------+------------------------------------------------------------------------------------------------------+
| ENV | VALUE |
|----------------------+------------------------------------------------------------------------------------------------------|
| PACKAGE | @opentelemetry/auto-instrumentations-node@0.39.2 |
| LANGUAGE | node |
| FRAMEWORK | node |
| BUILD_CMD | npm run build |
| OS_NAME | Oracle Linux Server |
| OS_VERSION | 8.8 |
| COMPILER/INTERPRETER | node |
| PYTHON_VERSION | 3.9.6 |
| JAVA_VERSION | 1.8.0_382 |
| MAVEN_VERSION | 3.9.4 |
| GRADLE_VERSION | 8.2.1 |
| ANT_VERSION | 1.10.14 |
| NODE_VERSION | 16.20.2 |
| CPP_VERSION | 8.5.0 |
| GO_VERSION | go1.22.0 |
| CARGO_VERSION | 1.75.0 |
| HTTP_PROXY | www-proxy.us.oracle.com |
| HTTPS_PROXY | www-proxy.us.oracle.com |
| JAVA_HOME | /opt/jdk8u382-b05 |
| PATH | /opt/node-v16.20.2-linux-x64/bin:/opt/jdk8u382-b05/bin:/opt/apache-ant-1.10.14/bin:/opt/apache-maven |
| | -3.9.4/bin:/opt/gradle-8.2.1/bin:/opt/sbt/bin:/opt/python3.9/bin:/opt/node-v16.20.2-linux-x64/bin:/o |
| | pt/go1.22.0/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
+----------------------+------------------------------------------------------------------------------------------------------+
2024-07-10 10:40:58,968 [ DEBUG ] oos_automation.build.@opentelemetry/auto-instrumentations-node@0.39.2 | package.py | 679 :: Current dir: /builds/5G-Common/cnc-opensource/cnc-opensource-build
2024-07-10 10:40:58,968 [ INFO ] oos_automation.build.@opentelemetry/auto-instrumentations-node@0.39.2 | package.py | 831 :: Got some command in build cmds, executing it
2024-07-10 10:40:58,969 [ DEBUG ] oos_automation.build.@opentelemetry/auto-instrumentations-node@0.39.2 | cmd.py | 51 :: version='1', cmd_type='live', running command=npm run build, supress_exception=True
2024-07-10 10:40:58,976 [ INFO ] oos_automation.build.@opentelemetry/auto-instrumentations-node@0.39.2 | cmd.py | 62 :: Waiting for cmd out...
[10 10:40:59.505] | npm WARN config _auth, _authToken, username and _password must be scoped to a registry. see npm help npmrc for more information.
[10 10:40:59.529] | npm ERR! Missing script: "build"
[10 10:40:59.529] | npm ERR!
[10 10:40:59.529] | npm ERR! To see a list of scripts, run:
[10 10:40:59.529] | npm ERR! npm run
[10 10:40:59.531] |
[10 10:40:59.532] | npm ERR! A complete log of this run can be found in:
[10 10:40:59.532] | npm ERR! /root/.npm/_logs/2024-07-10T10_40_59_465Z-debug-0.log

OpenTelemetry Setup Code

No response

package.json

No response

Relevant log output

[10 10:44:48.425] | Version 4.4.4
[10 10:44:48.425] | 
[10 10:44:48.425] | > @opentelemetry/sql-common@0.40.0 compile
[10 10:44:48.425] | > tsc --build tsconfig.json
[10 10:44:56.168] | lerna ERR! lifecycle "prepare" errored in "@opentelemetry/contrib-test-utils", exiting 1
[10 10:44:56.210] | npm ERR! code 1
[10 10:44:56.210] | npm ERR! path /tmp/pkgs_raw/@opentelemetry+auto-instrumentations-node/0.39.2
[10 10:44:56.214] | npm ERR! command failed
[10 10:44:56.214] | npm ERR! command sh -c -- npm run bootstrap
[10 10:44:56.216] | 
[10 10:44:56.216] | npm ERR! A complete log of this run can be found in:
[10 10:44:56.216] | npm ERR!     /root/.npm/_logs/2024-07-10T10_41_03_237Z-debug-0.log
2024-07-10 10:44:56,247 [ WARNING  ] oos_automation.build.@opentelemetry/auto-instrumentations-node@0.39.2 | cmd.py                | 80     ::  Command failed but supress is true, error handling skipped
2024-07-10 10:44:56,247 [  ERROR   ] oos_automation.build.@opentelemetry/auto-instrumentations-node@0.39.2 | tester.py             | 110    ::  Package install failed for testing
2024-07-10 10:44:56,247 [   INFO   ] oos_automation.build.@opentelemetry/auto-instrumentations-node@0.39.2 | package.py            | 1449   ::  Tests Complete
2024-07-10 10:44:56,248 [   INFO   ] oos_automation.build.@opentelemetry/auto-instrumentations-node@0.39.2 | main_v2.py            | 377    ::  Total Test time: 3.89 minutes
@swaruparameshpajju swaruparameshpajju added bug Something isn't working triage labels Jul 10, 2024
@JamieDanielson
Copy link
Member

@swaruparameshpajju can you provide some more detail about how this error came up? Is there a way we can reproduce this to understand what may need to be changed?

@JamieDanielson JamieDanielson added the needs:reproducer This bug/feature is in need of a minimal reproducer label Jul 10, 2024
@JamieDanielson JamieDanielson transferred this issue from open-telemetry/opentelemetry-js Jul 10, 2024
@JamieDanielson
Copy link
Member

Also it looks like you are using an older version; are you able to try the latest version to see if you still have trouble?

@swaruparameshpajju
Copy link
Author

Hi, need to use same version. can u suggest how to go ahead to resolve

@david-luna
Copy link
Contributor

Hi @swaruparameshpajju

I agree with @JamieDanielson. You should try to update the package.

Maybe I'm going to do a lot of assumptions. It would be good if you can confirm them.

  • This logs seems from a build or CI tool which is written in python and not JS
  • The tool is doing a checkout of opentelemtry-js-contrib then runs some scripts
  • Also the checkout is from a specific tag auto-instrumentations-node@0.39.2

Based on that the the somple npm install script fails because of the following.

  • after install there is a postinstall script that bootstraps lerna
  • that bootstrap process compiles all modules and the @opentelemetry/contrib-test-utils fails

We see this log

[10 10:44:56.168] | lerna ERR! lifecycle "prepare" errored in "@opentelemetry/contrib-test-utils", exiting 1

and prepare script s doing a compilation

I've checked out the same TAG auto-instrumentations-node-v0.39.2 and got a similar compilation issue in the npm install process. Here is the output

> @opentelemetry/contrib-test-utils@0.34.1 compile
> tsc -p .

src/resource-assertions.ts:201:20 - error TS2339: Property 'NAME' does not exist on type '{ "telemetry.sdk.name": string; "process.runtime.name": string; "telemetry.sdk.language": string; "telemetry.sdk.version": string; }'.

201     name: SDK_INFO.NAME,
                       ~~~~

src/resource-assertions.ts:202:24 - error TS2339: Property 'LANGUAGE' does not exist on type '{ "telemetry.sdk.name": string; "process.runtime.name": string; "telemetry.sdk.language": string; "telemetry.sdk.version": string; }'.

202     language: SDK_INFO.LANGUAGE,
                           ~~~~~~~~

src/resource-assertions.ts:203:23 - error TS2339: Property 'VERSION' does not exist on type '{ "telemetry.sdk.name": string; "process.runtime.name": string; "telemetry.sdk.language": string; "telemetry.sdk.version": string; }'.

203     version: SDK_INFO.VERSION,
                          ~~~~~~~

Problem here is that @opentelemetry/core did change the property names if the SDK_INFO object in https://github.com/open-telemetry/opentelemetry-js/pull/2173/files#diff-7c29fd1242f26460e18708792e9636800d9f1f7320de3ef32609454df4dfca92 and npm installs a more recent version which contains this change. That was before v1.0.0 was released

So the @opentelemetry/contrib-test-utils declares a dependency of @opentelemetry/core@^1.0.0 but is using types from a previous release. There isn't an easy solution for that so I strongly recommend the update.

May I ask why exactly you need that version? And why do you have to build it by yourself since its already available in npm registry?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working information-requested needs:reproducer This bug/feature is in need of a minimal reproducer triage
Projects
None yet
Development

No branches or pull requests

3 participants