Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TileServer-GL Issue on Windows Server 2022 #1020

Open
akram-mhss opened this issue Oct 17, 2023 · 13 comments
Open

TileServer-GL Issue on Windows Server 2022 #1020

akram-mhss opened this issue Oct 17, 2023 · 13 comments

Comments

@akram-mhss
Copy link

When I fire up TileServer-GL on my Windows Server 2022, everything seems fine and dandy. But the problem kicks in when I try to access specific URLs like "https://localhost:8080" or "https://localhost/styles/basic-preview/1/0/1.png." When I do that, the server running in the command prompt mysteriously shuts down, and no error logs get generated. Instead, the console spits out this message: "GET https://144.91.**.***:444/styles/basic-preview/6/31/30.png 502 (Bad Gateway)."

I'm stumped because TileServer-GL only seems to stop when I hit these particular links. Oddly enough, if I navigate to "https://144.91.**.***:444/styles/basic-preview/#0.54/0/0," it works perfectly without a hitch.

Since there are no error.log to dive into, I'm hoping someone here can help me crack this puzzle. Any insights or guidance would be much appreciated.

Thanks a ton, and let me know if you need more info to dig into this issue.

@acalcutt
Copy link
Collaborator

It sounds like it is failing in places that uses maplibre-native rendering.

"https://localhost:8080/" uses maplibre-native to generate the thumnails for your style. "https://localhost/styles/basic-preview/1/0/1.png." uses maplibre-native to render your style+data sources into a rendered png.

502 (Bad Gateway) sounds like maplibre-native is having trouble connecting to the enpoint maybe?...idk

@acalcutt
Copy link
Collaborator

Did you install the latest c++ redistributable needed on windows? https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170

@acalcutt
Copy link
Collaborator

I tried it on server 2022 and experience the same thing. Strange. I'm guessing some dependency is missing but i'm not sure what it would be.

I have been running it fine on Windows 11 here in testing...I would imagine that is pretty similar.

@acalcutt
Copy link
Collaborator

acalcutt commented Oct 18, 2023

After some trial and error I got it to work. It looks like in my case it was not working because I didn't install vmware tools, which includes a video driver with 3d support. The default microsoft basic video driver didn't work, but the vmware driver did.

Working with vmware driver
image

Not working with microsoft basic driver
image

@akram-mhss
Copy link
Author

Thank you for your assistance. The issue I'm facing is that I'm using Windows Server 2022 on RDP, and it's displaying "Microsoft Remote Display Adapter" and "Microsoft Basic Display Adapter." Now, should I download the SVGA 3D driver will work, or should I change the RDP graphics mode?

@acalcutt
Copy link
Collaborator

Seems to work fine over RDP, once the real video card is updated to an appropriate driver. What kind of server is this, is it a virtual server or a phsical server? Seems like you need to update the one that shows "Microsoft Basic Display Adapter." .

For a vmware virtual server, the updated driver with 3d support come as part of the vmware tools. If this isn't a virtual server, maybe run windows update and see if it pulls in a better driver that replaces the "Microsoft Basic Display Adapter." If this isn't vmware and windows update doesn't pull in a driver for you, you are going to need to find what video card your server uses and see if you can find a better driver for it.

image

@acalcutt
Copy link
Collaborator

acalcutt commented Oct 18, 2023

If you can't find a better driver, it may be possible to use Mesa3d software rendering. I have not tested this with tileserver-gl, but I know we have used it when building maplibre-native in the github workflows, which does not have a real video card https://github.com/maplibre/maplibre-native/blob/main/.github/workflows/node-ci.yml#L262-L271 .

I would try the driver first, since there should be one you can use in most cases, but mesa3d could be an option if it is not. we would have to reseach how to do it, but it should mostly be extracting the dlls and possibly setting an environment variable like that step in the workflow does.

Basically the issue here is maplibre-native requires opengl support, which it doesn't seem the "Microsoft Basic Display Adapter." has.

@acalcutt
Copy link
Collaborator

acalcutt commented Oct 18, 2023

To use the Mesa3d software rendering you can try this.

1.) Download https://github.com/pal1000/mesa-dist-win/releases/download/22.3.5/mesa3d-22.3.5-release-msvc.7z
2.) extract the files 'opengl32.dll', 'libgallium_wgl.dll', 'libGLESv2.dll', 'libglapi.dll' into the maplibre-native lib folder at \node_modules\@maplibre\maplibre-gl-native\lib\node-(your node version)\
3.) set the windows environment variables. I set them in user variables, but system variables should also work
https://docs.mesa3d.org/envvars.html#envvar-GALLIUM_DRIVER

LIBGL_ALWAYS_SOFTWARE: true
GALLIUM_DRIVER: softpipe

4.) Make sure to restart your command prompt to get the new environment variables.
5.) Try to run "node ." and see if the page loads now.

image

@akram-mhss
Copy link
Author

akram-mhss commented Oct 18, 2023

ok I will give this a try, and I'll get back to you with the results

@akram-mhss
Copy link
Author

It worked perfectly; thank you so much for your assistance

@acalcutt
Copy link
Collaborator

Glad you got it working. did you go the fixing the driver route or the mesa3d software rendering route? If it is possible the upgrading the driver route is the better way to go, but at least there is an option.

@akram-mhss
Copy link
Author

I followed your instructions and used the mesa3d software, and it's working perfectly.

@akram-mhss akram-mhss reopened this Jul 9, 2024
@akram-mhss
Copy link
Author

akram-mhss commented Jul 9, 2024

Hello,

I am encountering an issue while trying to run tileserver-gl on a server without internet access. I have successfully set up tileserver-gl on other servers using a prepared folder with all necessary files, but on this particular server, I receive the following error:

`C:\Users\andreas\Desktop\map> npx tileserver-gl --mbtiles africa.mbtiles

node:internal/modules/cjs/loader:1340
return process.dlopen(module, path.toNamespacedPath(filename));
Error: Le module spécifié est introuvable.
\?\C:\Users\andreas\Desktop\map\node_modules@maplibre\maplibre-gl-native\lib\node-v108\mbgl.node
at Module._extensions..node (node:internal/modules/cjs/loader:1340:18)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Module.require (node:internal/modules/cjs/helpers:107:18)
at require (node:internal/modules/cjs/helpers:132:18)
at Object. (C:\Users\andreas\Desktop\map\node_modules@maplibre\maplibre-gl-native\platform\node\index.js:5:12)
at Module._compile (node:internal/modules/cjs/loader:1255:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12) {
code: 'ERR_DLOPEN_FAILED'
}
Node.js v18.18.1`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants