Umbraco - First run - connection string failed - installation

I just downloaded Umraco (via Web Platform Installer).
It takes me to this web page:
How can I just select 'integrated security'?
That connection string is set to a blank database that exists. I have added 'IIS AppPool\DefaultAppPool' and 'IIS APPPOOL\UmbracoTest' as database owner. The next screen is like this Database configuration is invalid for connection string Data Source=.;Integrated Security=True;Initial Catalog=UmbracoTest:
That connection string is fine, I've used '.' datasource elsewhere with no problems (SQL Express).
Is there any way to get useful error messages?
How can I get this working?
Thanks.

I just ran into the same issue during an Umbraco 6.1.5 installation. My issue was the providerName being empty as suggested, so when I added:
providerName="System.Data.SqlClient"
I was able to install and upgrade my Umbraco 6.1.3 database. My full connection string is:
<add name="umbracoDbDSN" connectionString="server=72.18.**.***,1533;database=mydatabase;user id=emma;password=******" providerName="System.Data.SqlClient" />

The connection string is wrong, trust me :)
Instead of DataSource=. try DataSource=.\sqlexpress
Also ensure that the initial catalog=UmbracoTest is actually the correct name of the database.
Finally, since you are using an Umbraco 6.x version, the log files will be at ~App_Data/Logs but in this case they will just tell you much the same as the install screen, that an SqlException has occurred.
Edit:
Looking at the Umbraco source, the error you see is raised by the following code:
if (_configured == false ||
(string.IsNullOrEmpty(_connectionString) ||
string.IsNullOrEmpty(ProviderName)))
{
return new Result
{
Message =
"Database configuration is invalid. Please check
that the entered database exists and that the provided
username and password has write access to the
database.",
Success = false,
Percentage = "10"
};
}
So my assumption is that you are missing the Provider from your connection string. In your web.config file your connection should look like this:

I had the same issue. I fixed it by adding the IIS_IUSRS user to the Umbraco site directory with "Modify" rights as the setup process is trying to write to the web.config with your connection string. Hope this helps.

Related

Unable to connect to Dynamics CE v.9.0 on-Premises

I have a problem with connecting my .net 4.6.2 console app to our on-Premises Dynamics CE v.9.0 installation.
I have the following code to connect:
CrmServiceClient conn = new CrmServiceClient(connectionString);
OrganizationServiceProxy = conn.OrganizationServiceProxy;
This is my connectionString
<add name="CRM" connectionString="Url=http://ServerFQDN/OrgUniqueName; Domain=Mydomain; Username=MyUser; Password=MyPW; AuthType=AD;"/>
I followed the instructions on the following page to generate the ConnectionString
https://learn.microsoft.com/en-us/dynamics365/customer-engagement/developer/xrm-tooling/use-connection-strings-xrm-tooling-connect
Unfortunately is the OrganizationServiceProxy null all the time.
When i look in my CRMServiceClient i do get the following in LastCrmError
LastCrmError = "Unable to Login to Dynamics CRMOrganizationWebProxyClient is nullOrganizationWebProxyClient is null"
I updated all my NuGet packages to the newest Version:
Microsoft.CrmSdk.CoreAssemblies is 9.0.2.5
Microsoft.CrmSdk.Deployment is 9.0.2.5
Microsoft.CrmSdk.Extensions is 7.1.0.1
Microsoft.CrmSdk.Workflow is 9.0.2.5
Microsoft.CrmSdk.XrmTooling.CoreAssembly is 9.0.2.7
Had anyone had the same Problem?
Do you have a tip for me what could be the Problem?
EDIT
I just noticed, that i am not able to Login via the .NET application but also PluginRegistration and XRMToolBox is not working.
I do assume there is an error with the authentication. Maybe in AD.
When i try to connect i now always get the two following errors:
Microsoft.Xrm.Tooling.Connector.CrmServiceClient
Source : mscorlib
Method : HandleReturnMessage
Error : The caller was not authenticated by the service.
And
Inner Exception Level 1:
Source : System.ServiceModel
Method : ThrowIfNegotiationFault
Error : The request for security token could not be satisfied because authentication failed.
EDIT2
If i login to the Deployment Manager i can see "Failed" in the Status field. I think this is related to each other.
Try to add this line before creating CrmServiceClient object
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
I was able to fix the issue.
The Problem was, that there was some mismatch in between our DB an the Deployment Manager.
The following Steps fixed our Problem:
Delete the Organization in Deployment Manager
Import the Organization again from an existing Organization in Deployment Manager
Configure HTTPS (i think this was not necessary to fix the problem)
Hope this helps others.
PS: Here is a link that describes how you can configure HTTPS:
https://learn.microsoft.com/en-us/dynamics365/customer-engagement/on-premises/post-installation-configuration-guidelines-dynamics-365

