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

Uploads in Brave browser causes Server to quit #3560

Closed
GregStevenson opened this issue Dec 15, 2023 · 24 comments
Closed

Uploads in Brave browser causes Server to quit #3560

GregStevenson opened this issue Dec 15, 2023 · 24 comments

Comments

@GregStevenson
Copy link

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?

@GregStevenson GregStevenson changed the title Uploads in Brave browser cause Sever to quit Uploads in Brave browser cause Server to quit Dec 15, 2023
@GregStevenson GregStevenson changed the title Uploads in Brave browser cause Server to quit Uploads in Brave browser causes Server to quit Dec 15, 2023
@thabaum
Copy link
Contributor

thabaum commented Dec 15, 2023

@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!

@leigh-pointer
Copy link
Contributor

I use Brave, so i will look into it.

@GregStevenson
Copy link
Author

@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.

@leigh-pointer
Copy link
Contributor

@GregStevenson using Brave v1.61.109 (Dec 21, 2023) I had no adverse effects uploading.
AnimationBraveSave

Would suggest resetting the Brave browser.
image
image

@GregStevenson
Copy link
Author

@leigh-pointer I'm also using the latest version.
image

I can try resetting, but my bigger concern is how a browser issue can cause the server to abort.

@thabaum
Copy link
Contributor

thabaum commented Dec 29, 2023

@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.

@GregStevenson
Copy link
Author

@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.

@thabaum
Copy link
Contributor

thabaum commented Dec 29, 2023

@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!

@GregStevenson
Copy link
Author

@thabaum Thanks for the links and suggestions. I'll investigate this upcoming week.

@thabaum
Copy link
Contributor

thabaum commented Jan 21, 2024

@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.

@thabaum
Copy link
Contributor

thabaum commented Jan 24, 2024

@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.

  1. Test with Visual Studio Community (not preview) just so we know the preview edition is not causing your issue. Preview edition issues are not as supported by Oqtane community generally. I found it best to just keep the community edition up to date to avoid preview bugs.
  2. Save Site Settings after adding or removing a file extension in the comma separated list so it is saved to database (or download latest dev branch and build a new Oqtane database instance)
  3. If you are connecting to the same database instance (not a new site fresh install on your database) let us know as it maybe a data entry the database itself generating the behavior you are experiencing.

Places to review for clues:

  • The server will generate logs into the Content\Logs folder. This can be found in the Admin Dashboard under System Info. Maybe a great place to start for ensure our documentation covers this.

image

  • Use F12 will bring up developer tools where you can analyze the web browser errors and details relating to debug and networking.

image

  • Also watch and review your Oqtane.Server project debug information in the console within Visual Studio itself for different clues while performing the upload operation.

image

@GregStevenson
Copy link
Author

@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.

@thabaum
Copy link
Contributor

thabaum commented Jan 25, 2024

@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!

@GregStevenson
Copy link
Author

@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

@GregStevenson
Copy link
Author

How do I install IIS on my local computer

@thabaum
Copy link
Contributor

thabaum commented Jan 25, 2024

System > "Optional Features" you can search for from the start menu to find in Windows 11
image
At the bottom select this:
image
Select the features required and desired:
image

@thabaum
Copy link
Contributor

thabaum commented Jan 25, 2024

@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.

@GregStevenson
Copy link
Author

@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.
image
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,

@thabaum
Copy link
Contributor

thabaum commented Jan 25, 2024

@GregStevenson did you install all the packages IIS Url Rewrite, Hosting Bundle and Windows Update?

image

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.

image

Restart system once after all of this has been completed the first time I suggest.

image

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?

@thabaum
Copy link
Contributor

thabaum commented Jan 25, 2024

@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.

@GregStevenson
Copy link
Author

@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...

@thabaum
Copy link
Contributor

thabaum commented Jan 26, 2024

@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?
image

image

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!

@thabaum
Copy link
Contributor

thabaum commented Feb 28, 2024

@GregStevenson A couple ideas for your issue:

  1. find the hidden .vs folder inside the project folder and delete it or try downloading Oqtane to a new folder.
  2. Control + F5 generally clears browser cache if your willing to try this

@sbwalker
Copy link
Member

sbwalker commented Mar 4, 2024

I am going to close this issue as it can not be reliably reproduced

@sbwalker sbwalker closed this as completed Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants