ui5-language-assistant icon indicating copy to clipboard operation
ui5-language-assistant copied to clipboard

Direct access to "https://ui5.sap.com/version.json" over middleware

Open hauntedhill opened this issue 1 year ago • 5 comments

Hi,

i have no direct connection to the web in my environment. Because of that i used the parameter for setting a local webserver. This works fine in the last versions.

Now i get an error that the plugin can not access the "SAPUI5 SDK". In the logs i found errors multiple times that the plugin can not access "https://ui5.sap.com/version.json" (ENOTFOUND).

It is possible to make the host configurable like the sapui5webserver? Or maybe the request use the sapui5webserver parameter as the host?

Another option is to ignore this error if the sapui5webserver parameter is set because the user have only one available ui5 version :)

Thanks and Regards

Haunted

hauntedhill avatar Mar 07 '25 09:03 hauntedhill

Dear @hauntedhill To understand the problem, is it that UI5-LA tool is not working or we only get this "https://ui5.sap.com/version.json" (ENOTFOUND) log and should not appear?

If UI5-LA tool is not working, can you please cross check that local web server is up and running? In my case for instance it looks like this

Image

and user setting is correctly maintained in

Image

in setting.json it should look like "UI5LanguageAssistant.SAPUI5WebServer": "http://localhost:3000"

For me with that setup, it works. It loads resource over local web server. I only see one time request https://ui5.sap.com/version.json and see this error in log

{
  "error": {
    "code": "ETIMEDOUT",
    "errno": "ETIMEDOUT",
    "message": "request to https://ui5.sap.com/version.json failed, reason: ",
    "type": "system"
  },
  "label": "@ui5-language-assistant/context",
  "level": "debug",
  "message": "getContext failed:",
  "time": "2025-03-07T15:17:59.848Z"
}

but UI5-LA tool should work. To avoid that http call, yes that is another enhancement.

In case you need help on how to setup local server: please refer to https://github.com/SAP/ui5-language-assistant/tree/master/examples/sap-ui5-web-server

marufrasully avatar Mar 07 '25 15:03 marufrasully

Dear marufrasully,

Thank you for the respone.

Yes the plugin exit with the error message "SAPUI5 SDK is not accessible. Connect to the internet or setup local web server for offline work."

In the settings i set my local webserver (user settings and workspace settings).

I set the Logging:Level to "trace" and the Trace:Server to "verbose" but i cant find any exception with the url of my local web server. I can only find request to the ui5.sap.com/versions.json. Do you have an hint for me where i can find the error message for the request to access the SDK?

Thanks and Regards

Haunted

hauntedhill avatar Mar 10 '25 08:03 hauntedhill

Dear @hauntedhill

This error notification may appears one time

Image but UI5 LA tool still works. You can ignore it for now. That is another enhancement/fix for later.

For settings it is enough to maintain only user settings. This is what I have.

Image

You must make sure that your local web server is responding to min ui5 version maintain in manifest.json file. This is very important. Like this

Image

To see details of communication happening in the background, you need to open output window, View > Output See documentation https://learn.microsoft.com/en-us/visualstudio/ide/reference/output-window?view=vs-2022 And select UI5 Language Assistant as in this photo

Image

If you are interested in code, you can set a break point in this method https://github.com/SAP/ui5-language-assistant/blob/master/packages/logic-utils/src/utils/fetch-helper.ts#L9 But for that of course, you should have dev env setup and knowledge of debugging client and server.

Hope that helps. Best regards

marufrasully avatar Mar 24 '25 16:03 marufrasully

Dear @marufrasully

Thanks for the very good explanation.

I think i figured out the problem:

For a better handling of my environment i only use "latest" as minUI5Version in the manifest.json and on the local server the set the path:

const map = new Map([ ["/latest", path.join(base, "sapui5-sdk-1.108.39")] ]);

But this was the problem. If i set the "latest" to "1.108.39" (on the server and manifest.sjon) than it works. In the previous versions of the plugin this was possible (i found the cache folder a folder with the name "latest" on my computer).

Is it possible the enable string again? Like "latest" or "sapui5-latest"

Thanks and Regards

Haunted

hauntedhill avatar Mar 25 '25 14:03 hauntedhill

Dear @hauntedhill

We are evaluating this case to see what we can do on our end, but with lower priority, as you are not blocked.

Thanks and best regards, Maruf

marufrasully avatar Apr 07 '25 09:04 marufrasully