Excel Services Event ID 5239

After a join of a second MOSS server an error occured withing the event log. Boring enough because within the standalone MOSS everything works fine.

 

Event Type: Error
Event Source: Office SharePoint Server
Event Category: Excel Services Web Front End
Event ID: 5239
Date: 7/15/2008
Time: 11:40:06 AM
User: N/A
Computer: <YourServerName>
Description:
There was an error in communicating with Excel Calculation Services http://<YourCentralAdministration:Port>/SharedServices/ExcelCalculationServer/ExcelService.asmx exception: The request failed with HTTP status 504: Proxy Timeout ( The connection timed out. ).
[Session: (null)
User: <yourUserName>].

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

 

As you can see within the error message the Excel Services try to go truth a proxy. If you check the local settings on the server everything looks ok.

If you take a look within your web.config file you will see following section. You have now two possiblities to change the web.config to get a solution.

a) You can bypass the proxy server

<system.net>
     <defaultProxy>
          <proxy autoDetect=“true“ proxyaddress=“<YourProxyServer>“ bypassonlocal=“true“ />
     </defaultProxy>
</system.net>

b) You just disable the autodetect of the proxy server:

<system.net>
     <defaultProxy>
          <proxy autoDetect=“false“ />
     </defaultProxy>
</system.net>

Right now I’am not sure if we have any impact if you disable the autodetect. I would prefer to bypass the proxy for local addresses.

Timo

Veröffentlicht unter Errors, Infrastructur, MOSS 2007 | Kommentare deaktiviert für Excel Services Event ID 5239

Out of sync. Access denied. Event ID 5555, 7888, 1314

Shame on me when I renamed a database I made a site lock on my site collection and forgot to unlock it after restoring.

This is difficult to troubleshoot because you think that you made everthing correct. Everything looks fine but you have no access to your site collection. If you have no access to your site collection first check the sitelock on the command line!

stsadm -o getsitelock -url http://<yourSiteCollection>

Your output should be
<SiteLock Lock=“none“ />

If not you can review your eventlog and will see below errors (this two error are repeating each hour)

 

