Luuuk Posted November 15, 2021 Posted November 15, 2021 (edited) Hi, After upgrading to 4.6.8 I enabled the PHP GMP extension and rebooted server. PHP 7.4.1, the extension is detected as enabled: But I get the following error: From System logs: Quote 11/15/2021 11:42 PM create_vapid_keys RuntimeException (0) Unable to create the key Edited November 15, 2021 by Luuuk
Marc Posted November 16, 2021 Posted November 16, 2021 Unfortunately this is because you are currently using windows server, in which this will not properly work on and is not supported
Luuuk Posted November 16, 2021 Author Posted November 16, 2021 (edited) Could you elaborate what "does not work" and "is not supported" exactly means? Modern Windows Server fully supports PWA (including Push). I meet all requirements: PHP version (and actually I upped it to PHP 8.0), enabled modules (gmp, mbstring, curl, openssl). The thing which fails is writing VAPID keys to some JSON file. So could you tell me where / which JSON file I have to look at? The error points to permissions. For the record, browsers do detect a service worker but fire an error related to JSON: Edited November 16, 2021 by Luuuk
Jim M Posted November 16, 2021 Posted November 16, 2021 2 minutes ago, Luuuk said: Could you elaborate what "does not work" and is "not supported" exactly means? Modern Windows Server fully supports PWA (including Push). I meet all requirements: PHP version (and actually I upped it to PHP 8.0), enabled modules (gmp, mbstring, curl, openssl). The thing which fails is writing VAPID keys to some JSON file. So could you tell me where / which JSON file I have to look at? The error points to permissions. For the record, browsers do detect a service worker but fire an error related to JSON: Unfortunately, we do not provide support for Windows servers. It may be that it requires further configuring on your server or otherwise. I am happy to move this topic to our peer-to-peer server support forum for further assistance once we address the second issue there. The latter there may be a bug and unrelated as there are service workers running outside of the push notification. What is being returned there is not JSON thus the Javascript is failing to parse the string into a JSON object. This could be your Windows server is generating an error page that was not anticipated but I would expect the above to catch that. However, when viewing your community, I am seeing that the service worker is running fine without error. Could you please clarify where and which user you're seeing this with? I can then investigate this further.
Luuuk Posted November 16, 2021 Author Posted November 16, 2021 (edited) 12 minutes ago, Jim M said: However, when viewing your community, I am seeing that the service worker is running fine without error. Could you please clarify where and which user you're seeing this with? I can then investigate this further. As pointed out, my ACP Support page returns "Push notification keys missing" because VAPID keys can't be saved somewhere. Seeing my community as a Guest or Admin in the Chrome Developer Console show service worker as running and no error until I test the "Push" option in the console. EDIT: I clarified that the error is shown regardless of being logged or not. Edited November 16, 2021 by Luuuk
Jim M Posted November 16, 2021 Posted November 16, 2021 33 minutes ago, Luuuk said: Seeing my community as a Guest or Admin in the Chrome Developer Console show service worker as running and no error until I test the "Push" option in the console. Unfortunately, I cannot reproduce this. I would suggest clearing your browser's cache and trying again. There are no errors in the browser console:
Solution Stuart Silvester Posted November 16, 2021 Solution Posted November 16, 2021 Vapid key generation failure on Windows is typically (and this is pretty much all Windows web servers) because the openssl.cnf file either isn't configured properly or cannot be located/used by your PHP instance. Take a look at https://stackoverflow.com/a/18869750. If you can get it to work, that's great! Just please note that we cannot assist with server configuration issues. Sonya* 1
Luuuk Posted November 17, 2021 Author Posted November 17, 2021 (edited) 15 hours ago, Stuart Silvester said: Vapid key generation failure on Windows is typically (and this is pretty much all Windows web servers) because the openssl.cnf file either isn't configured properly or cannot be located/used by your PHP instance. Thanks a lot! I fixed the error by creating the OPENSSL_CONF environment variable set to C:\Program Files\PHP\v8.0\extras\ssl\openssl.cnf and rebooting server. Get Support page generated the keys and Push option appeared in the users Notification settings. ======================================= But I still have issues.. Push option enabled in the users settings + accepted in the browser's prompt but no Push messages at all. Something like reported here. Also the odd thing is that a service worker is detected by browsers but Google says: 16 hours ago, Jim M said: Unfortunately, I cannot reproduce this. I would suggest clearing your browser's cache and trying again. There are no errors in the browser console Clearing site's data does not help. I still see the JSON error generated after I click this: Edited November 17, 2021 by Luuuk
Luuuk Posted November 17, 2021 Author Posted November 17, 2021 (edited) I will also add that I see a service worker in Chrome (returning the error during the "Push" test) and Firefox but not in Microsoft Edge: Service worker is added after I manually select Edge menu > Apllications > Install "My site". And then the worker returns the same error as in Chrome. Edited November 17, 2021 by Luuuk
Jim M Posted November 17, 2021 Posted November 17, 2021 Thank you for clarifying. The test push notification in devtools is also failing here. I have tagged someone from our dev team to further clarify. However, it is key to understand, the service worker is working and push notifications should work in the software itself. If they are not, please let us know.
Luuuk Posted November 17, 2021 Author Posted November 17, 2021 (edited) 2 hours ago, Jim M said: However, it is key to understand, the service worker is working and push notifications should work in the software itself. If they are not, please let us know. Like I said: 9 hours ago, Luuuk said: Push option enabled in the users settings + accepted in the browser's prompt but no Push messages at all. Something like reported here. I also think it is not normal that Edge does not create the worker automatically and does not detect my site as "installable" in the address bar (no icon). So I need to use the Edge dropdown menu to add "My site" application which results in the service worker being added too... EDIT: Something is not right and results are inconsistent. I just have encountered the same issue as in Edge but in Chrome on other PC where I never opened my site. No service worker detected and no "Install application" prompt. So on two different Windows PCs different results in Chrome. Edited November 17, 2021 by Luuuk
Luuuk Posted February 21, 2023 Author Posted February 21, 2023 (edited) I forgot to update this old topic but just in case somebody is still on older IPS version: The remaining issues (service worker not detected as registered / delay in the registration and as a consequence no push notifications) were resolved when I upgraded from 4.6.8 to 4.6.12.1. So there had to be some changes between those IPS versions. Edited February 21, 2023 by Luuuk Marc 1
Elon Report Posted June 4 Posted June 4 On 11/16/2021 at 3:32 PM, Stuart Silvester said: Vapid key generation failure on Windows is typically (and this is pretty much all Windows web servers) because the openssl.cnf file either isn't configured properly or cannot be located/used by your PHP instance. Take a look at https://stackoverflow.com/a/18869750. If you can get it to work, that's great! Just please note that we cannot assist with server configuration issues. I experienced this issue on Windows server. Followed the instructions, and it worked great, but some paths are outdated. For those using Plesk (and php 8.1), the path to the OPENSSL_CONF variable is: C:\Program Files (x86)\Plesk\Additional\PleskPHP81\extras\ssl\openssl.cnf
Recommended Posts