WEBMethods connection string is not working? - connection-string

The following WEBMethods string is not connecting to the server on our companies network drive. I can take the string and place it in a web broswer and i will get a windows exploer screen but when run from WEBMethods the error is Access is denied.
Question: What is causing the access to be denied through WEBMethods? (I can access the file through internet explorer)
Connection String: (Names change to safe guard any information)
//ServerName/DriveName/S/AB/P/T
Error:
com.wm.app.b2b.server.ServiceException: java.io.FileNotFoundException: \\espr1fs05
\DSSXFER\SYSTEMS\ACCESS BACKUPS\Prod\Test\TBE-FILE02.txt (Access is denied)
New Code Added:
System.out.println("outputDirectory --> " + outputDirectory);
writer = new PrintWriter(new BufferedWriter(new FileWriter("doug.txt")));
I have the code in my Java service and would like to write to a network drive as a test.
allowedWritePaths=//ESPR1FS05/DSSXFER/SYSTEMS/ACCESS BACKUPS/Prod/Test;
allowedReadPaths=//ESPR1FS05/DSSXFER/SYSTEMS/ACCESS BACKUPS/Prod/Test;
allowedDeletePaths=//ESPR1FS05/DSSXFER/SYSTEMS/ACCESS BACKUPS/Prod/Test;
The above is how the fileAccessControl.cnf file is configured and this is the same path that I put into the web service for the input file. When I test a write from Java it will work.
What could be wrong with the above write paths?
Error Statements:
com.wm.app.b2b.server.ServiceException: java.io.FileNotFoundException:
\ESPR1FS05\DSSXFER\SYSTEMS\ACCESS BACKUPS\Prod\Test\T.txt (Access is denied)
com.wm.app.b2b.server.ServiceException: java.io.FileNotFoundException:
\\ESPR1FS05\DSSXFER\SYSTEMS\ACCESS BACKUPS\Prod\Test\T.txt (Access is denied)

I'm not sure but did you try reloading the WMPublic package ? Maybe the changes you made to the fileAccessControl.cnf have not been loaded into memory.
Maybe it requires a webMethods server reboot.

When you can not find a file in webMethods. There are maybe couple of reasons.
The file path is in the cache so it may different from what you think it is. Reloading the proper package will resolve it.
The webMethods flow don't have right permission to write to or read from the file. You can edit it in flow's properties window.
WebMethods server mount to the remote drive but don't have permission to read the file.
And I don't suggest directly process the remote file through webMethods. You should use FTP or SFTP to process the file in webMethods server and send it to remote drive.

Related

SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER- have tried everything

