sitecorelabs / xmcloud-foundation-head-dev

19 stars 172 forks source link

RestDictionaryService issue #88

Closed alan-null closed 1 year ago

alan-null commented 1 year ago

Maybe I am missing something but for now it looks like it's not working correctly.

From what I see now when dictionary operates in REST mode (haven't checked GQL) it uses URL assigned at app start. image

Registering site-resolver plugin multisite
Writing site-resolver plugins to /app/src/temp/site-resolver-plugins.ts
generateConfig
{
  sitecoreApiKey: '77D084BD-aaaa-zzzz-xxxx-1BECBEE7DFEA',
  sitecoreApiHost: 'http://sxademoorg-alpl-alpltest-s',
  jssAppName: undefined,
  graphQLEndpointPath: undefined,
  defaultLanguage: '',
  graphQLEndpoint: 'http://sxademoorg-alpl-alpltest-s/sitecore/api/graph/edge'
}
Registering JSS component CdpPageView
Registering JSS component ColumnSplitter

notice sitecoreApiHost value.

Compare it with URL that I use to access Content Editor

https://xmc-sxademoorg-alpl-alpltest-s.sitecore-staging.cloud/
http://sxademoorg-alpl-alpltest-s

No idea what was the intention - maybe this URL is accessible via internal network cm<->rendering host but it cannot be used outside (rest call delegated by RH to the browser)

Additional info: During debugging I found something like this - GQL call

plugin
MultisitePlugin { order: 3 }
Fetching site information from http://sxademoorg-alpl-alpltest-s/sitecore/api/graph/edge
config after 
Promise { <pending> }
Error fetching site information
FetchError: request to http://sxademoorg-alpl-alpltest-s/sitecore/api/graph/edge failed, reason: connect ECONNREFUSED 10.0.140.241:80
    at ClientRequest.<anonymous> (/app/node_modules/@sitecore-jss/sitecore-jss/node_modules/node-fetch/lib/index.js:1491:11)
    at ClientRequest.emit (node:events:527:28)
    at ClientRequest.emit (node:domain:475:12)
    at Socket.socketErrorListener (node:_http_client:454:9)
    at Socket.emit (node:events:527:28)
    at Socket.emit (node:domain:475:12)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  type: 'system',
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED'
}
plugin
ComputedPlugin { order: 10 }
ambrauer commented 1 year ago

@MaksymChornyi @iamandycohen I assume http://sxademoorg-alpl-alpltest-s above is the internal network host name. Is there a reason we are using this for SITECORE_API_HOST instead of the external https://xmc-sxademoorg-alpl-alpltest-s.sitecore-staging.cloud? Can we switch it?

Though I think the problem then (@MaksymChornyi correct me if I'm wrong) is that server-side (REST/GQL) calls wouldn't work.

alan-null commented 1 year ago

Hey @ambrauer Any updates?

ambrauer commented 1 year ago

Hey @ambrauer Any updates?

@MaksymChornyi ?

MaksymChornyi commented 1 year ago

Hey. Sorry for late reply. It is fixed. It will be available next week

ambrauer commented 1 year ago

Thanks @MaksymChornyi. Closing this one then. @alan-null Let us know if this is still an issue after next week.

alan-null commented 1 year ago

Works fine now. Thanks @ambrauer and @MaksymChornyi .