mfe- / get-the-solution

get-the-solution.net
http://www.get-the-solution.net
1 stars 11 forks source link

Production enviroment server side uses wrong url #78

Closed mfe- closed 7 months ago

mfe- commented 9 months ago

It looks like when opening for example https://get-the-solution.net/blog/Hands%20on%20-%20Azure%20Scale%20Sets it still downloads the blog.json in the browser and not on the server side.

From the Log Stream in the App Service we can obtain:

2023-12-17T18:51:31  Welcome, you are now connected to log-streaming service.
Starting Log Tail -n 10 of existing logs ----/appsvctmp/volatile/logs/runtime/cd2e556b7d9d8a2403234d8b6c3bc3b64e9c0d6da713f74480955bf56545cc63.log
2023-12-17T18:19:24.612851159Z: [ERROR]      cause: Error: connect ECONNREFUSED 127.0.0.1:4200
2023-12-17T18:19:24.612855759Z: [ERROR]          at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16) {
2023-12-17T18:19:24.612860260Z: [ERROR]        errno: -111,
2023-12-17T18:19:24.612864860Z: [ERROR]        code: 'ECONNREFUSED',
2023-12-17T18:19:24.612869360Z: [ERROR]        syscall: 'connect',
2023-12-17T18:19:24.612873960Z: [ERROR]        address: '127.0.0.1',
2023-12-17T18:19:24.612878561Z: [ERROR]        port: 4200
2023-12-17T18:19:24.612883161Z: [ERROR]      }
2023-12-17T18:19:24.612887661Z: [ERROR]    }
2023-12-17T18:19:24.612892162Z: [ERROR]  }/appsvctmp/volatile/logs/runtime/28177b2494c5f6eb66c9e5591b60eb4ad0ce06f3c2344d5af2973ef02bd1774b.log
2023-12-17T18:34:26.214604004Z: [ERROR]      data: ZoneAwarePromise [Promise] {
2023-12-17T18:34:26.214608404Z: [ERROR]        __zone_symbol__state: true,
2023-12-17T18:34:26.214612704Z: [ERROR]        __zone_symbol__value: undefined
2023-12-17T18:34:26.214617105Z: [ERROR]      },
2023-12-17T18:34:26.214621305Z: [ERROR]      scheduleFn: undefined,
2023-12-17T18:34:26.214625605Z: [ERROR]      cancelFn: undefined,
2023-12-17T18:34:26.214629905Z: [ERROR]      callback: [Function (anonymous)],
2023-12-17T18:34:26.214634306Z: [ERROR]      invoke: [Function (anonymous)]
2023-12-17T18:34:26.214638706Z: [ERROR]    }
2023-12-17T18:34:26.214643106Z: [ERROR]  }/appsvctmp/volatile/logs/runtime/16cdfd33e59ef0a64f63f14cd55e99d9f661b96e08bf17577042a56f7fb0957d.log
2023-12-17T18:38:58.865165539Z: [ERROR]      cause: Error: connect ECONNREFUSED 127.0.0.1:4200
2023-12-17T18:38:58.865170239Z: [ERROR]          at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16) {
2023-12-17T18:38:58.865175040Z: [ERROR]        errno: -111,
2023-12-17T18:38:58.865179740Z: [ERROR]        code: 'ECONNREFUSED',
2023-12-17T18:38:58.865184440Z: [ERROR]        syscall: 'connect',
2023-12-17T18:38:58.865189040Z: [ERROR]        address: '127.0.0.1',
2023-12-17T18:38:58.865193541Z: [ERROR]        port: 4200
2023-12-17T18:38:58.865198341Z: [ERROR]      }
2023-12-17T18:38:58.865202741Z: [ERROR]    }
2023-12-17T18:38:58.865207241Z: [ERROR]  }Ending Log Tail of existing logs ---Starting Live Log Stream ---
2023-12-17T18:51:46.371882257Z: [ERROR]  ERROR HttpErrorResponse {
2023-12-17T18:51:46.372274680Z: [ERROR]    headers: HttpHeaders {
2023-12-17T18:51:46.372287681Z: [ERROR]      normalizedNames: Map(0) {},
2023-12-17T18:51:46.372293981Z: [ERROR]      lazyUpdate: null,
2023-12-17T18:51:46.372299682Z: [ERROR]      headers: Map(0) {}
2023-12-17T18:51:46.372305082Z: [ERROR]    },
2023-12-17T18:51:46.372310582Z: [ERROR]    status: 0,
2023-12-17T18:51:46.372315483Z: [ERROR]    statusText: 'Unknown Error',
2023-12-17T18:51:46.372349785Z: [ERROR]    url: 'http://localhost:4200/assets/database/blog.json',
2023-12-17T18:51:46.372355485Z: [ERROR]    ok: false,
2023-12-17T18:51:46.372360885Z: [ERROR]    name: 'HttpErrorResponse',
2023-12-17T18:51:46.372366986Z: [ERROR]    message: 'Http failure response for http://localhost:4200/assets/database/blog.json: 0 undefined',
2023-12-17T18:51:46.372372486Z: [ERROR]    error: TypeError: fetch failed
2023-12-17T18:51:46.372377486Z: [ERROR]        at Object.fetch (node:internal/deps/undici/undici:11372:11)
2023-12-17T18:51:46.372383087Z: [ERROR]        at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
2023-12-17T18:51:46.372388587Z: [ERROR]      cause: Error: connect ECONNREFUSED 127.0.0.1:4200
2023-12-17T18:51:46.372394087Z: [ERROR]          at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16) {
2023-12-17T18:51:46.372430790Z: [ERROR]        errno: -111,
2023-12-17T18:51:46.372438690Z: [ERROR]        code: 'ECONNREFUSED',
2023-12-17T18:51:46.372454291Z: [ERROR]        syscall: 'connect',
2023-12-17T18:51:46.372459891Z: [ERROR]        address: '127.0.0.1',
2023-12-17T18:51:46.372465292Z: [ERROR]        port: 4200
2023-12-17T18:51:46.372470392Z: [ERROR]      }
2023-12-17T18:51:46.372475592Z: [ERROR]    }
2023-12-17T18:51:46.373082528Z: [ERROR]  }
mfe- commented 9 months ago

Test with curl -v https://get-the-solution.net/blog/Hands%20on%20-%20Azure%20Scale%20Sets is successful after PR #79 was merged . Still there must be an other solution to solve this

mfe- commented 7 months ago

It looks like resetting the baseuri="" in the enviroments is now handled correctly by the httpclient. This was done with the commit e9fd8c5a5ab0a86b2004bebed9e3a554876ebb34 . It may be also be resolved with #77