I have created a SSIS package and I am trying to run it locally. We use package configurations that point to sql tables and a XML config file. The package ran successfully for about a week, even when deployed to a SQL Server Agent Job in our STAGE environment.
Now, the only way I can get the package to run is by not using the Package Configurations and choosing EncryptSensitivewithPassword. If I change the package to DontSaveSensitive, I continuously get the error below:
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80040E4D Description: "Login failed for user 'Test_User'.".
Error: 0xC020801C at AgentCompany, Lookup [37]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Test" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
It is so strange that about a week ago, this package ran fine with the configurations and the DontSaveSensitive Option.
I have updated the config file to ensure that it is establishing the connection string to the appropriate database. I also test the connectivity on the connection managers and they all test successfully.
I also double checked the SQL Database where the user is trying to connect to ensure that it has permissions there and it does.
I am very confused. Please Help!
Updating dtsconfig file
Re-creating the connection managers
Making some DFT task DelayValidation to true
Changing the RunTime to 32 bit
EncrpytPasswordSensitive with package configs removed---This works but this is not the standard at my company and this is not how I developed and tested the package before
When you open/run a package, an OnInformation event is fired that says something like
The package is attempting to configure from the XML file "c:\ssisdata\so_56776576.dtsconfig".
When Visual Studio/SSDT opens/runs a package which says it uses configuration but for reasons, cannot get them, you should then see messages like
Warning loading so_56776576.dtsx: Failure importing configuration file: "c:\ssisdata\so_56776576.dtsconfig"
and
Warning loading so_56776576.dtsx: The configuration file "c:\ssisdata\so_56776576.dtsconfig" cannot be found. Check the directory and file name.
and
Warning loading so_56776576.dtsx: Failed to load at least one of the configuration entries for the package. Check configuration entries for "Configuration 1" and previous warnings to see descriptions of which configuration failed.
If someone has manually edited the config file and broken the XML, you'd see a warning like
Cannot load the XML configuration file. The XML configuration file may be malformed or not valid
The important thing to note with regard to configuration - if a configuration cannot be found, SSIS will continue along with the design time values. That is why it is crucial to check the warnings emitted when your package runs. If you are running manually, ensure that you have /rep ew specified so you report Errors and Warnings.
Guesses as to root cause
The package has the protection level of EncryptSensitiveWithUserKey which means the AD credentials of the package creator are used to hash things that might have sensitive information in them. I could be using AD authentication in my connection string and specify that the connection should be trusted but that entire block is still going to get encrypted against my Active Directory account. When you come along and attempt to maintain the package, it's not going to be able to decrypt the sensitive data as you are not me.
The two ways around that are to use a shared key (EncryptSensitiveWithPassword/EncryptPackageWithPassword) which is cumbersome to deal with plus it goes against the whole spirit of secrecy since everyone knows the secret. The other approach as you've identified is DontSaveSensitive and that's my go to for all of this.
The problem to be overcome is that with DontSaveSensitive is that every time you save, SSIS is going to wipe out any knowledge of user name and password from places that might be holding on to it - like a connection manager. The 2005/2008 strategy to hedge against this was to use Configuration or explicit overrides at run time to supply user name and password. My typical approach was to use configuration based on a table instead of XML as I was better at securing sensitive data in a table than I was mucking with ACL on the file system. The other challenge we had with multiple developers and file based configuration was that either everyone had to set their file systems up the same (and we developers are unique rainbow snowflakes so that's unlikely) or we need to use a network shared file which is great until someone adds their own values to it and breaks it or removes your changes or any of a host of other challenges.

Receiving Bulk Insert Error 1450 (error not found) when executing stored procedure

Cannot bulk load because the file "\\servername\sharedfolder\folder\file.txt" could not be opened. Operating System error code 1450 (error not found)
The file.txt is on a shared folder in a remote network. I have already googled and tried to apply almost every single entry on the web related to this issue but still unresolved.
I tried windows authentication,sql server authentication, made sure that I have bulkadmin role, requested full access to shared folder from dba.
The error 1450( error not found) is so vague.

SQL Server : backup failing error

Getting the below error while trying to configure the backup source and destination are in different domain.
Executing the query "BACKUP LOG [project_management] TO DISK = N'\\nee..." failed with the following error:
"Cannot open backup device '\\qwerty.xyz.xyzinteractive.com\backup4\Teddy\TLogs\project_management_backup_2016_05_28_020039_7840447.trn'. Operating system error 1326(The user name or password is incorrect.). BACKUP LOG is terminating abnormally.".
Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
It is usually recommended that a backup is done local and then moved. Here is a link that I think is related to the topic. Are you using a service account that has appropriate privileges on both domains?
http://www.sqlservercentral.com/Forums/Topic842263-357-1.aspx
Make sure that the account that's running the MSSQLSERVER service for your instance has access to the network share.
If you're running on a domain and the instance is running as the computer's SYSTEM account, then you'll want to grant access to the computer account instead of a user.
If you're not on a domain or are saving the file across domains that aren't trusted and the instance is running as the computer's SYSTEM account... well, then the easiest way to do it is to change the account to a real service account.

SMO backup reports can't open backup device (which is a file), Message 3201

This code runs fine on a local SQL Server Express instance:
Dim thisSMOBackup As New Backup()
With thisSMOBackup
.Database = singleDatabase.Name 'This contains the database name
.Action = BackupActionType.Database
.Devices.AddDevice(DatabaseFileName, DeviceType.File)
.Incremental = False
.LogTruncation = BackupTruncateLogType.Truncate
End With
Try
thisSMOBackup.SqlBackup(thisServer) 'thisServer is setup w/ valid connection string and reads back data OK from the SQL server
System.IO.File.AppendAllText(logfileName, singleDatabase.Name & " - backed up")
Catch ex As Exception
System.IO.File.AppendAllText(logfileName, singleDatabase.Name & " - " & ex.InnerException.Message & vbCrLf)
End Try
When I apply the same code to a shared hosting SQL Server, it yields the following inner exception error message:
Cannot open backup device 'D:\aFolderName\aBackupName\theDatabaseName.bak'. Operating system error 3(The system cannot find the path specified.). BACKUP DATABASE is terminating abnormally.
Message #: 3201
There seems to be different ways to connect to the servers. For the SQL Server Express instance, I am using the .ServerInstance property, for the hosted server I am using the .ConnectionString property. Does that have anything to do with how the SMO code functions?
I have read that shared SQL hosting servers can have restrictions that are difficult to get past, but before I give up I wanted to ask for input.
The error itself suggests SMO can't find the location to write the file, but it's there, and I set the security for the folder to "Everyone" with "Full Control". But then errors seem to not always mean precisely what they say. I wondered if there were some other parameters I need to setup for this operation to succeed, or other places to look.
When you're trying to create a backup in your shared hosting environment, the backup file is being written to the file system of that remote server machine (NOT your own, local D: drive!) where your SQL Server is running.
Most likely, the user account that runs the SQL Server remotely just doesn't have permission to write to that directory.
Also: this is a good thing! After all, you wouldn't want a remote server machine which you don't know and have no control over to be able to have direct write access to your own, local machine - now would you?
What you could do (esp. in a corporate environment) is to write backups to a UNC path (\\server\share\path) where both the remote SQL Server machine has write access to, and to which you have at least read access, so that you could go there and copy the .bak files to your local machine as needed. With a commercial hosting company, that option very rarely exists, however....

Server Error in Application

Whenever I am viewing my file (file is located in shared drive) to a browser, I am getting this error:
Server Error in '/Test' Application.
Security Exception
Description: The application attempted
to perform an operation not allowed by
the security policy. To grant this
application the required permission
please contact your system
administrator or change the
application's trust level in the
configuration file.
Exception Details:
System.Security.SecurityException:
Request for the permission of type
'System.Web.AspNetHostingPermission,
System, Version=2.0.0.0,
Culture=neutral,
PublicKeyToken=b77a5c561934e089'
failed.
Source Error:
An unhandled exception was generated
during the execution of the current
web request. Information regarding the
origin and location of the exception
can be identified using the exception
stack trace below.
I contacted the System Admin, he said he has given the full access rights to my PC. What is going wrong here?
By default you can't host ASP.NET pages from a shared drive since this is an untrusted location. You will need to edit your .NET configuration to allow this location. You can find a quick guide here (The first answer): http://forums.asp.net/t/1371394.aspx
A quick test before doing that is to copy the project locally and run it. If everything works, then that is your problem. If it is important to keep the project on the shared drive you will have to follow the above steps to make it a trusted location.

Resources