Event Type: Error
Event Source: Office SharePoint Server
Event Category: User Profiles
Event ID: 5555
Date: 7/14/2008
Time: 8:00:01 PM
User: N/A
Computer: <yourServerName>
Description:
Failure trying to synch web application ac716e97-0297-4ddf-a6c4-a751034147c6, ContentDB 465225b1-5ced-4a34-8a0c-381cd54d5199 Exception message was A duplicate site ID 86fe2e72-5347-46b2-b7c5-73b92fc8c6db(http://<yourSiteCollection) was found. This might be caused by restoring a content database from one server farm into a different server farm without first removing the original database and then running stsadm -o preparetomove. If this is the cause, the stsadm -o preparetomove command can be used with the -OldContentDB command line option to resolve this issue.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

 

 

Event Type: Error
Event Source: Office SharePoint Server
Event Category: Office Server General
Event ID: 7888
Date: 7/14/2008
Time: 8:00:01 PM
User: N/A
Computer: <yourServerName>
Description:
A runtime exception was detected. Details follow.
Message: A duplicate site ID 86fe2e72-5347-46b2-b7c5-73b92fc8c6db(http://<yourSiteCollection>) was found. This might be caused by restoring a content database from one server farm into a different server farm without first removing the original database and then running stsadm -o preparetomove. If this is the cause, the stsadm -o preparetomove command can be used with the -OldContentDB command line option to resolve this issue.

Techinal Details:
Microsoft.Office.Server.UserProfiles.ProfileSynchronizationDuplicateSiteIDException: A duplicate site ID 86fe2e72-5347-46b2-b7c5-73b92fc8c6db(http://<yourSiteCollection>) was found. This might be caused by restoring a content database from one server farm into a different server farm without first removing the original database and then running stsadm -o preparetomove. If this is the cause, the stsadm -o preparetomove command can be used with the -OldContentDB command line option to resolve this issue.
at Microsoft.Office.Server.UserProfiles.ContentDBSynchronizer.RegisterSitesForSynch(Guid[] rgGuid, Int32 nGuids, Object dummy)
at Microsoft.Office.Server.UserProfiles.SynchCollection`2.FlushAdds()
at Microsoft.Office.Server.UserProfiles.ContentDBSynchronizer.AddRemoveSites(String strFirstChangeToken, SPChangeToken lastChangeToken)
at Microsoft.Office.Server.UserProfiles.ContentDBSynchronizer.SynchContentDB()
at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock)

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

 

If you try to access the site collection you will get following error (only if you try to access!)

 

Event Type: Information
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1314
Date: 7/14/2008
Time: 9:08:16 PM
User: N/A
Computer: <yourServerName>
Description:
Event code: 4011
Event message: An unhandled access exception has occurred.
Event time: 7/14/2008 9:08:16 PM
Event time (UTC): 7/14/2008 7:08:16 PM
Event ID: 8de7884ebe164cdc9110021e83992184
Event sequence: 77
Event occurrence: 9
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/5294604/Root-1-128605293299491491
Trust level: WSS_Custom
Application Virtual Path: /
Application Path: C:\Inetpub\wwwroot\wss\VirtualDirectories\<dirName>\
Machine name: <yourServerName>

Process information:
Process ID: 3684
Process name: w3wp.exe
Account name: <yourFarmAccount>

Request information:
Request URL: <yourSiteCollection>
Request path: /Pages/default.aspx
User host address: <yourHostName>
User: <yourUserName>
Is authenticated: True
Authentication Type: NTLM
Thread account name: <yourFarmAccount>

Custom event details:

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

 

I was really confused bacause all the infos what I found wasn’t helpful.

As it always is the resolution is just simple.

Check the sitelock on your site collection
stsadm -o getsitelock -url http://<yourSiteCollection>

Your output should be „<SiteLock Lock=“readonly“ />“

type following command

stsadm -o setsitelock -lock none -url „http://<yourSiteCollection>“

check again the sitelock status

stsadm -o getsitelock -url http://<yourSiteCollection>

Your output should be „<SiteLock Lock=“none“ />“

Because your database is now out of synchronisation you should make following steps:

1) Make a full index of your site collection

2) Check your sync after you crawled the site collection (You should see that the sync of one site collection is different to the others)
      stsadm -o sync -ListOldDatabases 0

3) Wait one day (you see the time above)
    If you type
      stsadm -o sync -ListOldDatabases 0
     your see that one database is out of sync

    Delete the database which is out of sync
      stsadm -o sync -DeleteOldDatabases 1

Now everything should be fine.

Refer my article Rename content database correctly

Timo

Veröffentlicht unter Errors, Infrastructur, MOSS 2007 | Kommentare deaktiviert für Out of sync. Access denied. Event ID 5555, 7888, 1314

Rename content database correctly

You will find a lot of information about within the WWW but nobody tells you about the background and if you make this wrong that you will run out of sync.

Some backgrounds:

If you go on your commandline in your MOSS 2007 environment you should type

stsadm -o sync -listOldDatabases 0

You get a full list with your siteCollections which normally should be synced every hour. If you type the same command in following way

stsadm -o sync -listOldDatabases 1

You should get an command line output „No databases match the criteria for this Shared Service Provider“

This is good at this time. If you count your output you will see that you have listed only WebApplications with refer to your SSP.

Start to rename the database now

First catch the databasename (you have two possiblities)

1) stsadm.exe -o enumContentDBs -url „http://<yourSiteCollection>“

2) Navigate to your Central Administration -> Application Management -> Content databases (located within SharePoint Web Application Management) -> Select your web application. You will see the database name. I prefer to do this on command line.

Start to rename your content database go on commandline and type
stsadm -o prepareToMove -contentDB <yourDatabaseServer>:<yourDatabaseName> -site „http://<YourSiteCollection>“

Now you are ready to detach your database
stsadm -o deleteContentDB -url „http://<yourSiteCollection>“ -databaseServer <yourDatabaseServer> -databaseName <yourDatabaseName>

Go on your database server make a backup and restore. During you restore you can rename you database to the correct name.

Go back to your MOSS 2007 server and type
stsadm -o addContentDB -url „http://<yourSiteCollection>“ -databaseServer <yourDatabaseServer> -databaseName <yourDatabaseName>

Now you have successfully renamed your content database.

You can check on the commandline you sync status. If you don‘ t do that you are out of sync of your database. You need to repair this.

Last but not least do not forget to remove the old database from your SQL server. Keep the backup a while before you delete from your harddisc.

Refer following article which explain how to detach a database from you MOSS 2007 environment Detaching Databases in MOSS 2007 Environments

Veröffentlicht unter Infrastructur, MOSS 2007 | Kommentare deaktiviert für Rename content database correctly

Pass arguments into InfoPath 2007 from commandline / MOSS form services

When I design forms it is interesting to know if the form is running on a client or renderd on a server (MOSS Forms services / Forms Server).

If you have this information you can customize some special features only available on the client or on the web. As you know InfoPath client is not the same as form services. Not all features work on the web.

Beside the startup location it is interesting how to pass arguments to the form. It is possible to pass arguments from commandline or from web.

If you follow this rule and you are care with your source code you have maximum on flexibility within your form. Try to make sure that your form works on client and web well.

You can download my form or create it yourself. To run my sample create a new form and put following elements inside

The data source should look like this (Case sensitive)
IPFDataSource

The form should look like this
IPFForm

If you call your form from command line
infopath.exe „c:\startUp.xsn“ /InputParameters „value1=valueA&value2=valueB“

If you call your from from MOSS this will be different. Change all values within the angle bracket.

If you call and want to open your form within the client just call this URL

http://<www.domain.com>/<documentLibrary>/startUp.xsn?value1=valueA&value2=valueB

If you call and want to open in WEB you have two possibilities

The form is new

http://<www.domain.com>/_layouts/FormServer.aspx?XsnLocation=http://<www.domain.com>/FormServerTemplates/startUp.xsn&
SaveLocation=http://<www.domain.com>/<documentLibrary>&Source=
http://<www.domain.com>/<documentLibray>/Forms/AllItems.aspx&
DefaultItemOpen=1&value1=valueA&value2=valueB

The form already exists

http://<www.domain.com>/_layouts/FormServer.aspx?XmlLocation=/<documentLibrary>/<docName>.xml&Source=
http://<www.domain.com>/<documentLibrary>/Forms/AllItems.aspx&
DefaultItemOpen=1&value1=valueA&value2=valueB

 

Put following code in the FormEvents_Loading section

 

string value1 = String.Empty;
string value2 = String.Empty;

XPathNavigator xPathNavi = MainDataSource.CreateNavigator();
XPathNavigator xStartLocation = xPathNavi.SelectSingleNode(„/my:Root/my:startLocation“, this.NamespaceManager);
XPathNavigator xFirstArgument = xPathNavi.SelectSingleNode(„/my:Root/my:firstArgument“, this.NamespaceManager);
XPathNavigator xSecondArgument = xPathNavi.SelectSingleNode(„/my:Root/my:secondArgument“, this.NamespaceManager);

// check input arguments
if (e.InputParameters.ContainsKey(„value1“) && e.InputParameters.ContainsKey(„value2“))
{

value1 = e.InputParameters[„value1“].ToString().Trim();
value2 = e.InputParameters[„value2“].ToString().Trim();

xFirstArgument.SetValue(value1);
xSecondArgument.SetValue(value2);

}

// check if form is called on client or forms services
if (String.IsNullOrEmpty(this.Template.Uri.Host))
     xStartLocation.SetValue(„Called on client“);
else
     xStartLocation.SetValue(„Called on forms services“);

 

Download the form here IPFStartUpSample

This code won’t work in InfoPath 2003.

Timo

Veröffentlicht unter Development, Infopath | Kommentare deaktiviert für Pass arguments into InfoPath 2007 from commandline / MOSS form services

Add automatically rows to a repeating table in InfoPath 2007 with C#

Today I will explain how to add automatically rows in InfoPath 2007 to a repeating table with c#. You can download the InfoPath form and modifiy the code for your personal use. The code will work within the InfoPath client or on a web enabled form.

This is just a short sample. When I created this code I used a webservice to request data from an Oracle database and filled the form automatically when the form was opened.

Preparation:
Install InfoPath 2007 Client
Install Microsoft Visual Tools for Applications

Before you start to prepare the form note that you need to be care when you rename controls. All controls what we use within the code behind file are case sensitive!

First we start to prepare the form

1) Create a new infopath form

2) Rename the top element to „Root“

3) Add a „Repeating table“ element with three columns to the infopath form

4) Name the group element „Details“

5) Name the repeating table element „RepTable“

6) Type a name for each element („FieldA“, „FieldB“, „FieldC“)

7) In the repeating table properties within the tab „Data“ do not allow the user to insert and delete rows. You must uncheck the checkbox (default is checked). We do that because we want to add automatically rows to the repeating table.

The data source should look like this
IPFDataSource

We want to load data to the repeating table when you click a button. It is your choice to make an on load event or react on some input to fill the table

1) Add a button to the form

2) On right click go to „Button properties“

3) Write on the label „Load“

4) Write as ID „LoadRepData“

5) Click edit form code. When you do that InfoPath will automatically add the necessary reference to the code behind file to react on the button

6) click event.

The form should look like this
IPFForm

At this point we can start to code the InfoPath form. If you close the editor you can reach it if you click on the „Tools“ menu „Programming“ -> „Microsoft Visual Tools for Applications“.

Bind the navigator to the elements. Iterate the loop and fill the fields

 

XPathNavigator xPathNavi = MainDataSource.CreateNavigator();
XPathNavigator details = xPathNavi.SelectSingleNode(„/my:Root/my:Details“, NamespaceManager);
XPathNavigator repTable = details.SelectSingleNode(„my:RepTable“, NamespaceManager);
XPathNavigator node;

int counter = 0;

// iterate loop to fill table
for (int i=0; i<1; i++) {

node = repTable.Clone();
node.SelectSingleNode(„my:FieldA“, NamespaceManager).SetValue(„FieldA – Row “ + i.ToString());
node.SelectSingleNode(„my:FieldB“, NamespaceManager).SetValue(„FieldB – Row “ + i.ToString());
node.SelectSingleNode(„my:FieldC“, NamespaceManager).SetValue(„FieldC – Row “ + i.ToString());
details.AppendChild(node);

counter += 1;

}

 

Because that we clone the row we need to remove the last row

 

// delete a specific range of nodes
XPathNodeIterator rows = details.Select(„my:RepTable“, NamespaceManager);

XPathNavigator first = details.SelectSingleNode(„my:RepTable[1]“, NamespaceManager);
XPathNavigator second = details.SelectSingleNode(„my:RepTable[“ + Convert.ToString(rows.Count – counter) + „]“, NamespaceManager);

first.DeleteRange(second);

 

Isn’t that easy?

Download the InfoPath form here IPFRepeatingTableSample

This code won’t work in InfoPath 2003. This is because Microsoft changed the object modell. Feel free to modify this sample code.

Timo

Veröffentlicht unter Development, Infopath | Kommentare deaktiviert für Add automatically rows to a repeating table in InfoPath 2007 with C#