-
Notifications
You must be signed in to change notification settings - Fork 568
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
Deleting Module Issue #1087
Comments
Just to add to the weird issue when i browse the data in the dbo.ModuleDefinition i can see the newly created Modules and i created a new user and that gets added to the local.db AspNetUsers OK. It seems its just an issue for delete where it tries to delete from another database instance, in my case USERNULL DB. Also it never deletes the modules anywhere, files folders and still showing in the database PageModule as IsDeleted False |
Can you check the entry in the Tenant table. The connection string need to be the same as what is in your config file. |
They are the same This is from the appsettings.json file. Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Oqtane-202101291423.mdf;Initial Catalog=Oqtane-202101291423;Integrated Security=SSPI; This is from the dbo.Tenant Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Oqtane-202101291423.mdf;Initial Catalog=Oqtane-202101291423;Integrated Security=SSPI; |
If you have used the module creator to create your module Im sure the framework will not delete it and every time the framework is run the module will be picked up and installed. |
Why does it cause a hang and throw an error? It hangs in a way that is totally unrecoverable and the only way to solve is to shut down the server and restart it. What's its purpose if it cannot delete? |
This issue is not isolated to you... but its quite a bit more complicated than it appears on the surface... Based on the screen shots and behavior reported, I am going to assume you are using the official 2.0.0 release version and not the latest version in the dev branch. When you delete a module there are number of tasks which need to be executed in order to fully remove it from the system:
For item 2 above, the system needs to know how to find the static file resources. The only way it can do this is by utilizing an assets.json file which is dynamically created when a module is installed from a Nuget package and contains a list of all files that were deployed. However when you create a module using the Module Creator and compile it in Debug mode, it does not actually create/deploy a Nuget package - it simply copies the DLLs to the Oqtane /bin folder. As a result, no assets.json file is created - which means that when you try to delete the module, none of the static file resources are removed. This also means that when you restart the Oqtane application it automatically re-installs the module because the DLL is still in the /bin folder. There are a few possible solutions... 1. The system could notify the user that the module was not successfully deleted, 2. the system could try to guess the names of the files/folders that need to be deleted - but since there is no naming convention which is enforced in the system it would be very unreliable and would likely leave orphaned files. My preference is option 1. In addition, when compiling modules you can put Visual Studio in Release mode which will automatically package the module as a Nuget and deploy it to Oqtane - which will create the assets.json file and allow for proper deletion. For item 4 above, when the application is restarted it terminates debugging in Visual Studio. This is standard behavior which cannot be controlled. Enhancements have been added to the dev branch to make the restart experience more user friendly - basically rather than restarting the application abruptly it now warns the user that they need to restart the app for the changes to take affect and provides a Restart option in the System Settings UI. |
Hello Shaun, Yes i am using the official 2.0.0 release version. I have tried it in release mode and all works as expected. In debug mode i found all the .dll files from the no longer used modules and remove them manually and this works as expected also. Just on item number 4. You can close this issue when you want to. Great work all you developers done on this project, its the way forward. Thanks for your help @sbwalker and @leigh-pointer |
Yes, all areas which were triggering an abrupt restart have been replaced with a friendly user experience. Thank you for raising the module deletion issue - it definitely could use some improvement to make it more intuitive. |
Thanks again |
@PhilipMur see PR #1088 - I was able to significantly improve the module/theme deletion user experience. They no longer require an application restart. In addition, the system will attempt to remove module assets even if an assets.json file does not exist. |
Very nice additions. |
My steps to recreate the issue.
issue experienced
The server hangs and visual studio hangs crashes and reports an issue to microsoft.
I can see in the logs that its trying to delete it from another instance of SQL server (USERNULL) i have running but when i install the Oqtane server i chose the localDB and also i verified it in the appsettings.json file
Also i can browse the localDB that Oqtane installed and i can create users OK Create new modules OK etc and i can see then in the localDB.
{ "ConnectionStrings": { "DefaultConnection": "Data Source=(LocalDb)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\Oqtane-202101291423.mdf;Initial Catalog=Oqtane-202101291423;Integrated Security=SSPI;" }, "Runtime": "Server", "Installation": { "DefaultAlias": "", "HostPassword": "", "HostEmail": "", "SiteTemplate": "", "DefaultTheme": "", "DefaultLayout": "", "DefaultContainer": "" }, "Localization": { "DefaultCulture": "", "SupportedCultures": [] } }
The text was updated successfully, but these errors were encountered: