SharePoint 404 error after Update-SPSolution - sharepoint-2010

I got an 404 error after I update a SharePoint 2010 solution, and I dont know the reason why.
I have analysed the log file, the update process was successfull, all changed files have been replaced, added or deleted. Log is telling that the update was successfull too. After opening the SiteCollection via Browser, a 404 error is shown, the sitecollection is not reachable.
What have I changed in the solution:
Added two Element files
Removed a unused empty Feature
Removed an obsolete custom MasterPage
Added a custom UserControl
The WebConfig is updated successfull, and it includes the assembly in the SafeControls, with the right values.
The Content Database for this deployed solution seems to be fine too.
The SiteCollection settings are reachable via PowerShell. The collection does exists in the configuration and all values seems to be fine too.
I checked with Fiddler too. It says that there is no file. I have done a IIS reset for sure too, multiple times.
I have no problems to create a new site collection with the updated solution. And the last things to add: There were no changes to ListDefinitions, ContentTypes. Only some changes to the ONET.xml have been done (removing the custom masterpage from the site definition).
Hopefully someone has ever got this issue and knows how to deal with it.

I got the solution and I would like to share with you. I think its a bug in SharePoint 2010 which is not well documented.. or even not documented.
Following scenario: We have already a deployed package with a custom masterpage. We are now in the situation where we need to rename or remove the masterpage from the package. We were performing a Update-SPSolution and the result is a 404 error for that specific sitecollection. When we analyse the logs or any other part we will get no errors, no information's for this bug, everything from the log seems to work fine.
But that’s a lie. In that moment where we have performed the update the masterpage assigned to that specific site collection is gone and occurs a null exception during initialization, which gets not logged. The 404-Error is the result.
I spend now a day for developing a fix. Before we proceed with the update we have to remove and to reference the solution with a different masterpage. This can be done by PowerShell. For example it could look like this:
# Delte old custom masterpage
$web = get-spweb http://development/mysite
$lib =$web.GetFolder("_catalogs/masterpage")
$file = $lib.Files["MyMaster.master"];
$file.Delete();
$web.Dispose();
# Revert Branding to SP Default
$site = Get-SPSite http://development/mysite
$site | Get-SPWeb -limit all | ForEach-Object { $_.MasterUrl = $_.ServerRelativeUrl + "/_catalogs/masterpage/v4.master";$_.Update() }
$site.Dispose()
After we have removed the masterpage manually we can proceed with the solution update and everything will work fine. Hope this will help anyone who is in the same situation.
Update:
I recognize that sometimes powershell is not ably to delete the masterpage. This is because the masterpage is still in memory. Therefore we need to clean the GC. Therefore here the updated script:
Delte old custom masterpage
[System.GC]::Collect()
[System.GC]::WaitForPendingFinalizers()
$web = get-spweb http://development/mysite
$lib =$web.GetFolder("_catalogs/masterpage")
$file = $lib.Files["MyMaster.master"];
$file.Delete();
$web.Dispose();
# Revert Branding to SP Default
$site = Get-SPSite http://development/mysite
$site | Get-SPWeb -limit all | ForEach-Object { $_.MasterUrl = $_.ServerRelativeUrl + "/_catalogs/masterpage/v4.master";$_.Update() }
$site.Dispose()

Related

cakephp 2 non existing controller and files could not be found

