SQL Server Merge Replication error - sql-server

I am getting a very strange error message at one of our client sites and I am having very little luck trying to figure out what is going on.
Hr=80040154 ERR:OpenDB failed getting
pub version 28627
That is the error message that is from the Merge Agent (IIS) logs. From what I can tell, it is a COM error not being able to load a specific COM object, but I don't know which one. From that, I think this client might not have something installed, but I don't know what that something.
Does any one have any thoughts about what might not be installed? Any other ideas on how to troubleshoot this?
Thanks.

This error could be related to permissions: Did you configure a snapshot share and give the IUSER_Machine name rights to Read and List Files and Folders?
You could restart the synchronization with verbose history logging as described here: How to enable replication agents for logging to output files in SQL Server.
Check these:
Ensure your subscription database is not timing out on auto-grow.
Make sure there is enough space to apply the snapshot on the subscriber

It turns out that there was a DLL that wasn't registered. It was sqloledb.dll (C:\Program Files\Common Files\System\Ole DB). I found this by using the ?diag on the merge agent.
http:////sqlcesa35.dll?diag
That page shows a nice summary of the versions of DLLs that it is using and such. When I did that at the client's site, it showed "unknown" for the version of that DLL. Running regsvr32 on the DLL allowed sqlcesa35.dll to see it and the diag page showed a version number.

Related

SSIS Project Failing When Running As SQL Server Agent Job

I have designed a SSIS project and deployed it to SQL server and also created the job to run on daily basis but its giving me this error when executing this as job (doesnt give any error within VS):
There is this CLSid in this error message but there is no application associated to it in
--> Component Services -> Computers -> My Computer -> DCOM Config
But this CLSid is registered inside registry editor
About this particular task on which this error is occurring: This is a script task which is modifying and deleting the un-wanted rows from the excel file in which I am trying to write SQL table data.
Script task code looks like this:
I have been working for hours now trying to fix this problem but no success. Kindly guide me how can I fix this issue. If any other information is required related to this project, please let me know....
Doing Excel automation in a SQL Server agent job is totally unsupported and probably won't work.
To have even a ghost of a chance of making this work you'll need to run a real desktop session on the server and automate Excel in that. Excel expects a real user to be logged in with a full profile. And Excel has failure conditions where it displays a popup window, which you'll need to be able to access via remote desktop.
You can read and write Excel files on a server with the OpenXML SDK, without actually having to run Excel. There's also a wrapper library called ClosedXML which you may find easier to use than using OpenXML directly.
tl;dr;
You need to install Office (Excel) on the server AND ensure that you install it in a manner that mirrors the SQL Agent's expected bit-edness. Default for Agent is going to be 64bit, default for Office is still 32 :(
Error guessing
You have a script task that uses the Office interop libraries to delete some rows (2 through 11?) out of a spreadsheet.
You have Office installed on your machine and therefore you have the libraries installed. Excel still has COM based "stuff" in it, thus the interop and errors shrieking about the CLSid, registry, etc but that's likely just secondary errors because there is no base "application is not installed" exception to be thrown.
If Office is installed, then ensure your agent execution model matches the version of Office. If 32 bit Excel is already installed, don't potentially break everyone else's stuff by uninstalling and reinstalling as 64 bit, just got the Advanced section of the SQL Agent Job Step and check the 32bit box.
Once all that's done, then if you're still getting errors but new ones, then the existing comments mentioning permissions may come into play - it depends on where the Excel document actually exists (on the computer where SQL agent can access vs on the computer where it cannot vs networked drive)
Good luck in not finding people on the sanctions lists.

CS2001 Missing AssemblyAttributes.cs when executing SSIS package deployed to the server