Configuration Manager returns default connection string

I've added the line
static private readonly string connectionString = System.Configuration.ConfigurationManager.ConnectionStrings[0].ConnectionString;
to my Console App project, and it returns a connection string despite the fact that I haven't yet set one up, and there is no config file anywhere in the solution folder.
It appears to be an ASP.NET database connection string:
data source=.\\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true
Where is VS getting this string from?
I think this has been answered in full here:
Autogenerated Default Connection
Essentially it's a default from Machine.Config.

Sql developer custom connection string

How to use custom connection string in Oracle sql developer to connect?
jdbc:oracle:thin:#(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)
(HOST=147.22.109.218)(port=1521))(ADDRESS=(PROTOCOL=TCP)
(HOST=147.22.109.219)(port=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=147.22.109.220)(port=1521)))
(FAILOVER=on)(LOAD_BALANCE=on)
(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=cmphpd)))
Please help. Thanks
To us a TNS connection string, in the New / Select Database Connection window where you configure the connection:
Set Connection Type to TNS
Under the Details tab select Connect Identifier
Put the connection string into the text box next to Connect Identifier
Click Test if you'd like, to make sure it works
Click Save
Similarly, under Connection Type there also seems to be an option for a custom JDBC URL if that's what you prefer.
(Instructions and screenshot from version 19.4, in case it makes a difference)
Try this:
jdbc:oracle:thin:#147.22.109.220:1521/cmphpd
These are the best and complete instructions I've found.
https://blogs.oracle.com/dev2dev/ssl-connection-to-oracle-db-using-jdbc,-tlsv12,-jks-or-oracle-wallets
Below are the steps which I took to fix this issue:
Install JCE (following the instructions in Readme) - JCE
Add below lines in build.gradle
System.setProperty('oracle.net.ssl_version', '1.2')
System.setProperty('oracle.net.ssl_cipher_suites', '(TLS_RSA_WITH_AES_256_CBC_SHA256)')
System.setProperty('oracle.net.tns_admin', './lib')
System.setProperty('oracle.net.ssl_server_dn_match', 'true')
Setup db connection like
String connString = "jdbc:oracle:thin:#(description=(address_list=
(address=(protocol=tcp)(port=1521)(host=prodHost)))
(connect_data=(INSTANCE_NAME=ORCL)))";
OracleDataSource ods = new OracleDataSource();
ods.setURL(connString);
ods.setUser("scott");
ods.setPassword("tiger");
Connection conn = ods.getConnection();

Entity Framework, ASP.NET, and SQL Server CE

With VS 2010 SP1 I created an ASP.NET MVC4 project from the "internet" template. I then created a connection string for SQL Server CE 4.0:
<add name="DefaultConnection"
connectionString="Data Source=|DataDirectory|MyDatabase.sdf;Password=123456"
providerName="System.Data.SqlServerCe" />
With the web application successfully debug-launched in cassini, I choose the "Register" user option. Immediately this causes the InitializeSimpleMembershipAttribute filter to execute. The filter crashes the site when it reaches this code:
Database.SetInitializer<UsersContext>(null);
using (var context = new UsersContext())
{
if (!context.Database.Exists())
{
// Create the SimpleMembership database without Entity Framework migration schema
((IObjectContextAdapter)context).ObjectContext.CreateDatabase();
}
}
//This line never executes. It is meant to configure my custom user table.
WebSecurity.InitializeDatabaseConnection("DefaultConnection", "Users", "ID", "UserName", true);
The Exists() check throws an ArgumentException stating:
Unable to find the requested .Net Framework Data Provider. It may not be installed.
Now I wanted to be sure that (1) there was nothing wrong with my connection string and (2) there was nothing wrong with my provider. To do that, I inserted a snippet of code before the Exists() check. The snippet used a new SqlCeEngine to create the database, and Dapper calls to setup user tables. That code worked just fine, just before exploding on the Exists() check again.
I then considered that EF might need some additional setup help. I tried replacing the EF defaultConnectionFactory in my web.config:
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
<parameters>
<parameter value="System.Data.SqlServerCe.4.0" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
Still the exception I received did not change.
I'm now wondering if EF needs a "special" connection string to work with SQL Server CE. I will be checking here and here. But at first glance I'm not sure that is the issue.
Thoughts?
EF requires the providers to be installed.
Use one the connect to DB options to check. eg ADD Entity DAta Model to Project. Just to the providers available to it. Do you see your preferred connection Client ?
Seems Compact edition should work with some restrictions...
http://technet.microsoft.com/en-us/library/cc835494.aspx
So then I think its The "DEFAULT CONNECTION" issue
See the Context constructor. EF looks for a connection by that name unless you pass an alternative in.
try...
<connectionStrings>
<add name="MyContextName" connectionString="bla";App=EntityFramework"
providerName="System.Data.SqlServerCe.4.0" />
You need to install Sql Server Compact edition. You can download it from here.

