asp.net mvc 2 global.asax.cs being ignored - asp.net-mvc-2

I was having trouble debugging why a route was throwing a 404 when I was positive I set it up correctly. I made changes, rebuilt, still 404, I did all kinds of crazy stuff to the route but always 404.
then in my frustration I just deleted ALL the routing in global.asax, saved rebuilt and ran. I still got 404...
but the rest of the site didn't break!! how can this be? I thought you had to route paths or nothing would work... even my custom routing still worked. I rebuilt, resaved web.config. I even stopped the website, and even the application pool and even IIS ENIIRELY, then restarted evertyhing...
all my routing still seems to be there!
I even threw a divide by zero and even FORCED an exception to be thrown on Application_Start... none of it changed anything...
what in the holy hell is going on? are my routes being cached somewhere? WHERE?!

Try this post as a start point.
http://haacked.com/archive/2008/03/13/url-routing-debugger.aspx
I had a similar issue that in my head I thought I was accounting for, but it turned out not to be the case. With this, you would see which routes are being loaded, which are being ignored, and ultimately, which route you are matching.

okay this was retarted. it turns out that SOMEHOW, the following line was removed from my csproj file:
<Content Include="Web.config" />
I don't know how it happened or why.. it's dumb and retarted and I'm completely upset that I lost two days of productivity because of it...
but I'm glad it's fixed. thanks for your help!

Related

How to get SvelteKit forms working in Vercel/Netlify/etc

I'm pretty new to Svelte but it is nice and straightforward in general with this form submission I have spent hours and it is driving me crazy as it doesn't make any sense why it is not sometimes working in Vercel.
I created a separate minimal SvelteKit project that submits the form to this webhook.site endpoint and it works perfectly in localhost but in Vercel deployment it works sometimes. Works once, then doesn't work three times, ten works four times in a row, then doesn't work again. Random. Sometimes Vercel gives an error, sometimes not. Here's the error:
[POST] /?/create
22:12:29:53
TypeError: fetch failed
at fetch (/var/task/node_modules/undici/index.js:105:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ConnectTimeoutError: Connect Timeout Error
at onConnectTimeout (/var/task/node_modules/undici/lib/core/connect.js:176:24)
at /var/task/node_modules/undici/lib/core/connect.js:123:46
at Immediate._onImmediate (/var/task/node_modules/undici/lib/core/connect.js:164:9)
at process.processImmediate (node:internal/timers:471:21) {
code: 'UND_ERR_CONNECT_TIMEOUT'
}
}
Then, without doing anything I tested again and it was working like 20 times in a row. I left it like that and came back after ~1h and it was still working like 10 times per row. I was here.
Then I decided to start experimenting again and in the next commit I removed the header authentication that isn't needed for the webhook.site but I had it there because, during the endless hours of hassling with it, I got at some point "feeling" that if the not used HASURA_ADMIN_SECRET ENV variable is there then it works more often. I know it is nonsense. It stopped working for good. Tested at least 20+ times with some breaks to be sure. Also tried multiple other endpoints that work brilliantly from a simple PHP script I created, from reqbin.com or from Postman. I have tried everything.
Allright, then I thought I was right - that magical HASURA_ADMIN_SECRET is needed so I added it back. That didn't fix the issue. Tried dozen of times and then although I made sure I added that header auth back properly I decided also to roll back to the version where it was stable working for so long as seen here. Now even that doesn't work anymore.
I tried long ago to deploy to Netlify and CloudFare, too as I suspected it is Netlify issue but I failed to even get the site working. So I decided to spend more time on getting it working in Netlify and when I got it working I got exactly the same error as in Netlify https://i.imgur.com/repNxyf.png so here's my dead end.
(I will make this post shorter once I get sorted)

Privoxy whitelist faulty on redirect

My problem, in a nutshell, is the following:
I use Privoxy to set up a whitelist of sites in Raspbian Jessie on Chromium. I have Chromium start on boot with the following snippet in lxsession/LXDE-pi/autostart:
#privoxy
#chromium --incognito --kiosk --proxy-server=127.0.0.1:8118
This does work as intended, with every site except the ones I specify blacklisted.
Now I edited /privoxy/templates/blocked so that instead of the usual site it will give me a redirect to a certain site should a link be opened that is not on the whitelist:
<!DOCTYPE html>
(Stuff happens)
Please go back to this site.
example.com being one of the sites I whitelisted. The problem is, it simply redirects me to the "blocked" page again, making me stuck in a loop. Does anyone have a clue why this would be and how I could work around it? I tried using
window.history.back()
however it doesn't seem to work either.
I use Kiosk mode because I want to use this in a context where entereing URL-adresses is not desired, just to clarify my Chromium-call.
Well, I solved it, at least partially. Turns out that I need to add http:// in front of the URL, since it gets added to the already existing URL otherwise. Which is fair, but a bit awkward for me to admit. HTML isn't exactly my forté. Marking it as solved and keeping it, just in case somebody stumbles upon a similar problem.

