Getting the following error while trying to access an AppFabric cache. Our Cache was created yesterday and nothing happened, that we know of, to remove the Cache. Does anybody have any suggestions on troubleshooting what could be causing our Cache to be removed from the server?
I was able to resolve the error by simply running New-Cache EAI at the PowerShell command prompt
ErrorCode:SubStatus:Cache referred to does not exist. Contact administrator or use the Cache administration tool to create a Cache.
var cache = new DataCacheFactory().GetCache("EAI");
FYI: We are using SQL for our config store
Related
I had some problems with using the authorization before so I got a brand new everything - new computer, new OS, fresh installation of VS, new app and DB in a new resource group on the Azure. The whole shabang.
I can confirm that I can log in to the Azure DB as the screenshots below show.
I can see the databases, tables, users etc.
The problem is that, although it works locally (using the default connection string provided automagically for me), it doesn't perform very well in the Azure (although I'm using the publish file from there). It said something about the file not being found and according to this answer, I needed to change the connection string.
After I've altered it, I get the following error. Please note that the firewall is open and that I can access the DB when I run the code of my applications. I feel that there's something that goes wrong when the authentication part is automatically configured. I'm out of ideas on how to trouble-shoot it, though.
[SqlException (0x80131904): Login failed for user 'Chamster'.
This session has been assigned a tracing ID of '09121235-87f3-4a92-a371-50bc475306ca'. Provide this tracing ID to customer support when you need assistance.]
The connection string I'm using is this.
Server=tcp:f8goq0bvq7.database.windows.net,1433;
Database=Squicker;
User ID=Chamster#f8goq0bvq7;
Password=Abc123();
Encrypt=True;
TrustServerCertificate=False;
Connection Timeout=10;
This issue's bothered me for a while and I'll be bounting it in two days. Any suggestion's warmly appreciated.
I believe I've managed to resolve this weird issue. It appears that the user I'm using, despite being admin with all bells and whistles isn't recognized as admin when used in the connection string and trying to create the tables (which is the case at the first registration).
My solution was to create two logins - one with db_owner role and one with db_datareader and db_datawriter. First, I've used the elevated user in my connection string and registered a single user. That created the tables in the database as shown below.
Then, while able to continue as admin, I realized that we should try the demoted user and tada!, it worked perfectly. Once the tables were there, the whole shabeling behaved as expected.
To be perfectly sure, I dropped the tables from the database and there it was - the same issues as before. When I changed to the elevated user, the tables were restored allowing me to get back to the demoted one.
I also tried dropping the tables, confirming the issues to re-appear and then creating the tables manually. That works too! So basically,the only gotcha that caused it all was the original admin who's not treated as admin.
It might have to do with the fact that my Azure account's getting a bit old, LiveID used there is ancient and that didn't have an updated version of DB in Azure (the pull-up to v12 was carried out the 18th of December, so it's possible that it also was a requirement to get it working). I'm too tired and lazy to check that out and I realize that I've no idea how to get an "old" type of account. Besides, the issue will decrease and gradually vanish because the old accounts get upgraded eventually.
I am working on one project which is in Asp.Net web form and Sql server. When I run application I get the error Unable to connect Sql Server Session Database and inner exception is Cannot open database ASPState requested by the login.
I did some google search to fix this issue. I don't have sa password so i cannot logged in as sa to assign privileges to ASPState database for the newly created User.
I don't see any ASPState database on Sql Server when i logged in. So i thought I might need to run aspnet reg exe on my machine. So i tried to run aspnetreg_regsql.exe but i got the following error.
An error occurred during the execution of the SQL file
'InstallCommon.sql'. The SQL error number is 5170 and the SqlException
message is: Cannot create file 'C:\Program Files\Microsoft SQL
Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\aspnetdb.mdf' because it
already exists. Change the file path or the file name, and retry the
operation.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Creating the aspnetdb database...
I am totally blank now to solve this issue, I will really appreciate your suggestion for this. This issue hold to publish on production.
Dont think that there is a simple answer to this with the permissions that you have, I think that what has happened is that the database HAS been created, but the user you are using does not have any access to it at all.
Without having an administrators credentials I dont think that you will be able to resolve the problem.
You can however work around it by re-creating the database with a different name:
aspnet_regsql -d[YourNewDBName] -RestOfYourParamaters
That should allow you to re-run the creation script, however there is no guarantee that you wont end up with the same issue on the newly created database.
You should issue the command DROP DATABASE aspnetdb and then re-run your script.
'InstallCommon.sql' surely ain't any database. It must be a script that installs a new Database, as the name suggests. Run the script, and then link the generated database
I'm developing a cloud service using Azure Mobile Services, and in order to test it quickly and debug it, I want to deploy it in my local computer. I select the project, hit F5, got it running in IIS express in my local PC. I execute the cliente against my local URI address of the IIS service and when I try to insert a value, this exception appears if I try to retrieve or insert a new object:
An exception of type 'System.ArgumentException' occurred in EntityFramework.SqlServer.dll but was not handled in user code
Additional information: The database name 'TR_MyTrip_Server_ExtraData_Service]_Persons_InsertUpdateDelete' is invalid. Database names must be of the form [<schema_name>.]<object_name>.
I debugged the Initialization of the controller and found out that mobile services deploys a LocalDb instance with this connection info on the DataBase property of the ServiceContext object:
Data Source=(localdb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-MyTrip.Server.ExtraData.Service-20140731060708.mdf;Initial Catalog=aspnet-TestProject.Server.ExtraData.Service-20140731060708;Integrated Security=True;MultipleActiveResultSets=True
It is not able to find this DataBase if I try to connect with this connection string to the LocalDB via the SQL Management Studio
I'm able to access to the LocalDb instance with the SQL management studio running this command on CMD and retrieving the Connection for the LocalDB
SqlLocalDB.exe info v11.0
Eitherway, on the SQL Management Studio I'm not able to see any DataBase relating my controller of the Mobile Services. I searched on google and the only related link I found was this but is not working... Does anybody know what's happening?
Thank you so much
This is a problem when you have a project name with periods in it. Like TestProject.Server.ExtraData.Service.
To fix this, go into the web.config and edit the appsetting named "MS_MobileServiceName" taking out the periods. This is the value used as the SQL schema name for your mobile service tables in the database. It can't have periods or other special characters in it.
I generally try to make this the same as the name of the mobile service I'll deploy to, but it's not technically required.
For whatever reason, I couldn't get this working using the accepted answer. I assume this has something to do with the disclaimer in web.config which states:
After publishing to Mobile Services, these settings will be overridden by the values specified in the portal.
However, I did find another work around in the MobileServiceContext file where I replaced this line:
string schema = ServiceSettingsDictionary.GetSchemaName();
if (!string.IsNullOrEmpty(schema))
{
modelBuilder.HasDefaultSchema(schema);
}
with a simple string value modelBuilder.HasDefaultSchema('mySchema');
I imagine there's a way to influence the output of GetSchemaName() but, considering how much effort it took to resolve this problem, I am perfectly content with this solution for now.
If you've changed the MS_MobileServiceName in config to remove the periods, and you're still getting the error, you'll need to re-run the scaffolding for the Initial migration in the package manager console:
Add-Migration Initial -Force
From what I could see, the scaffolding generates an embedded .resx that still has your old schema name (DefaultSchema), and a snapshot (Target) that is referenced in the designer code. Just changing the DefaultSchema didn't solve the issue for me, but re-running the scaffolding did.
I also added Table annotations to my models, but I don't think that was the issue. And probably isn't ideal if your service is already live.
I am trying to write some c# code that writes a new Performance Counter Category if it doesn't exist, and then adds a specific counter. When I run this code from the Visual Studio dev server, everything works fine. When I deploy it to IIS and try it, I get permission errors. I am running Windows 7 and using IIS 7.5.
What I have done so far, some of which is being done out of desperation:
Created a new App Pool that I will run as a specific user
Created a new user and added him to the Process Monitor and Administrator groups
Set the new user as the identity of the new App Pool
Pointed my web service to that App Pool.
Went in to regedit and gave the user full control over HKLM/System/CurrentControlSet (apparently there should be a permissions folder, but I don't see it anywhere).
I know these steps have worked partially, because I am now able to check whether or not a category exists (ASPNET user couldn't even do that). I can check if a category exists, I just cant add a new one.
The error that I get is
Cannot create or delete the Performance Category 'C:\Windows\TEMP\tmp1AA8.tmp' because access is denied.
The code to add the performance counter category is looks like this:
if (!PerformanceCounterCategory.Exists("APIService"))
{
CounterCreationDataCollection counters = new CounterCreationDataCollection();
CounterCreationData counter = new CounterCreationData();
counter.CounterName = "# of operations executed";
counter.CounterHelp = "Operations executed";
counter.CounterType = PerformanceCounterType.RateOfCountsPerSecond32;
counters.Add(counter);
PerformanceCounterCategory.Create("APIService", "Api Counter", PerformanceCounterCategoryType.SingleInstance, counters); // This code blows up
}
I have searched high and low and cant find anyone with the same problem. I have even tried giving Everyone Full Control over c:\windows\temp. Any idea what I might be missing here?
I think I figured out the solution (or rather someone else did, but I can find a link to that forum this morning). Instead of setting the App Pool to run as an admin, I switched it to the Local System user. That seems to have resolved everything, as the user has sufficient rights to write performance metrics and everything else that needs to be done.
I have been asked to write a small utility to copy users from an AD to another system.
I found this posting which looks perfect to get me going...
How can I get a list of users from active directory?
As I don't have an AD to work with, I went to my Azure portal and created one on there to test against...
Then, it looked like all I needed to do was insert my domain in this line....
using (var context = new PrincipalContext(ContextType.Domain, "yourdomain.com"))
My domain, as supplied by Azure is xxxx.onmicrosoft.com
but when I run the code, I keep getting
An unhandled exception of type 'System.DirectoryServices.AccountManagement.PrincipalServerDownException' occurred in System.DirectoryServices.AccountManagement.dll
Additional information: The server could not be contacted.
Can anyone see what I am missing please?
i borrowed my mates old server and built a local server 2012 and joined the domain.
probably not everyone's answer. but worked for me.
(if i had more time i would have liked to get the azure domain working... im sure i built it right. just didn't work.
so that's my answer.