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 2022/04/14 09:18:56 UTC

[GitHub] [skywalking] warrmr opened a new issue, #8877: [Bug] skywalking-client-js not sending errors to OPM server

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

   ### 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 Client Side Agent (apache/skywalking-client-js)
   
   ### What happened
   
   When an error occurs in our vue app the skywalking client doesn't appear to report it to the skywalking dashboard. 
   
   It is discussed in this topic however I have done more troubleshooting today. 
   https://github.com/apache/skywalking/discussions/8723
   
   ### What you expected to happen
   
   If an error happens in our vue app the skywalking-client-js will report the error to the OPM server and the error will appear in the trace or the errors chart. 
   
   ![image](https://user-images.githubusercontent.com/393693/163353639-a060b66f-509a-4d4b-be23-950e979e7d9c.png)
   
   ![image](https://user-images.githubusercontent.com/393693/163353682-a442f61f-5134-41e3-a72a-d69a12626bbc.png)
   
   
   ### How to reproduce
   
   I have made a vue app with the following bits of code to activate skywalkings 
   
   main.js
   ```
   Vue.config.productionTip = false;
   Vue.config.errorHandler = (error) => {
       console.trace("Error Event Happened: ", error);
       ClientMonitor.reportFrameErrors(
           {
               collector: "https://skywalking",
               service: name,
               pagePath: router.currentRoute,
               serviceVersion: `v${version}`,
               vue: true,
           },
           error,
       );
   };
   ```
   
   router.js
   ```
   router.beforeEach(async (to, _from, next) => {
       ClientMonitor.setPerformance({
           collector: "https://skywalking",
           service: name,
           pagePath: to.path,
           serviceVersion: `v${version}`,
           useFmp: true,
           vue: true,
       });
   
       return next();
   });
   ```
   
   Page to make a fake error (Should be reported into skywalking dashboard.) 
   ```
   <template>
       <v-container fluid fill-height>
           <v-row>
               <v-col class="d-flex flex-column align-center justify-center text-center">
                   <h1>404: Page Not Found!</h1>
               </v-col>
           </v-row>
       </v-container>
   </template>
   
   <script>
   import axios from "axios";
   
   export default {
       created() {
           // Axios call to a non existent domain to make error in console log
           console.log("Making an Error");
           axios.get("https://domain.not.exist.com/error-page");
       },
   };
   </script>
   
   ```
   
   ![image](https://user-images.githubusercontent.com/393693/163354293-bc2eaa91-fe92-4a26-8e18-a83cd85808dc.png)
   
   The performance reports appear to be getting through just not the error reports. 
   ![image](https://user-images.githubusercontent.com/393693/163354381-80e49516-5fc3-4a93-ae1a-c5e9f9027e2c.png)
   
   
   
   
   ### Anything else
   
   Only when an error is thrown in the app, the errors and traces don't appear in the skywalking dashboard. 
   
   ### 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] warrmr commented on issue #8877: [Bug] skywalking-client-js not sending errors to OPM server

Posted by GitBox <gi...@apache.org>.
warrmr commented on issue #8877:
URL: https://github.com/apache/skywalking/issues/8877#issuecomment-1099931082

   > > Adding register seemed to do the trick :) There are two small problems now. The first is that the calls inside of the firebase/auth module are failing with the register function turned on. I assume this is because the nosniff flag in the headers is set and skywalking intercepts all calls.
   > > ![image](https://user-images.githubusercontent.com/393693/163426780-75e2d3ef-35dc-4c6f-ad07-3fa0ffaa8950.png)
   > 
   > @warrmr I can't understand this problem. As you register the `skywalking-client-js`, the firebase/auth module are failing. Is that what you mean?
   
   The app I am testing skywalking in uses firebase authentication as a login system https://firebase.google.com/docs/auth  If I comment out the register function my app works as expected but we dont get any traces in skywalking. but if I put in the register function then skywalking seems to stop firebase from making the calls back to google. 
   
   ```
   ClientMonitor.register({
       collector: "https://skywalking",
       service: name,
       pagePath: router.currentRoute.path,
       serviceVersion: `v${version}`,
   });
   ```
   
   Working good with ClientMonitor.register missing from the code (All the calls to google identity services work correctly) 
   ![image](https://user-images.githubusercontent.com/393693/163538815-bb61c1a0-9fd0-4201-9986-cf504a7aab93.png)
   
   Same app just with the ClientMonitor.register method added to main.js and firebase breaks and throws a host of errors. 
   ![image](https://user-images.githubusercontent.com/393693/163539827-33af2186-88d8-4689-a497-e9cc76daf341.png)
   
   
   To recreate setup a basic app with firebase registration and login, once you are logged in you should see the errors, if you turn off skywalking the errors go away. 
   
   
   


-- 
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 #8877: [Bug] skywalking-client-js not sending errors to OAP server

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

   > May I change this from a [BUG] to a [FEATURE] request please as my problems seem to be more me not understanding some of the properties in the register function and not knowing I needed to call that.
   
   If there is no BUG(or uncertain case) existing anymore, I could move this to the discussion panel, and close/lock this issue.


-- 
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 #8877: [Bug] skywalking-client-js not sending errors to OPM server

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

   Thanks for sharing a simple demo to reproduce the error


-- 
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] warrmr commented on issue #8877: [Bug] skywalking-client-js not sending errors to OPM server

Posted by GitBox <gi...@apache.org>.
warrmr commented on issue #8877:
URL: https://github.com/apache/skywalking/issues/8877#issuecomment-1099110246

   Just tried adding the register method call to main.js and its giving errors still. 
   
   when I have main.js like this I get the following errors. 
   ```
   import Vue from "vue";
   import IdleVue from "idle-vue";
   import ClientMonitor from "skywalking-client-js";
   import App from "./App.vue";
   import router from "./router";
   import store from "./store";
   import vuetify from "./plugins/vuetify";
   import i18n from "./i18n";
   import "./registerServiceWorker";
   import { name, version } from "../package.json";
   
   console.info(`App Version: ${version}`);
   
   Vue.config.productionTip = false;
   ClientMonitor.register({
       collector: "https://skywalking",
       service: name,
       pagePath: router.currentRoute,
       serviceVersion: `v${version}`,
       vue: true,
   });
   
   Vue.config.errorHandler = (error) => {
       console.trace("Error Event Happened: ", error);
       ClientMonitor.reportFrameErrors(
           {
               collector: "https://skywalking",
               service: name,
               pagePath: router.currentRoute,
               serviceVersion: `v${version}`,
               vue: true,
           },
           error,
       );
   };
   
   Vue.use(IdleVue, {
       eventEmitter: new Vue(),
       idleTime: 10000,
   });
   
   new Vue({
       router,
       store,
       vuetify,
       i18n,
       render: (h) => h(App),
   }).$mount("#app");
   ```
   ![image](https://user-images.githubusercontent.com/393693/163385813-85a2242a-d0e1-416b-8c22-e9de2dd77845.png)
   
   
   
   When I have the main.js like this I get these errors. 
   ```
   import Vue from "vue";
   import IdleVue from "idle-vue";
   import ClientMonitor from "skywalking-client-js";
   import App from "./App.vue";
   import router from "./router";
   import store from "./store";
   import vuetify from "./plugins/vuetify";
   import i18n from "./i18n";
   import "./registerServiceWorker";
   import { name, version } from "../package.json";
   
   console.info(`App Version: ${version}`);
   
   Vue.config.productionTip = false;
   Vue.config.errorHandler = (error) => {
       console.trace("Error Event Happened: ", error);
       ClientMonitor.reportFrameErrors(
           {
               collector: "https://skywalking",
               service: name,
               pagePath: router.currentRoute,
               serviceVersion: `v${version}`,
               vue: true,
           },
           error,
       );
   };
   
   ClientMonitor.register({
       collector: "https://skywalking",
       service: name,
       pagePath: router.currentRoute,
       serviceVersion: `v${version}`,
       vue: true,
   });
   
   Vue.use(IdleVue, {
       eventEmitter: new Vue(),
       idleTime: 10000,
   });
   
   new Vue({
       router,
       store,
       vuetify,
       i18n,
       render: (h) => h(App),
   }).$mount("#app");
   ```
   ![image](https://user-images.githubusercontent.com/393693/163385106-5412d5d9-bc85-447f-8ed3-c5a1019fe202.png)
   


-- 
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] Fine0830 commented on issue #8877: [Bug] skywalking-client-js not sending errors to OPM server

Posted by GitBox <gi...@apache.org>.
Fine0830 commented on issue #8877:
URL: https://github.com/apache/skywalking/issues/8877#issuecomment-1100024717

   > @Fine0830 I think this may be caused by 3rd party SAAS services, like Google's, they put some rules about this for security, and out of users' control. From SkyWalking perspective, we should expose some APIs to set URL whitelist which could not be traced(no header injection, and only span sending out or not). WDYT?
   
   This is a nice way. Here we have provided the API, it is `noTraceOrigins`. @warrmr 
   


-- 
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 #8877: [Bug] skywalking-client-js not sending errors to OPM server

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

   > If you send the wrong value into the pagePath then you can crash the OPM server but I will make a discussion topic on that.
   
   It will crash the OAP server? How?


-- 
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] Fine0830 commented on issue #8877: [Bug] skywalking-client-js not sending errors to OPM server

Posted by GitBox <gi...@apache.org>.
Fine0830 commented on issue #8877:
URL: https://github.com/apache/skywalking/issues/8877#issuecomment-1099800709

   > Adding register seemed to do the trick :) There are two small problems now. The first is that the calls inside of the firebase/auth module are failing with the register function turned on. I assume this is because the nosniff flag in the headers is set and skywalking intercepts all calls.
   > 
   > ![image](https://user-images.githubusercontent.com/393693/163426780-75e2d3ef-35dc-4c6f-ad07-3fa0ffaa8950.png)
   > 
   
   @warrmr I can't understand this problem. As you register the `skywalking-client-js`, the firebase/auth module are failing. Is that what you mean?
   
   


-- 
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 #8877: [Bug] skywalking-client-js not sending errors to OPM server

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

   @Fine0830  I think this may be caused by 3rd party SAAS services, like Google's, they put some rules about this for security, and out of users' control. From SkyWalking perspective, we should expose some APIs to set URL whitelist which could not be traced(no header injection, and only span sending out or not). WDYT?


-- 
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] Fine0830 commented on issue #8877: [Bug] skywalking-client-js not sending errors to OPM server

Posted by GitBox <gi...@apache.org>.
Fine0830 commented on issue #8877:
URL: https://github.com/apache/skywalking/issues/8877#issuecomment-1098955819

   Looks like you didn't use the `register ` function in your application. @warrmr 


-- 
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 #8877: [Bug] skywalking-client-js not sending errors to OPM server

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

   CORS policy is included in the doc. It is not SkyWalking's special requirement, it is from HTTPS.


-- 
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] warrmr commented on issue #8877: [Bug] skywalking-client-js not sending errors to OPM server

Posted by GitBox <gi...@apache.org>.
warrmr commented on issue #8877:
URL: https://github.com/apache/skywalking/issues/8877#issuecomment-1099949808

   > 
   
   Massive exception when bad data is sent to the back end server 
   ![image](https://user-images.githubusercontent.com/393693/163544262-6c38c9c1-6280-4300-a3b0-6fe89c1c6ed6.png)
   


-- 
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] Fine0830 commented on issue #8877: [Bug] skywalking-client-js not sending errors to OPM server

Posted by GitBox <gi...@apache.org>.
Fine0830 commented on issue #8877:
URL: https://github.com/apache/skywalking/issues/8877#issuecomment-1099794058

   > > @warrmr I found it out. The `vue: true,` is wrong. Please check the parameter types [here](https://github.com/apache/skywalking-client-js#parameters)
   > > BTY, there's no need to set value for `vue` filed in your case.
   > 
   > Just checked that link and the table shows vue as an option. not sure if the documentation needs an update? ![image](https://user-images.githubusercontent.com/393693/163444180-e06673ea-56dc-4da2-b290-82b1a5ae1d80.png)
   
   No, it's an option. Here provides two ways to catch vue errors.  The first is 
   
   `ClientMonitor.register({
       collector: "https://skywalking",
       service: 'test-ui',
       pagePath: 'index.html',
       serviceVersion: 'v1.0.0',
       vue: Vue,
   });`
   
   The second is 
   `
   ClientMonitor.reportFrameErrors(
           {
               collector: "https://skywalking",
               service: 'test-ui',
               pagePath: 'index.html',
               serviceVersion: 'v1.0.0',
           },
           error,
       );
   `
   


-- 
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] warrmr commented on issue #8877: [Bug] skywalking-client-js not sending errors to OAP server

Posted by GitBox <gi...@apache.org>.
warrmr commented on issue #8877:
URL: https://github.com/apache/skywalking/issues/8877#issuecomment-1101882187

   > > May I change this from a [BUG] to a [FEATURE] request please as my problems seem to be more me not understanding some of the properties in the register function and not knowing I needed to call that.
   > 
   > If there is no BUG(or uncertain case) existing anymore, I could move this to the discussion panel, and close/lock this issue.
   
   Yes by all means move it to discussion please :)  I would like to get opintion if it is possible to respect the https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options nosniff header and make some of this automatic/improve tracing for security sensive APIs. 
   This would need prototyping as I am not sure if it is possible to read that header and exit out without breaking the request. Would you like me to make a demo or is this something that you are able to test ? 
   


-- 
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] warrmr commented on issue #8877: [Bug] skywalking-client-js not sending errors to OPM server

Posted by GitBox <gi...@apache.org>.
warrmr commented on issue #8877:
URL: https://github.com/apache/skywalking/issues/8877#issuecomment-1099328486

   Adding register seemed to do the trick :) There are two small problems now. The first is that the calls inside of the firebase/auth module are failing with the register function turned on.  I assume this is because the nosniff flag in the headers is set and skywalking intercepts all calls. 
   
   ![image](https://user-images.githubusercontent.com/393693/163426780-75e2d3ef-35dc-4c6f-ad07-3fa0ffaa8950.png)
   
   The other issue is that when you first load the app router.currentRoute, is an object of the route but once the router has loaded its is a string eg /error. When it is an object the OPM server crashes and sends error 500. This sounds more like a me problem as I am sending invalid data into the pagePath property. To get around this I am using window.location.path instead. 
   
   


-- 
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] Fine0830 commented on issue #8877: [Bug] skywalking-client-js not sending errors to OPM server

Posted by GitBox <gi...@apache.org>.
Fine0830 commented on issue #8877:
URL: https://github.com/apache/skywalking/issues/8877#issuecomment-1099150288

   @warrmr I found it out.  The `vue: true,` is wrong. Please check the parameter types [here](https://github.com/apache/skywalking-client-js#parameters )
   
   BTY, there's no need to set value for `vue` filed  in your case.
   
   


-- 
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] warrmr commented on issue #8877: [Bug] skywalking-client-js not sending errors to OPM server

Posted by GitBox <gi...@apache.org>.
warrmr commented on issue #8877:
URL: https://github.com/apache/skywalking/issues/8877#issuecomment-1099916971

   > > > @warrmr I found it out. The `vue: true,` is wrong. Please check the parameter types [here](https://github.com/apache/skywalking-client-js#parameters)
   > > > BTY, there's no need to set value for `vue` filed in your case.
   > > 
   > > 
   > > Just checked that link and the table shows vue as an option. not sure if the documentation needs an update? ![image](https://user-images.githubusercontent.com/393693/163444180-e06673ea-56dc-4da2-b290-82b1a5ae1d80.png)
   > 
   > No, it's an option. Here provides two ways to catch vue errors. The first is
   > 
   > `ClientMonitor.register({ collector: "https://skywalking", service: 'test-ui', pagePath: 'index.html', serviceVersion: 'v1.0.0', vue: Vue, });`
   > 
   > The second is `ClientMonitor.reportFrameErrors( { collector: "https://skywalking", service: 'test-ui', pagePath: 'index.html', serviceVersion: 'v1.0.0', }, error, );`
   
   Thanks, Now I understand appreciate the responses. 


-- 
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] warrmr commented on issue #8877: [Bug] skywalking-client-js not sending errors to OPM server

Posted by GitBox <gi...@apache.org>.
warrmr commented on issue #8877:
URL: https://github.com/apache/skywalking/issues/8877#issuecomment-1099919352

   > > The other issue is that when you first load the app router.currentRoute, is an object of the route but once the router has loaded its is a string eg /error. When it is an object the OPM server crashes and sends error 500. This sounds more like a me problem as I am sending invalid data into the pagePath property. To get around this I am using window.location.path instead.
   > 
   > Feel free to set `pagePath` value according to your scenario.
   
   Yeah this was a me problem :) If you send the wrong value into the pagePath then you can crash the OPM server but I will make a discussion topic on that. 


-- 
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] warrmr commented on issue #8877: [Bug] skywalking-client-js not sending errors to OPM server

