I am currently attempting to create a test environment for a website which is using a mixture of classic ASP and ASP.NET. (The original machines are running old versions of Windows Server, so the configuration is not to easy to mimic)
Unfortunately, I am having problems interacting from Windows 7 to the Server 2003.
The error I am getting from my test application (which simply fires a stored procedure) is as follows:
New transaction cannot enlist in the specified transaction coordinator.
After reading various articles online, I believe I have set-up the COM+ side of things on the Windows 7 machine correctly. If I change my connection string to target the old server, it succeeds.
I then ran MSDTC Simulation V1.9 and the error I recieved was as follows:
DTCping log file: C:\Users\whelans\Desktop\dtping\[servername].log
RPC server is ready
Please Start Partner DTCping before pinging
++++++++++++Validating Remote Computer Name++++++++++++
Please refer to following log file for details:
C:\Users\whelans\Desktop\dtping\[servername].log
Invoking RPC method on [servername]
Problem:fail to invoke remote RPC method
Error(0x6D9) at dtcping.cpp #303
-->RPC pinging exception
-->1753(There are no more endpoints available from the endpoint mapper.)
RPC test failed
I then tried changing my connection string password and it fails due to invalid login, so I believe the COM is reaching the server's database. The user also has full permissions on the database.
I notice in the COM+ Window, that the component in use is spinning as if communicating with the server, however, it seems the server is rejection the connection.
Any ideas?
EDIT: I have now also ran DTCTester, as i read that DTCPing will always fail on Windows 7, here was the result:
C:\Users\whelans\Desktop\dtping>dtctester.exe TestDatabase username password
Executed: dtctester.exe
DSN: TestDatabase
User Name: username
Password: password
tablename= #dtc9033
Creating Temp Table for Testing: #dtc9033
Warning: No Columns in Result Set From Executing: 'create table #dtc9033 (ival i
nt)'
Initializing DTC
Beginning DTC Transaction
Enlisting Connection in Transaction
Executing SQL Statement in DTC Transaction
Inserting into Temp...insert into #dtc9033 values (1)
Warning: No Columns in Result Set From Executing: 'insert into #dtc9033 values (
1) '
Verifying Insert into Temp...select * from #dtc9033 (should be 1): 1
Press enter to commit transaction.
Commiting DTC Transaction
Releasing DTC Interface Pointers
Successfully Released pTransaction Pointer.
Disconnecting from Database and Cleaning up Handles
Related
I'm just starting with boxfuse and can't seem to find a way to get my dev database to be provisioned.
In my boxfuse.yml I have (for the database section):
database:
# the name of your JDBC driver
driverClass: com.mysql.jdbc.Driver
# the username
user: root
# the password
password: <password>
# the JDBC URL
url: jdbc:mysql://10.0.0.84:3306/dmsdb
# any properties specific to your JDBC driver:
properties:
charSet: UTF-8
hibernate.dialect: org.hibernate.dialect.MySQLInnoDBDialect
# the maximum amount of time to wait on an empty pool before throwing an exception
maxWaitForConnection: 1s
# the SQL query to run when validating a connection's liveness
validationQuery: "/* MyApplication Health Check */ SELECT 1"
# the minimum number of connections to keep open
minSize: 8
# the maximum number of connections to keep open
maxSize: 32
# whether or not idle connections should be validated
checkConnectionWhileIdle: false
If I try running it (boxfuse run), my application doesn't work at all.
boxfuse info produces the following:
oxfuse client v.1.18.7.938
Copyright 2016 Boxfuse GmbH. All rights reserved.
Account: mlr11 (mlr11)
Info about mlr11/dms-service in the dev environment:
App Type : Single Instance with Zero Downtime updates
App URL : http://127.0.0.1:8082
DB Type : MySQL database
DB URL : jdbc:mysql://localhost:3306/boxfuse-dev-db
DB Host : localhost
DB Port : 3306
DB Database : boxfuse-dev-db
DB User : boxfuse-dev-db
DB Password : boxfuse-dev-db
DB Status : available
Which is very different than what I was expecting. URL, Database, User, Password) are not matching my boxfuse.yml file.
What I am missing. I know it must be something simple. I did all kind of search and read the doc a few times. I can't seem to find what's wrong. Any pointers will be appreciated.
From the config file you posted I am assuming this is a dropwizard app.
Since your Boxfuse app was configured to use a MySQL database, Boxfuse automatically provisions a database in each environment when you first deploy your application there. In your case you can see the connection info for that database in the dev environment in the output you post in your question.
Boxfuse exposes these values (db url, user, password, ...) as environment variables (https://cloudcaptain.sh/docs/databases#envvars) and automatically configures your framework (Dropwizard I assume) to use those instead of the ones included in your config file. It will do so by passing -Ddw.database.url=$BOXFUSE_DATABASE_URL -Ddw.database.user=$BOXFUSE_DATABASE_USER -Ddw.database.password=$BOXFUSE_DATABASE_PASSWORD as arguments to the JVM.
Also doublecheck in the VirtualBox GUI that your VirtualBox installation is fully functional and able to start VMs and that both the Boxfuse Dev VM and the instance of your application are started properly.
This seems to be a common question, however I haven't found a solution out there and many related questions are quite vague. Anyways, I am deploying an ASP.NET MVC 5 application to AWS using the AWS toolkit for Visual Studio Pro 2013. I have successfully published the app to Elastic Beanstalk with the exception of my database file which exists as a localDB database (.mdf). In trying to migrate this (very small) database I have created an RDS DB instance for SQL Server Express. My issue is that I cannot create a SQL Server DB which appears to be a common issue for VS users: I right click on the DB instance, select "Create SQL Server Database", VS is busy for a few moments and then nothing happens.
What I have done thus far:
I have an RDS instance created on a VPC with a security group that has an Inbound rule set to allow all traffic from my IP
I have an IAM user account with the following policies: PowerUserAccess, AmazonS3FullAccess, AmazonVPCFullAccess (I imagine some of this is redundant-I added additional policies to see if it was a permission issue)
So to succinctly state my questions, why is Visual Studio failing to create the SQL Server DB within the database instance? Or alternatively, is there a simpler method of migrating my database to AWS?
Just FYI, these are the references I have been using to deploy my application:
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_NET.quickstart.html
https://aws.amazon.com/blogs/aws/net-support-for-aws-elastic-beanstalk-amazon-rds-for-sql-server-/
I'm brand new at AWS so let me know if clarification is needed.
Update: I checked the logs for my instance and I'm getting error logs
2014-12-12 18:16:02.72 Server The SQL Server Network Interface library could not register the Service Principal Name (SPN) [ MSSQLSvc/AMAZONA-E3AJMJI ] for the SQL Server service. Windows return code: 0xffffffff, state: 53. Failure to register a SPN might cause integrated authentication to use NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies and if the SPN has not been manually registered.
And
2014-12-12 18:47:23.72 Logon Error: 17806, Severity: 20, State: 14.
2014-12-12 18:47:23.72 Logon SSPI handshake failed with error code 0x8009030c, state 14 while establishing a connection with integrated security; the connection has been closed. Reason: AcceptSecurityContext failed. The Windows error code indicates the cause of failure. The logon attempt failed [CLIENT: 113.108.150.211]
2014-12-12 18:47:23.73 Logon Error: 18452, Severity: 14, State: 1.
2014-12-12 18:47:23.73 Logon Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. [CLIENT: 113.108.150.211]
UPDATE: Issue solved. We use a proxy server in my office which seemed to cause authentication with the RDS instance to fail, not allowing me to connect from my machine. I accepted Ossman's answer as I think it solves a lot of similar questions I've come across trying to solve this.
This is a AWS explorer for Visual Studio 2013 bug and actually occurs because you're using the "default security group" by default when you're creating your DB instance in RDS.
Access the EC2 Service in AWS Management Console.
Click on "Security Groups", and then on "Create Security Group"
Give it a Name, Description and use "vpc-0846aa61" as VPC.
And then add following rule for both "Inbound" and "OutBound" rules
Type: "All traffic"
Source (for Inbound): "Anywhere"
Destination (for Outbound): "Anywhere"
Then Create the Security Group
Go back to your DB Instance and then change the "default" security group to the one you just created. This is done by clicking "Instance Actions" and then "Modify".
Then you should be able to see following window when you right click on your instance in Visual Studio and clicking on "Create SQL Server Database":
My DB Instance:
If i try to call Membership.GetUser();, I get this error: "Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed."
Other than that, membership works, so I can create a new user and log in with it.
(At first, I kept getting the sql sever 2008 and 2008 r2 compatibility error, so I deleted 2008 and installed 2012. )
What should I do?
Well, I tried this solution once again: (I did it a few days ago, but I installed SQL Express 2012 since): Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed, and this time it worked!
I have problems with an ODBC connection used in a batch job: when executed, I have the following error message :
"The ODBC operation failed.Unable to connect to database
Invalid connection String attribute Trusted_Connection
Unabe to create object 'OdbcConnection' "
I try to connect to an Access database, I use the following code:
LoginProperty loginProperty;
OdbcConnection odbcConnection;
;
loginProperty = new LoginProperty();
loginProperty.setDSN("MyDSN");
loginProperty.setDatabase("MyDatabase");
odbcConnection = new OdbcConnection(loginProperty);
when debugging, it crashes on odbcConnection = new OdbcConnection(loginProperty). I tested the same code in a job in local client execution, there was no problem and it worked fine(without defining login password in code or DSN). My DSN seems to be OK on AOS, I'm using AX 2009 without SP1, I saw some examples where there was login/password defined in loginProperty object , the setUserName() and setPassword() methods are not available in my AX version loginProperty object. My class is executed on server-side (as any batch job).
Is there some particular setup to do to connect to ODBC datasource through batch job?
any ideas or suggestions?
thanks for your help
Edit:AOS is running on Windows server 2003 32 bits, ODBC tested on it, works fine but doesn't work in AX through batch job
Most likely you will need a 32-bit DSN connection for your AX. I would create both versions on the AOS server.
Look here for details.
It may be caused due to permisions. "trusted connection" refers to the fact that you connect to the database through the user logged to the current session. When you run a Job from the AX client, this is executed with the user that runs the current AX client (the one logged to the active session); When code is executed from server in a batch job, code is executed through the user that runs the AOS windows service.
Has this user permissions to read/write/access the access file and directory?
If you are on a 64 bit machine use C:\Windows\SysWOW64\odbca32.exe to create the datasource.
Check under which ID the AOS runs, log on with that ID and make sure you can 'see' the data source.
Also make sure that the AOS account has access to the directory/files (if using file-based odbc)
How can I make a scheduled task work? I want to schedule a task that runs a query nightly. The query parses correctly and essentially grabs data from the SQL Server 2005 database on server2 and inserts the data into a table in a database on server1. The query and the task run on server1.
I am able to execute the query in Microsoft SQL Server Management Studio on server1. Using SQL Server Agent, I am able to create and schedule a job to execute the query but the job fails with the following error: Executed as user NT AUTHORITY\SYSTEM. Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' [SQLSTATE 28000] [Error 18456]. IT at my company speculates that I need to be added to the interactive logon list for server2, which is part of the policy.
I have Admin privileges on both server1 and server2, though the latter should not be necessary I think. Both server1 and server2 use Windows authentication, which I gather is set up upon installation of SQL Server.
Here is what I did. First I added server2 to sys.sysservers on server1 with the following command:
EXEC sp_addlinkedserver #server='server2'
Then I created a mapping between logins on server1 and server2 with: EXEC sp_addlinkedsrvlogin #rmtsrvname = 'server2', #useself = 'true'
That allowed me to to execute the query in Microsoft SQL Server Management Studio on server1. It worked. What I found to be curious was that the following didn’t work although "Command(s) completed successfully":
EXEC sp_addlinkedsrvlogin #rmtsrvname = 'server2', #useself = 'false', #locallogin = 'MYDOMAIN\myname', #rmtuser = 'myname', #rmtpassword = '*****'
(Note that real password is unencrypted because of Windows authentication.).
I got the error
Msg 18456, Level 14, State 1, Line 1
Login failed for user 'myname'.
A value of #useself = TRUE specifies that logins use their own credentials to connect to rmtsrvname, with the rmtuser and rmtpassword arguments being ignored. FALSE specifies that the rmtuser and rmtpassword arguments are used to connect to rmtsrvname for the specified locallogin. I would have expected both to work since what I specified for rmtuser and rmtpassword are exactly what I use to log in to the remote server directly.
The job always executes as the user specified in the Sql Server Agent service. If your service is running as LocalSystem, then you need to change your add linked server login to
EXEC sp_addlinkedsrvlogin #rmtsrvname = 'server2', #useself = 'false', #locallogin = 'NT AUTHORITY\SYSTEM', #rmtuser = 'myname', #rmtpassword = '*****'
If not localsystem, then specify whatever login used in the agent
Look at this discussion for more info http://www.sqlservercentral.com/Forums/Topic1003064-146-1.aspx#bm1003182