You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2023/01/10 03:06:25 UTC

[GitHub] [skywalking] KkZsc opened a new issue, #10253: [Bug]

KkZsc opened a new issue, #10253:
URL: https://github.com/apache/skywalking/issues/10253

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Apache SkyWalking Component
   
   NodeJS Server Side Agent (apache/skywalking-nodejs)
   
   ### What happened
   
   When `skywalking-nodejs` is used in the project, `mongoose` will have errors like this:
   `dict_info_1.default.findOne(...).lean is not a function`.
   and the source code is like this:
   `const result = await DictInfoModel.findOne({ dict_key: 'xxx' }).lean().exec();`
   
   I tried to browse through the `skywalking-nodejs` code and found that there is a piece of code like this in the [MongoosePlugin.ts](https://github.com/apache/skywalking-nodejs/blob/master/src/plugins/MongoosePlugin.ts#L133) file:
   ```
   if (!hasCB) {
     if (ret && typeof ret.then === 'function') {
       // generic Promise check
       ret = wrapPromise(span, ret);
     } else {
       // no callback passed in and no Promise or Cursor returned, play it safe
       span.stop();
   
       return ret;
     }
   }
   ```
   `ret` is changed to `Promise` at `ret = wrapPromise(span, ret);`, no longer has `mongoose` methods.
   
   And this is the version information I use:
   mongoose: ^4.7.3
   skywalking-nodejs: 0.6.0
   
   ### What you expected to happen
   
   `mongoose` can run correctly
   
   ### How to reproduce
   
   1. Create a project using mongoose
   2. Install `skywalking-nodejs`
   3. Write `mongoose` query code: `tableName.findOne().lean().exec()`
   4. Run app and will see an error in the console
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng commented on issue #10253: [Bug] mongoose run error in skywalking-nodejs

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on issue #10253:
URL: https://github.com/apache/skywalking/issues/10253#issuecomment-1685999092

   No update for months. If someone hows to fix, we are open to review the PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] bangbang93 commented on issue #10253: [Bug] mongoose run error in skywalking-nodejs

Posted by "bangbang93 (via GitHub)" <gi...@apache.org>.
bangbang93 commented on issue #10253:
URL: https://github.com/apache/skywalking/issues/10253#issuecomment-1442662270

   `skywalking-backend-js` breaks mongoose chain call api, maybe should hook `.exe()` rather than the function itself?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] code-farmer-i commented on issue #10253: [Bug] mongoose run error in skywalking-nodejs

Posted by "code-farmer-i (via GitHub)" <gi...@apache.org>.
code-farmer-i commented on issue #10253:
URL: https://github.com/apache/skywalking/issues/10253#issuecomment-1508302877

   I had the same problem
   
   ```js
   model.find().sort()
   ```
   
   ```.find(...).sort is not a function```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng commented on issue #10253: [Bug]

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #10253:
URL: https://github.com/apache/skywalking/issues/10253#issuecomment-1376674193

   Please update a proper title.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] Yuliang-Lee commented on issue #10253: [Bug] mongoose run error in skywalking-nodejs

Posted by "Yuliang-Lee (via GitHub)" <gi...@apache.org>.
Yuliang-Lee commented on issue #10253:
URL: https://github.com/apache/skywalking/issues/10253#issuecomment-1503030508

    a  disaster problem,  is there any progress?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng closed issue #10253: [Bug] mongoose run error in skywalking-nodejs

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng closed issue #10253: [Bug] mongoose run error in skywalking-nodejs
URL: https://github.com/apache/skywalking/issues/10253


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org