Posted by GitBox <gi...@apache.org>.
warrmr commented on issue #8877:
URL: https://github.com/apache/skywalking/issues/8877#issuecomment-1099952066

   > CORS policy is included in the doc. It is not SkyWalking's special requirement, it is from HTTPS.
   
   CORS is all working for both skywalking and the app, what I don't understand is when dont have skywalking register method in the app our firebase works well and has no issues. When I add skywalking to our app then firebase breaks and complains of cors errors. The only thing I can sugguest is the way Skywalking is handling the XHR requests in modifying something that google is looking for in the http headers and is being blocked (some security setting) 
   
   
   Does skywalking client respect the nosniff header of the HTTP request or does it intercept all requests.  I wont be able to do any more tests until Monday now but would appreciate it if you would setup a demo on your side and test with firebase as im confident this is a skywalking issue. 


-- 
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] Fine0830 commented on issue #8877: [Bug] skywalking-client-js not sending errors to OPM server

Posted by GitBox <gi...@apache.org>.
Fine0830 commented on issue #8877:
URL: https://github.com/apache/skywalking/issues/8877#issuecomment-1100018652

   > > CORS policy is included in the doc. It is not SkyWalking's special requirement, it is from HTTPS.
   > 
   > CORS is all working for both skywalking and the app, what I don't understand is when dont have skywalking register method in the app our firebase works well and has no issues. When I add skywalking to our app then firebase breaks and complains of cors errors. The only thing I can sugguest is the way Skywalking is handling the XHR requests in modifying something that google is looking for in the http headers and is being blocked (some security setting)
   > 
   > Does skywalking client respect the nosniff header of the HTTP request or does it intercept all requests. I wont be able to do any more tests until Monday now but would appreciate it if you would setup a demo on your side and test with firebase as im confident this is a skywalking issue.
   
   
   I found the cause of the problem. I noticed your requests aren't simple requests, so the requests would trigger a [CORS preflight](https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request). The preflight request  is a [CORS](https://developer.mozilla.org/en-US/docs/web/http/cors#examples_of_access_control_scenarios) request that checks to see if the CORS protocol is understood and a server is aware using specific methods and headers.
   When the `skywalking-client-js` set trace parameters in your app requests header, the preflight request status code is 403. As your preflight requests are fail, CORS happened here.
   
   From my perspective, your server don't allow you to customize parameter in the http header and you should resolve this problem.
   