I created SSIS packages and used the Integration Services Deployment Wizard to deploy it out to the server. I'm manually going to the Integration Services Catalog access through SQL Server 2012 and right-clicking and executing my package.
However, the package keeps failing and I'm getting the following errors when I check the execution report's messages.
They appear to be failing on data tasks where I have script components.
Assign :Error: CS2001 - Source file 'C:\Windows\TEMP.NETFramework,Version=v4.0.AssemblyAttributes.cs' could not be found, CSC, 0, 0
Assign :Error: Failed to compiled scripts contained in the package. Open the package in SSIS Designer and resolve the compilation errors.
This answer is a more detailed version of UberDoodles answer.
In Windows Explorer.
Navigate to C:\Windows\Temp\
Right click the folder and select properties
Go to tab Security, choose Advanced
On the default tab Permissions, choose Change Permissions
For the relevant Permission entry, choose edit.
By default, I had 'allow' checked for Traverse folder / execute file, Create files / write data and Create folders / append data.
Also check 'allow' for List folder / read data and Take ownership.
Press OK, the window closes
Press Apply and confirm anything you need.
Additionally, the logged in user had already Full control, but when I changed this for the entry 'Users', it worked for me.
(based on microsoft file/folder permissions).
I had the same problem today, just on SQL 2016.
For me it helped to change the target server version in Visual Studio project properties from SQL Server 2012 to SQL Server 2016.
I was investigating the same issue, and I came across a solution here :
https://social.msdn.microsoft.com/Forums/vstudio/en-US/73e67f3a-c575-4c73-a71d-ed7a2aeabb50/csc-error-cs2001-source-file-cwindowstempnetframeworkversionv40assemblyattributescs?forum=msbuild
Basically, the account which the package runs under needs to have full permissions to the C:\Windows\Temp\ folder, so that it can create temporary classes.
It worked for me :)
I had the same problem. I first used Eric G. response and added the List and Read permission to the c:\windows\temp. After I got everything working I went back and removed that permission. I then redeployed my solution from Visual Studio, this time designating the deployment target as SQL Server 2014 (which was the environment I was using) using Martin's solution. I then reran the process, and it worked with the List and Read removed.
I kept it using Martin's solution, as I don't like to have special permissions granted if I don't need them.
Good Luck
[Visual Studio 2017 15.9.16]
I just restarted Visual Studio as Administrator and the issue disappeared, which confirms the permissions idea of the answers above but spared me all work.
It's not a quirk though, as per this question and its answer you need that kind of permission for several tasks, like profiling and debugging under certain conditions.
For the sake of completeness, this blog says you might incur in some security contraindication if run VS as administrator when opening third-party solutions.

.svc handler for IIS Server

While configuring the SQL Server 2012 Master Data Services, I am having following problem
The required .svc handler mappings are not installed in IIS.
What I want to do is that, I want to query my database using a URL so that I can retrieve data directly using the URL it self just like we can store the querystring parameters into SQL Server
How do I deal with it, I followed several documents but not any ideas.
To fix this issue, open a command prompt and go to the .NET directory
(for example %windir%\Microsoft.NET\Framework64\v4.0.30319).
Run the command: aspnet_regiis –i
For further details check:SVC Handler mapping error in MDS Configuration Manager
I've come across these types of errors a few times when installing MDS, the problem usually comes about because just having IIS installed is not enough, there are loads of other role services and features that you need to enable and install as well which the setup program doesn't tell you about.
Thankfully they are all documented here:
Web Application Requirements (Master Data Services)
And, if you've missed any, you can go back, install them and then re-launch the configuration tool to complete the setup without having to re-install MDS from scratch.

How to: Configure IIS7 for Web Synchronization

I have followed the instructions here.
To cut a long story short, I just cannot connect to:
https://machine/site/virtual directory/replisapi.dll?diag
I get:
HTTP Error 500.0 - Internal Server Error
Module IsapiModule
Notification ExecuteRequestHandler
Handler ISAPI-dll
Error Code 0x800700c1
Requested URL https://machine:443/site/virtual directory/replisapi.dll
Physical Path C:\inetpub\SQLReplication\replisapi.dll
Logon Method Basic
Logon User machine\user
When browsing to the DLL it does ask for my username and password then shows this error.
We're using a self signed certificate as this is just for testing.
I'm not really a server person so don't know what is going on? There's nothing in the event logs.
Does anyone have any bright ideas of things I could try?
P.S.
I also ran the wizard through SQL 2008 R2 which said it was successful (the wizard only works with IIS6) could there be a conflict between IIS6 and 7 now I have tried to set it up on both?
Ok, this was me being dumb.
After I retraced my steps backwards and unregistered replisapi.dll and moved into a backup directory.
I then removed my module mappings from IIS7.
I then ran the SQL wizard again, which copied replisapi.dll back to the directory.
I noticed it was a different size to the one I was using.
This was because I had got it from "Program Files" but being a 64bit machine the wizard got it from "Program Files(x86)" and now it works.
How simple yet frustrating!
I had to install the 32bit version of the DLL for this to work
I solved this (IIS8 and sql server 2008 x64) by entering ApplicationPool advanced settings and changing "Enable 32-bit Applications" to "True".
Hope this helps. This topic (web sync) is really bad documented

SQL Error OLE.INTEROP

I'm getting an error whenever I load Management Studio or open a folder in the server explorer, etc. Additionally, If I try to create a new database it constantly is updating and does not finish. I have attached a screenshot of the error. Please let me know what I can do to fix this because it's really aggravating.
Error Screen http://frickinsweet.com/databaseError.gif
From MSDN forum http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=120476&SiteID=1
My first guess would be Client Tool corruption.
I've occasionally had to uninstall my client tools and reinstall them. Boot after uninstall.
I had to add the registry file AND re-run "regsvr32 actxprxy.dll" This was a really odd and painful error. It only seemed to come into existence after installing VS SP1 but I really don't see why that would have happened.

Resources