Wednesday, June 27, 2012

The specified file is not a valid spreadsheet or contains no data to import

While creating a list based on excel sheet we usually opt the option of  "Import Spreadsheet".
We had a requirement where we have to store the information in excel sheet (nearly 65k rows). I could able to import it as a list in sharepoint in both my development and staging environment.

Bur finally while moving to production, while importing the spreadsheet I received an error

"The specified file is not a valid spreadsheet or contains no data to import"

The data was correct even i used the same spread sheet in multiple locations. But its not working with the production site.

The solution for this issue is, the site has to be added as Trusted site in IE as follows

Open the site in IE go to Internet Options, Security tab, select Trusted Sites and add your site here.
Apply and say Ok.

Refresh your page and now I could able to import the spread sheet.
Quite wierd but finally I could be able to sovle that.

Wednesday, June 20, 2012

Shrink SharePoint Content Database Log file

Few times while inspecting the content databases of my sharepoint server, i found certain log files are unusually large compared to the mdf files and its eating up the space in the db server which is causing several other issues such as not able to add or delete content in the site, creating sub sites etc.

After searching many websites, i found the below useful way to reduce the size of log files i.e. by shrinking them.

Following are the commands that should be run in SQL Server Management studio


USE WSS_ContentDBName;
GO

BACKUP LOG WSS_ContentDBName_log TO DISK = 'filepath\*.bak' -- better to back up the file before shrinking it
   -- the recovery mode is to be made simple otherwise the shrinking will not happen
GO

ALTER DATABASE WSS_ContentDBName

SET RECOVERY SIMPLE;

GO

DBCC SHRINKFILE (WSS_ContentDBName_log, size to shrink) WITH NO_INFOMSGS

 -- you can mention to which size (in MB) to shrink your file. This parameter is optional. If nothing is specified, then it will be shrinked to the default size.GO

ALTER DATABASE WSS_ContentDBName

SET RECOVERY FULL;  -- after done with the shrinking, again make the recovery mode to FULL. recovery mode is to be made full because, when database backup is happening, then for full back up both the mdf and ldf will be taken back up. therefore recovery can be made at any point of time.


 

Tuesday, June 19, 2012

Event ID : 3760, Database error, Sharepoint

The following error was repeatedly appearing since 2 days in one of my WFE continuosly every 5 mins.

Event Type: Error
Event Source: Windows SharePoint Services 3
Event Category: Database
Event ID: 3760
Date:
Time: 9:15:27 PM
User: N/A
Computer: XXXXXXX
Description:
SQL Database 'WSS_Content_XXXXX' on SQL Server instance 'DBSERVER' not found. Additional error information from SQL Server is included below.

Cannot open database "WSS_Content_XXXXX" requested by the login. The login failed.
Login failed for user 'Domain\adminuser'.

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

The reason was, the Database seems to be not accessible.
The solution is to remove the content db to avoid errors.
For that, login to central admin site go to Application Management -> Content Databases. select the webapp having the content db and click on remove content db will solve the problem.

Tuesday, June 12, 2012

Publishing Cache Error, Event Id 5785

In one of my WFE event viewer, I received the following error continously

Event Type: Error
Event Source: Office SharePoint Server
Event Category: Publishing Cache
Event ID: 5785
Date:  
Time:  9:30:46 AM
User:  N/A
Computer: xxxxx
Description:
Unable to connect publishing custom string handler for output caching. IIS Instance Id is '1851498615', Url is 'http://url/_layouts/images/*.GIF'.
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

The reason for this error is that, the images inside the layouts folder was not able to be cached by sharepoint.

Following is the resolution for it.

Open the web.config file, look for <location path="_layouts/images">
just before the </System.Web> tag place the following code

<httpmodules>
<remove name="PublishingHttpModule">
</httpmodules>

 From now on, the error will not appear in the event viewer.
Thanks for the blog post which helped me in solving this issue.