Closed GregStevenson closed 8 months ago
@GregStevenson I tested with brave successfully uploading a file using server project and and it worked OK without restarting anything or making an error, however I opened a brave browser using after launching it with default browser which is currently firefox in this environment and opened the site with Brave using http://localhost:44357/
after downloading the current dev branch and launching in VS with Debug Mode.
I was uploading to the "public" folder an image, I also tested out the other folders after logging in as host.
Is this a user or host account you are uploading a file for? For example is it happening when a user is updating it's profile uploading an image?
I will test other folders but I think we may need more details on what maybe causing this error since this works OK. I did have to build the database solution projects first. Not sure if I had to but I got an error first time trying to install a fresh copy from latest dev branch which felt like another issue that is being discussed and worked on.
Are you using the Release or Dev branch in Visual Studio?
Check the Visual Studio environment is fully updated as far as the application and .NET runtime hosting packages go. Sometimes this works out kinks with Visual Studio.
Another thing to check is if there are any settings in the Brave browser you may have set on your installation to create this issue. I was using default new fresh installation of Brave browser to see if this was an issue for me as requested. I notice Brave has other privacy and security options that other browsers do not offer. I wonder if any of these are on I may not have set in my environment to test.
I can't repeat this issue after testing otherwise.
I hope this helps.
Cheers!
I use Brave, so i will look into it.
@thabaum, Thanks for checking things out for me. I was waiting for some additional feedback from @leigh-pointer, but since its been a while I'll respond now. I'm using the dev branch in visual studio and am current on everything, but I saw this back in 4.x as well. with .Net 7. So I don't think it is related to version mismatches. Most of my brave settings are default. Whatever is happening on the browser side, It should not cause Oqtane to crash.
Here is video showing the issue. I demonstrated the full upload working in chrome and then repeated in brave right after file is selected (before upload) Oqtane crashes. Browser keeps retrying a call unsuccessfully because server has gone away, but I'm not sure what the request is.
@GregStevenson using Brave v1.61.109 (Dec 21, 2023) I had no adverse effects uploading.
Would suggest resetting the Brave browser.
@leigh-pointer I'm also using the latest version.
I can try resetting, but my bigger concern is how a browser issue can cause the server to abort.
@GregStevenson I am not going to say these relate but I am investigating another issue with uploads using Windows App Oqtane.Maui which generates an odd error reported in issue #3580. I am kinda focusing on the UploadFiles() method and the interop.js uploadFiles function currently. I believe there is different javascript file code in Server and Maui projects. I was wondering if we can get away from the interop.js if possible now in .NET 8 maybe rework this area if possible for handling the uploads which I am investigating now. Once I get my production environment to test I will verify it is not a VS issue. I am not having a very smooth a time setting up this environment however. I am using the release download and following directions in blog for some odd reason no go error 500 or 501 pages. Once I conquer this in my IDE I will have more ways to test issues. I had it running before many times, I am having a tough time all sudden with the 5.0.1 release not sure why yet.
@thabaum I think it would be good for me to keep my Brave instance as is for now as it seems to be the only case where we an replicate the issue consistently. I'm also open to trying to track this down, but I will need some help in where to look. I'll start with putting breakpoints in the UploadFiles() method. I'm also open to other places to look as I'm not yet familiar with Oqtane internals. As with many issues, it makes no sense until you find the cause. Then it makes sense and you fix it.
@GregStevenson From reviewing this issue and another relating to file uploads and .NET Maui I have been doing some investigating into this area myself recently.
From my findings here are some files of interest:
Oqtane.Client\UI\interop.js Oqtane.Server\wwwroot\js\interop.js Oqtane.Maui\wwwroot\js\interop.js Oqtane.Client\Modules\Controls\UI\FileManager.razor Oqtane.Client\Services\FileService.cs Oqtane.Server\Controllers\FileController.cs Oqtane.Server\Repository\FileRepository.cs
These files should give a good idea of how things relating to Oqtane Framework File Manager component uploads work. Not to mention the model class files and interfaces related to files listed above. I also included the lines to reference that would relate to the current upload logic.
I would like some research done if this can be improved after reviewing the below documentation with the .NET 8 LTS edition Oqtane 5.x @sbwalker ?
For a quick reference here are Microsoft Documentation articles relating to Blazor file uploads and JS Interop enhancements in .NET 8.
JavaScript Interoperability (JS Interop) - Microsoft Docs ASP.NET Core Blazor file uploads - Microsoft Docs
Plus some blogs relating to .NET 8 System.Text.Json and the current JS Interop enhancements can be searched.
Maybe there is a better solution to handle uploads with Blazor now in .NET 8 LTS not previously available in prior editions of .NET. One that is a more bulletproof solution for Oqtane Framework to work well with all current devices/browsers/environments to be supported. I am leaning on the interop.js logic needing to be investigated further relating to uploads in all the Maui/Server/Client projects.
Pretty much where I am at with it as of now. Best of luck troubleshooting hope you can find something here that helps!
Cheers!
@thabaum Thanks for the links and suggestions. I'll investigate this upcoming week.
@GregStevenson Issue #3656 sure seems to be maybe related?! Maybe you had saved site settings which caused a similar behavior (not crashing server however) and this now causes the Brave bug?
Check site settings and see if setting these manually in the database for file extensions allowed fixes your bug maybe as an idea speaking out loud a little over here... If that does work, when that issue is resolved this one can be tested and possibly closed as well.
@GregStevenson After our discussions earlier, I would like to recommend trying a couple things. I would also like to point out some recent commits relating to file uploads have been introduced into the latest dev branch.
Places to review for clues:
@thabaum,
1) Happens in non-preview version as well. 2) Happens with latest dev branch. Saving settings after alteration does not help. File extension changes are saved however. 3) Same thing happens on fresh db instance. --Nothing is written to Content\Logs folder when this happens. --Browser networking has https://localhost:44300/_blazor/negotiate?negotiateVersion=1 but these appear (and continue) after server is down. No other errors noted in browser. -- The only error that appears in the output console is: The program '[42032] iisexpress.exe' has exited with code 4294967295 (0xffffffff).
Note: This always happens when attempting to exit the open file dialog after clicking choose file. Even closing the dialog or clicking cancel without doing anything else will cause the issue.
@GregStevenson Thanks for taking time to review this further for us.
Maybe there is a clue in the IIS Express Logs in Windows?
I am not sure it is necessary for Visual Studio, but have you installed IIS Url Rewrite and the .NET 8 Hosting Bundle?
This is more for production IIS to work, however I thought I would also suggest setting up an IIS website and publish release mode folder copied to your IIS site folder created and test it there to see if it is something just your browser has cache stored in the browser cache memory so to speak that is conflicting with visual studio IIS Express.
If this issue is strictly your environment (browser cache) we have no way to reproduce, and is not going to be considered an issue we can really do anything about, unless you can crash production servers with it.
I would also maybe look at any browser settings that maybe different from default Brave settings for clues.
https://www.oqtane.org/blog/!/24/installing-oqtane-on-iis
This blog gives you the how to for setting up IIS. It is a bit of a task at first, but this is handy as it allows an additional testing environment closer to a production one. You may get additional logs here to review as well.
I hope this helps!
@thabaum ,
IIS Express Logs and TraceLogs folders are empty. I'm setting up a site SmarterASP.net who I plan to use to host the deployed app, so I'll test there today or tomorrow. I'll also try to install IIS locally according to the blog.
Thanks for your support and suggestions in this matter.
--Greg
How do I install IIS on my local computer
System > "Optional Features" you can search for from the start menu to find in Windows 11 At the bottom select this: Select the features required and desired:
@GregStevenson I was sleeping last night... and eureka moment possibly here as I felt this seemed familiar. I am maybe not correct for resolving your issue here, but are you using a folder inside your my documents folder for example to host the VS project?
If you are, please try moving it to a folder like C:\Dev\Oqtane\Release\ Extract here... and see if the shorter name helps it stay firing?! Sometimes if a name of a file is too long in Windows operating systems, your app will fail. I noticed this with Oqtane while I was developing a while ago and a note we should include in our documentation.
All my notes currently for Oqtane are here, in the Oqtane repository. I have some modules I built a while back, but I have been 100% focused on helping push this to 5.1 and beyond prior to any show and tells. My candle only burns for so long then I need to go to the market to get a new one!
I am very impressed with what all we all have accomplished as a community in the last 3 weeks! If you still have this issue after next documentation meeting we can spend some time reviewing it.
Thank you.
@thabaum , Thanks for the additional info. The comment about how to install IIS was actually intended for chatGPT. Got every thing installed according to the Blog instructions, updating versions as needed. It is located here: C:!!!Octane\Oqtane.Framework.5.0.2.Install And IIS finds it just fine. I also created a self signed cert for oqtane.dev and put it in the trusted certs. However, I get a 401 when trying to bring up the page. I tried Chrome, Brave, and Edge with same result. The install wizard fails to come up. Is there something else I might be missing?
Regards,
@GregStevenson did you install all the packages IIS Url Rewrite, Hosting Bundle and Windows Update?
Notice the URL Rewrite option is present above.
Last be sure your permissions are set for the IIS AppPool\YourAppPoolName
has modify rights minimum on the directory folder and files. No Managed Code setting for that app pool.
Restart system once after all of this has been completed the first time I suggest.
Also be sure your Bindings are set to use that SSL certificate pointing your devsite address.
And I am guessing you updated your HOST file in System to redirect that url to 127.0.0.1 ?
You need to run notepad as administrator, navigate to that file to edit and save it.
Sounds like you did all this already?
@GregStevenson I would suggest test the installation page via HTTP First. I remember was troubleshooting SSL in Self-Signed Certs and I can't recall if it works OK or not in IIS Express. It works great in production and I am pretty sure it should work in IIS Express as I can make it work on Visual Studio. I will investigate more when I can and let you know.
You can test IIS setup via HTTP simply by removing the HTTPS binding. Then when you know you have that working start testing HTTPS configurations.
I do plan on documenting some tips to help others so you don't need ChatGPT since it will just provide most info relating to Oqtane from here! Whatever you get for tips along the way we should be aware of so we can come up with ways to help clarify details our upcoming installation and configuration documentation push.
@thabaum,
Tried HTTP, but browser security is not allowing that. However was able to get 5.02 up on hosting service and brave uploads work from there. I'd like to keep this issue open for another week to (1) see if it works with local IIS and (2) see if I can track. down the issue.
However, I think the rest of the team can focus on other issues for now. I have friends outside the Oqtane community that should be able to help with the local IIS issues.
Regards...
@GregStevenson Wish you the best in troubleshooting, let us know what you discover if you find out your issue.
I had one more suggestion or question which is are you running Visual Studio with SSL enabled?
You may try checking that box to utilize Oqtane using SSL in Visual Studio which I believe works for me. Your browser maybe fighting with SSL issues?!
Wish you the best luck!
@GregStevenson A couple ideas for your issue:
I am going to close this issue as it can not be reliably reproduced
This is a behavior I first noticed in 4.x and since it still exists in 5.0, I thought I should mention it. If one is running the server in debug mode from Visual studio and tries to upload a file in the Brave browser, the server quits with no errors thrown. Doing the same thing in Chrome or Edge works fine as expected. Wondering if anyone else can repeat this issue?