-- 
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] warrmr commented on issue #8877: [Bug] skywalking-client-js not sending errors to OAP server

Posted by GitBox <gi...@apache.org>.
warrmr commented on issue #8877:
URL: https://github.com/apache/skywalking/issues/8877#issuecomment-1101870619

   > From my perspective, your server don't allow you to customize parameter in the http header and you should resolve this problem.
   
   > @Fine0830 I think this may be caused by 3rd party SAAS services, like Google's, they put some rules about this for security, and out of users' control. From SkyWalking perspective, we should expose some APIs to set URL whitelist which could not be traced(no header injection, and only span sending out or not). WDYT?
   
   You are both correct, Google doesn't allow the modification of the headers for security and I have since found out that the skywalking-client-js adds a sw8 header to the outbound requests with a trace ID and segment ID adding this to the register call worked :) `noTraceOrigins: [/.*googleapis.*/, /.*firebaseapp.*/],` Thankyou. 
   
   @wu-sheng May I change this from a [BUG] to a [FEATURE] request please as my problems seem to be more me not understanding some of the properties in the register function and not knowing I needed to call that. 
   
   @Fine0830 I am not sure if this is possible but somewhere in the xhr.ts read event.details.requestHeaders("X-Content-Type-Options") and if it matches "nosniff" then don't modify the header and do the same as you do with `noTraceOrigins` ? I am happy to run a test version for you if that would help. 
   
   https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options
   
   Thanks Again guys I really appreciate the helps. 