Zend Error controller stopped working for 500

My Zend application was running fine until today, when I changed something which caused the error controller to stop working.
I have debugged every part of the code but I can not find any traces as to why is it happening
If I produce a 404 error, the error controller runs perfectly. But in case of 500, the control does not go to error controller.
I have tried many things but am still unable to find out what's wrong. I have searched the internet but people who encountered this problem, seemed to get no answer :(
Any help would be much appreciable
I have debugged the application step by step and found out that in case of 500, the execution stops instantly when it encounters a fatal error or exception
(UPDATE)
If I do something like...
$blabla->getInfo();
where $blabla is not defined, I don't get redirected to error controller.
But if I do something like...
Zend_Registry::get('blabla');
where no key is set for 'blabla' in Zend_Registry, then I get redirected
500 is a general server error, so no wonder the control does not go to your controller.
You will need to check your server logs to find out what is causing the error.
Also, try to recall whether you have altered your .htaccess file(s) recently and/or created an infinite redirect loop by accident.

Unexpected Token ILLEGAL only in Chrome, only on Refresh

Help me Stack Over-flow-nobi, you're my only hope.
I see lots of posts and questions about the 'Unexpected Token ILLEGAL' issue in chrome, but haven't found a solution for my own variety of the problem.
I'm building a Facebook tab that needs to be served https (Facebook policy). It's a page built in WordPress and I'm using the WordPress HTTPS plugin to force my particular page to render with HTTPS.
When I test with regular old HTTP, everything is fine (except for the "unsecure content" warnings, but that's another issue).
When I test with HTTPS, when the page loads the first time, it's okay, but if I hit REFRESH, then I get the ILLEGAL error. It's inconsistent - sometimes it balks on a different file, but something bad happens almost every time.
The page is at http://www.facebook.com/pages/TbkCreative-Leavens-VW-Beta/178151292291863?sk=app_363900450303117
screen shot of error on Chrome console http://tbkcreative.com/sandbox/leavens/files/2012/01/unexpected_token.png
Any insight? I'm banging my head against the wall on this one.
Thanks
Trevor
File this one under the red herrings and wild goose chases.
I'm using a plugin called GD Star Rating on this app. It includes a dynamic CSS file. It was being loaded in with:
<link rel='stylesheet' id='gdsr_style_main-css' href='https://tbkcreative.com/sandbox/leavens/wp-content/plugins/gd-star-rating/css/gdsr.css.php?t=1327595625&s=a10i10m20k20c05r05%23121620243046%23121620243240%23s1pchristmas%23s1pcrystal%23s1pdarkness%23s1poxygen%23s1goxygen_gif%23s1pplain%23s1ppumpkin%23s1psoft%23s1pstarrating%23s1pstarscape%23t1pclassical%23t1pstarrating%23t1gstarrating_gif%23lsgflower&o=off&ver=1.9.10' type='text/css' media='all' />
If I got rid of all of those query arguments, the problem went away. Ditto for if I just got rid of the file altogether. I didn't dig deeper to figure out exactly what was causing the issue, as I was just relieved to figure it out.
I don't understand why this file was causing javascript files down the pipe to be loaded incorrectly. I don't understand why it only happened in Chrome, accessing the page with HTTPS and when I hit refresh. Weird.
But fixed.

Troubleshooting 500 Server Error Zend Framework application

I am facing a 500 Server Error and I see that many people here have had this problem and it can be too broad so I would like to ask my question differently.
I have confirmed with my host that the server is fine and if I replace content of index.php in public_html it shows everything is working. The problem seems to be in my script/environment and I am trying to track it down. My question is which are the common paths to check?
I have confirmed that its going through application.ini fine, the front controller plugin is fine (I have 1), the routing is working fine but it doesnt get as far as the IndexController which I am testing with.
I have tried to wrap $application->bootstrap()->run(); in a try-catch but this didnt help. Any help with how to troubleshoot such an issue appreciated. I am trying to track through what the application is doing to find where it fails.
I solved this problem. Turns out I had an infinite loop in my application in one model. I traced through the dispatch process until I narrowed down to the line that was causing trouble and removed it. Was helpful to me in walking through what the application does step by step and ticking off everything.