IIS5 - ODBC - Data source name not found and no default driver specified

I’ve got some problem using an ODBC connection with IIS.
Here is my config :
IIS 5 on Windows XP
ASP.NET 2.0
Oracle 9
VS 2005
When I try too use my web application on IIS, I’ve got the following exception:
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
BUT, when I use it like a web site in VS2005, I didn’t have any error.
So, I’d try to make a very little app, with the following code:
using System;
using System.Data;
using System.Data.Odbc;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
OdbcConnection con = new OdbcConnection();
con.ConnectionString = "DSN=<MyDSN>;Uid=<LOGIN>;Pwd=<PASSWORD>";
IDbCommand com = new OdbcCommand();
com.CommandText = "select sysdate from dual;";
com.CommandType = CommandType.Text;
com.CommandTimeout = 30;
com.Connection = con;
try
{
con.Open();
Response.Write(com.ExecuteScalar());
}
finally
{
if (con.State == ConnectionState.Open)
con.Close();
}
}
}
It work fine on VS’s web server (ie: http://localhost:3715/Web/Default.aspx), but I’ve got the same exception (IM002) when I use it on IIS (ie: http://localhost/Tester/default.aspx).
My DSN is declared on the “ODBC Data Source Administrator” and work well when I test the connection…
The ASPNET account is in the same group as my user account (Administrators).
Full right for ASPNET Account on HKEY_LOCAL_MACHINE\SOFTWARE\ODBC and
HKEY_CURRENT_USER\Software\odbc keys.
I've read this post, but nothing work...
I'd look after an answer on stackoverflow (search, related questions, etc.), google...but I didn't found a working solution...
Is there anyone who have an idea?...
Where is my mistake?...
UPDATE: 2011/04/06
What I’ve done so far:
Tracing for ODBC: on VS’Web server, I got log; but on IIS, none...
System and User DSN are filled with the same information
Allow ASPNET, IUSR_XXX, IWAN_XXX, and all users (sic…) accounts full rights to: %ORACLE_HOME%, HKEY_LOCAL_MACHINE\SOFTWARE\ODBC, HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
Windows, VS and IIS are all for 32 bits (so, there is no c:\windows\syswow64).
Check PATH value, and put %ORACLE_HOME% first.
IIS was reset each time I do a modification, my computer reboot twice.
But, now, I’ve got this message:
ERROR [IM003] Specified driver could not be loaded due to system error 998 (Oracle dans OraHome92).
And I finally found...
The administrators have install all the drivers in order to be used by the user only...
I’d create a system env var ORACLE_HOME...
There was only a user var :s
Thanks for your help.
I validate the Garry M. Biggs' answer because of the difference between system/user...
Had this problem ..
The best solution is to re install your odbc driver ... worked for me ..
the registry entries in your system might have got tampered .
I did a complete uninstall and re install .. worked for me .. lame but quick solution .
Make sure you have created a System DSN rather than a User DSN.
IIS will be running as a System service and therefore does not have access to User registry entries...
Maybe your system is 64 bit version
of Windows and IIS is 64 bit, but VS
is 32 bit? If so, look at my
answers:
odbc connection string dosen't work on windows 7
If you can connect from one environment and not from the other then enable ODBC tracing and compare log files. MS described it at: http://support.microsoft.com/kb/274551

Resources