Monday, 9 December 2013

Problem deploying a solution, stuck on deploying and even retracting

Last week I tried to update one of our solutions. the upgrade worked perfectly fine in the dev and test environment, but when I tried it on the release server, it stuck on deploying.

I did hours of search and tried almost every suggested solution such as

  • Check the SharePoint 2010 timer services on all servers
  • Restart all the SharePoint services on all servers
  • Check the SharePoint Web Services application pool in all servers
  • Restart the IIS application pool for SharePoint web services
  • IISReset
  • Check the timer jobs
  • Cancel deployment and try Disable-SPFeature, Uninstall-SPSolution, Remove-SPSolution then Add-SPSolution, Install-SPSolution, Enable-SPSolution (couldn't do further than uninstall because it stuck on retracting)
  • Retract and Remove solution through UI (Central Admin) and try to redeploy again
  • I even tried Stsadm -o deploysolution -local
every one of these approaches fixed other people problem in different circumstances, but noting helped me. when I tried the Stsadm command to deploy locally, I realised that I can deploy on two servers out of three.

the third server in the farm is the indexing server and when I tried to open powershell, it was giving a message about not having SharePoint.
Oh, what an idiot I am... looking at the logs more carefully, there is being lots of logs about this server not being accessible.

Finally, everything been solved just by restarting the problematic server and redeploy the solution, ofcourse I had to redeploy instead of update because in my many attempts to find the problem I disabled and removed the actual feature.

well the lesson learned is to check ALL the servers in the farm when you are having a similar issue and make sure they are all healthy and working as expected.

Sunday, 8 December 2013

Expand Calendar Month view

Calendar month view shows a limited number of items by default, I think 3 or 4 items. so you have to click on expand, every time when you want to see all items.

with adding a hidden content editor web part and few line of javascript, we can change the calendar view to show all the events by default, so the end user don't have to click on "more items" every time when they visit the page.
and here is the required javascript to do this:
<div id='cover' style='position:absolute;top:0px;left:0px;width:100%;background:white;'></div>
<script type="text/javascript">

var yScroll = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
var y = window.innerHeight || document.body.clientHeight || document.documentElement.clientHeight;
var xScroll = window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft;
var x = window.innerWidth || document.body.clientWidth || document.documentElement.clientWidth;
var cover = document.getElementById("cover"); = (y + yScroll) + "px"; = (x + xScroll) + "px";

function expand() {
if (document.referrer != location.href && !location.href.match(/CalendarPeriod=((week)|(day))/i)) { GetMonthView('11111111'); }
else { = "none"; }
window.onload = function() { expand(); };