Refreshing local plugins results in Bad Gateway 502

Monday, November 25, 2024 5:56:45 PM
  • Posted: Friday, November 30, 2018 12:46 PM
  • 55
Was able to recently set up SSL.  
When I go to Configuration > Plugins and try to refresh list of local plugins
- I get : 502 Bad Gateway

0
  • Posted: Friday, November 30, 2018 5:43 PM
  • 953
It’s known issue which appears on Linux servers. GrandNode refreshes list, but it’s throwing browsers timeout. so don’t worry.
Best regards,
Patryk

GrandNode Team
0
  • Posted: Friday, November 30, 2018 6:26 PM
  • 55
So, for the time being it's a linux host specific issue?

What do you recommend to circumvent it?  Hosting in docker or windows?
0
  • Posted: Tuesday, December 11, 2018 2:07 PM
  • 55
TL;DR:  Hosting via Windows Service might cause issue atm with StopApplication (IApplicationLifetime) and maybe we could open the discussion about incorporating dynamic loading/unloading of modules and their dependencies which might be in the works for .NET Core 3.0.


As per my previous reply regarding the Bad Gateway 502.  I should have looked at the code.  So the app domain is gracefully shut down, thus, there's nothing there for the reverse proxy.  Poof.  Bad Gateway in this case, unless I'm missing something else.

RE: ReloadList

https://github.com/grandnode/grandnode/blob/b83634811f3b0bf0c53f28fa44a5b67ee7328ce7/Grand.Core/WebHelper.cs

        /// <summary>
        /// Restart application domain
        /// </summary>
        public virtual void RestartAppDomain()
        {
            if(OperatingSystem.IsWindows())
                File.SetLastWriteTimeUtc(CommonHelper.MapPath("~/web.config"), DateTime.UtcNow);
            else
                _applicationLifetime.StopApplication();
        }

Perhaps not an issue while running as a console app on Windows, if GrandNode is running as a service there might be current complications with gracefully shutting down the app (StopApplication) as per: https://github.com/aspnet/Hosting/issues/1463

I suppose my question is, why is an application shutdown the adopted approach for uninstalling/installing/refreshing plugins?  Perhaps a current limitation or the easiest approach and I am a fan of simple solutions.  However, figured I would bring up a few things to keep in mind for future reference regarding dynamic loading/unloading of modules and their dependencies.

Dynamic loading:
https://natemcmaster.com/blog/2018/07/25/netcore-plugins/

Current limitations or future plans for dynamic unloading:

With the release of .NET Core 3.0, maybe taking a look at the following:
https://github.com/natemcmaster/DotNetCorePlugins/issues/16
w/ ref to:
https://github.com/dotnet/coreclr/issues/552
https://github.com/dotnet/coreclr/pull/18476
https://github.com/dotnet/corefx/issues/14724
https://github.com/dotnet/coreclr/projects/9
0
  • Posted: Thursday, December 13, 2018 6:47 AM
  • 953
Bill,

If you add new plugin and want to reload list of it, application has to stop and start again. In the other case, you won't see new plugins on the list. By the time we found a solution, which will be effective and fine, users need to refresh page manually.

But we will look at your suggestions.

Best,
Patryk  
Best regards,
Patryk

GrandNode Team
0
back to top
Filters