I make debug on a website running on cakephp 2 (yes it's old i know)
I have strange errors i cannot resolve.
in log i have:
-Error: [MissingControllerException] Controller class Wp-login.phpController could not be found
-Error: [MissingControllerException] Controller ColonisersController could not be found.
-Error: [MissingActionException] Action ImgController::ui-bg_diagonals-thick_90_eeeeee_40x40.png() could not be found.
-Error: [MissingActionException] Action ImgController::moustique-tigre-default.png() could not be found.
...
I search over all the source code for Colonisers but it is not write even once (also i think ColonisersController is a renammed controller because it is misspelled).
I search over the web for the Wp-login.php and it is a wordpress page, so no link to cakephp at all, also not write anywhere in the source code.
Same story for the missings pngs files. not in the source code.
I try to clear the cache folder on server but problems remains.
I have ghost source code? file are somewhere in another cache ?
any idea are welcomed.
By default all request that do not map to an actual file are being passed over to CakePHP, where the app will try to match the request to a route, and if one is found, finally try to match it to a controller and an action.
You seem to have some rather unspecific routes defined that eat pretty much anything as a possible controller name, hence things are being passed further for searching for a matching a controller and an action, which is where the request flow will end, as no matching controller or action can be found - consequently a MissingControllerException or MissingActionException is being triggered, an error is being logged (by default all exceptions are being logged), and in production mode (debug = 0) the app will respond with a 404 error.
So, no ghosts, no cached files, that's just how things work.

Odoo 9 - cannot load custom module

I am brand new to odoo, just installed version 9 and made a module 'aidentest' using
.>>python odoo.py scaffold aidentest addons
That created the aidentest module in the addons folder. Uncommented everything in the autogenerated files
but when I went to check out my 'Hello World' page at
http://localhost:8069/aidentest/aidentest
I got a 404 not found
So I went to apps to try and load my module, but I could not find it.
Does anyone know what I need to do on Odoo 9 to load up and start coding my custom module?
Briefly: You have to activate developer mode by going to Top right menu>about>activate developer mode
I had basically given up, and was mindlessly clicking about when I hit the 'About' link on the generic-whiteguy dropdown. I had to actually stop thinking before I was able to locate the completely senseless place where they put the thing I need.
The About modal window popped up, and in it was an activate the developer mode button
Some things changed immediately, but I still couldn't find my custom module.
Then I walked away, came back and when I returned I had some auto-generated emails (new things had loaded - slowly). Did this mean that maybe my module had also become accessible? I checked, and sure enough, there it was.
ZERO DOCUMENTATION about this
Please check the config file.Then send the last error it has.

Session lost while on PythonAnywhere Web2Py but NOT locally

I use a session variable to pass some info with a redirect:
session.OrigText = XML(str(OrigText))
redirect(URL('SearchResultsOrigText'))
It arrives at the new URL / page / view - SearchResultsOrigText - and works Ok.
But when from that new URL - SearchResultsOrigText- I navigate away (and it doesn't matter where I go from this new page), when returning with the 'back" button of the browser, the session.OrigText is now empty (showing as 'None').
This behaviour is happening only on PA and not locally.
I do not use session.forget anywhere in my code.
Trying to pass the 'html heavy' content in the OrigText as a dictionary variable (not a session variable) gets me into another interesting issue...Python Anywhere says "Something's wrong 502- Back End".
(Silent failing ?) This happens on PythonAnywhere but NOT locally as well.
Sanitizing this var doesn't help...
But let's focus on the first question...
Why is the session variable lost after 1.redirect and 2.leaving the new page / view - when hosted on PythonAnywhere and NOT locally ?
Thanks
Flask sessions, by default use cookies, so it's possible that somewhere in your settings you have a setting for what domain to set the cookies on and that is not set correctly. It's also possible that you haven't set a secret key for sessions.
I faced the same problem recently in PythonAnywhere. I solved it by deleting my domain's cookies from Firefox. I still don't know how they were messed up, though.
Make sure there is no "session.forget(response)" in your code or framework code along the way.

Partial view never affects site after upload and IIS reset

I'm including a partial view in one of the pages of my MVC4 site which when deployed, even after a restart of the web site and recycling of the app pool, never seems to affect the site
I'm wondering if this is caching coming into play
I ended up including the content of the partial view in the page iteself and that seems to have worked but I'd rather have the partial view as I'd like to use the view in other parts of the site
The question is, does anyone have any suggestions as to why this might be happening? I've been pulling my hair out trying to get a view to post the correct data, only to realise that some of the hidden inputs are just missing because the partial view has not been refreshed
EDIT:
Ok now I have a need to use this partial view in more than once place. On my dev environment the partial is rendering correctly. Uploading to the server doesn't seem to have any effect, but what's worse, deleting the partial view from the server also has the same issue.
My site still thinks the file is there and complains about the model type passed to the view now (I changed the model type in the view - all working fine on my local dev) - why does it still think the file is there?
I deleted one of the parent views to see if the site carried on working, but as soon as I delete any other file, the site is affected. Why is this particular file giving me trouble? It's as if the server has cached it at the file system level and is supplying the wrong file content to ASP.NET
I'm going to try renaming the file next
Ok so renaming the file appears to have worked.
I didn't try Fals suggestion but I might try that next time, strange behaviour I'm not going to try and understand why at this point!

Multiple RequiredFieldValidator crashes page

I have a very strange problem. I've recently added MVC4 to an old Web Forms project. I did this by creating a new project, and adding the old files to the new project (rather than opposite approach of copying the new MVC files in). When I did this, one of my Web Forms pages stopped working - When I try to access it, it redirects to HTTP Error 404.0 - Not Found.
The file is there, and I also have other Web Forms (.aspx) pages that load without any issues. To pin-point the issue, I created a Web Forms page with the same name to replace it, and it the blank page loads. I started adding code to the new page one line at a time till I found the issue.
I finally found that what caused the issue is when I have more than one RequiredFieldValidator tag on the page. Any idea why this would happen or what I can do to work around it?
assign groups to the validators. Put them in separate groups, dont put them in same groups , make sure You dont have controltoassign be same because then during compilation same requiredfield validator might have concurrency issues and crash the page. Putting them in different groups assures that even more. If you still get the same issue then try this as well
Open IIS Manager
Right Click the server name
Select properties
Click the MIME Types button
Click New
Extension is .pdf
MIME type is application/pdf