-- 
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] warrmr commented on issue #8877: [Bug] skywalking-client-js not sending errors to OPM server

Posted by GitBox <gi...@apache.org>.
warrmr commented on issue #8877:
URL: https://github.com/apache/skywalking/issues/8877#issuecomment-1099055207

   > Looks like you didn't use the `register ` function in your application. @warrmr
   
   Let me try that and I will get back to you, thanks. Wasn't sure If i needed to use register if I am using setPerformance as the documentation implies register is for if you are using auto reporting for SPAs. 
   
   Thanks for the speedy replys. 


-- 
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] warrmr commented on issue #8877: [Bug] skywalking-client-js not sending errors to OPM server

Posted by GitBox <gi...@apache.org>.
warrmr commented on issue #8877:
URL: https://github.com/apache/skywalking/issues/8877#issuecomment-1099460760

   > @warrmr I found it out. The `vue: true,` is wrong. Please check the parameter types [here](https://github.com/apache/skywalking-client-js#parameters)
   > 
   > BTY, there's no need to set value for `vue` filed in your case.
   
   Just checked that link and the table shows vue as an option. not sure if the documentation needs an update? 
   ![image](https://user-images.githubusercontent.com/393693/163444180-e06673ea-56dc-4da2-b290-82b1a5ae1d80.png)
   


-- 
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] Fine0830 commented on issue #8877: [Bug] skywalking-client-js not sending errors to OPM server

Posted by GitBox <gi...@apache.org>.
Fine0830 commented on issue #8877:
URL: https://github.com/apache/skywalking/issues/8877#issuecomment-1099795442

   
   > The other issue is that when you first load the app router.currentRoute, is an object of the route but once the router has loaded its is a string eg /error. When it is an object the OPM server crashes and sends error 500. This sounds more like a me problem as I am sending invalid data into the pagePath property. To get around this I am using window.location.path instead.
   
   Feel free to set `pagePath` value according to your scenario.
   
   


-- 
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 #8877: [Bug] skywalking-client-js not sending errors to OPM server

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

   > > 
   > 
   > Massive exception when bad data is sent to the back end server ![image](https://user-images.githubusercontent.com/393693/163544262-6c38c9c1-6280-4300-a3b0-6fe89c1c6ed6.png)
   
   Exception stack is expected. You could change log4j2.xml to hide them.


-- 
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