Visual Studio Single Instance Deployment Error - visual-studio-2010

I'm trying to upload my web app to an EC2 instance through the .NET SDK using the "Publish to AWS" feature. For my other web application, this worked perfectly! The only difference between the two that I can see is this web app has a connection string to an attached RDS instance that is already live.
When the publish does go through, the instance launches and seems to be running fine. Within about ten minutes, the instance rolls back and terminates itself. After unchecking the terminate on fail checkbox the instance won't terminate, however I'm not able to access my Default.aspx page. I haven't been able to find anything helpful in the logs. I'm thinking it must have something to do with the connection string and attached volume.
I added my security group to the RDS instance that I use to launch the instance, however it still returns the same error.
Publish Info:
Instance Size: Micro
SDK Version: 1.5.10
AMI: ami-10ec6520
Region: US West 2
Error:
WaitCondition timed out. Received 0 conditions when expecting 1.
Stack Template
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "This will launch a single EC2 instance and deploy your application to it. **WARNING** This template creates one or more Amazon EC2 instances. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters" : {
"InstanceType" : {
"Type" : "String",
"Default" : "t1.micro",
"Description" : "EC2 instance type."
},
"KeyPair" : {
"Type" : "String",
"Description" : "EC2 Key Pair."
},
"SecurityGroup" : {
"Type" : "String",
"Description" : "EC2 Security Group"
},
"BucketName" : {
"Type" : "String",
"Description" : "[Hidden]S3 Bucket for deployment."
},
"ConfigFile" : {
"Type" : "String",
"Description" : "[Hidden]Deployment Configuration File."
},
"AmazonMachineImage" : {
"Type" : "String",
"Default" : "ami-10ec6520",
"Description" : "AMI to launch."
},
"UserData" : {
"Type" : "String",
"Description" : "[Hidden]Base64-Encoded user data."
}
},
"Resources" : {
"DeployedApplicationWaitHandle" : {
"Type" : "AWS::CloudFormation::WaitConditionHandle",
"Properties" : {
}
},
"DeployedApplicationWaitCondition" : {
"Type" : "AWS::CloudFormation::WaitCondition",
"DependsOn" : "Ec2Instance",
"Properties" : {
"Handle" : { "Ref" : "DeployedApplicationWaitHandle" },
"Timeout" : "900"
}
},
"Ec2Instance" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
"ImageId" : { "Ref" : "AmazonMachineImage" },
"KeyName" : { "Ref" : "KeyPair" },
"InstanceType" : { "Ref" : "InstanceType" },
"SecurityGroups" : [{ "Ref" : "SecurityGroup" }],
"UserData" : { "Fn::Base64" : {"Fn::Join" : [ "", ["[", { "Ref" : "UserData" }, "]", "[", { "Ref" : "DeployedApplicationWaitHandle" }, "]"] ]}}
}
}
},
"Outputs" : {
"URL" : {
"Description": "URL of the deployed application",
"Value" : { "Fn::Join" : [ "", [ "http://", { "Fn::GetAtt" : [ "Ec2Instance", "PublicDnsName" ] }]]}
},
"Bucket" : {
"Description" : "The S3 Bucket where the Web Deploy archive and configuration file are uploaded",
"Value" : { "Ref" : "BucketName" }
},
"ConfigFile" : {
"Description" : "The deployment configuration for the application",
"Value" : { "Ref" : "ConfigFile" }
},
"VSToolkitDeployed" : {
"Description" : "A flag indicating that the stack was created via VSToolkit Deploy wizard",
"Value" : "True"
}
}
}
UPDATE 1/18/2013
I finally got an instance launched that let me RDP into it. Below is the error that stuck out.
Error:
Microsoft.Web.Deployment.DeploymentFatalException: The SQL provider cannot run because of a missing dependency. Please make sure that Microsoft SQL Server Management Objects (Version 10 or higher) is installed. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
Any help would be greatly appreciated! If there's any more information that would be helpful to provide, just let me know.

Turns out the answer was within my deployment settings in Visual Studio. Very amateur mistake on my part. In Project Properties => Package/Publish Web I needed to uncheck "Include all databases configured in Package/Publish SQL tab"
Since my database was already out and configured on RDS, all I needed to do was include the correct connection string in the Web.config file.
Thanks everyone for the help!

Related

elasticsearch snapshot are not being published on azure storage account

I implemented to setup elasticsearch Backup and Restore From Azure Blob Storage but When i am running the below query I am getting the response as "acknowledged" but when i check the storage account, I dont see the backups
PUT _snapshot/azure-kibana
{
"type": "azure",
"settings": {
"container": "elasticsearch-snapshots",
"chunk_size": "32MB",
"compress": true
}
}
output
#! Deprecation: Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See https://www.elastic.co/guide/en/elasticsearch/reference/7.17/security-minimal-setup.html to enable security.
{
"acknowledged" : true
}
GET /_snapshot/_all
#! Deprecation: Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See https://www.elastic.co/guide/en/elasticsearch/reference/7.17/security-minimal-setup.html to enable security.
{
"my_backup" : {
"type" : "fs",
"settings" : {
"location" : "/home/ubuntu/mount/backup"
}
},
"azure-kibana" : {
"type" : "azure",
"settings" : {
"container" : "elasticsearch-snapshots",
"compress" : "true",
"chunk_size" : "32MB"
}
},
"azure-kibana2" : {
"type" : "azure",
"settings" : {
"container" : "test",
"compress" : "true"
}
}
}
I reinstalled the plugin and did the setup again, now my snapshots are visible in the storage account

Error in elasticsearch: Invalid snapshot name snapshot with the same name already in-progress

I have a problem.
I want to store an index that is in elasticsearch. I created a new repository for this and this repository does not have any snapshots. But when I ran the code blog below, it returned me the error message "Invalid snapshot name snapshot with the same name already in-progress ". How can I fix this problem?
I created a new repository with the following code block:
PUT /_snapshot/backup_repository
{
"type": "fs",
"settings": {
"compress" : "true",
"location": "C:/backups/backup_my_index"
}
}
just to be sure i used the code block below and the query returned me this result:
GET /_snapshot/backup_repository/_status
result:
{
"snapshots" : [ ]
}
I wanted to make a backup with the following code block:
PUT /_snapshot/backup_repository/my_snapshot?wait_for_completion=true
{
"indices": "my_index",
"ignore_unavailable": true,
"include_global_state": false,
"metadata": {
"taken_by": "busra duygu",
"taken_because": "backup for my_index"
}
}
Error :
{
"error" : {
"root_cause" : [
{
"type" : "invalid_snapshot_name_exception",
"reason" : "[backup_repository:my_snapshot] Invalid snapshot name [my_snapshot], snapshot with the same name is already in-progress"
}
],
"type" : "invalid_snapshot_name_exception",
"reason" : "[backup_repository:my_snapshot] Invalid snapshot name [my_snapshot], snapshot with the same name is already in-progress"
},
"status" : 400
}
I would be very happy if you could help me.
To see if there is a snapshot that already exist with this name
GET /_snapshot/backup_repository/_all
You will also get the state of it (SUCCESS/FAILED,...)
#ExploZe
As you said i ran this query and it returned me the following result.
Query:
GET /_snapshot/backup_repository/_all
Result:
{
"snapshots" : [
{
"snapshot" : "my_snapshot",
"uuid" : "4Sv055VjQDSZvpBqSvCxpg",
"version_id" : 7100199,
"version" : "7.10.1",
"indices" : [
"my_index"
],
"data_streams" : [ ],
"include_global_state" : false,
"metadata" : {
"taken_by" : "busra duygu",
"taken_because" : "backup for my_index"
},
"state" : "IN_PROGRESS",
"start_time" : "2021-09-09T06:22:16.414Z",
"start_time_in_millis" : 1631168536414,
"end_time" : "1970-01-01T00:00:00.000Z",
"end_time_in_millis" : 0,
"duration_in_millis" : 0,
"failures" : [ ],
"shards" : {
"total" : 0,
"failed" : 0,
"successful" : 0
}
}
]
}

Packetbeat does not point to a write index

I tried to edit packetbeat Policy, and then from index management on Kibana I removed the policy from that index and then added it again (to take on consideration the new configuration),
unfortunately I a getting a lifecycle error
illegal_argument_exception: rollover target [packetbeat-7.9.2] does not point to a write index
I tried to run :
PUT packetbeat-7.9.2-2020.11.17-000002
{
"aliases": {
"packetbeat-7.9.2": {
"is_write_index": true
}
}
}
But I got the error:
{
"error" : {
"root_cause" : [
{
"type" : "resource_already_exists_exception",
"reason" : "index [packetbeat-7.9.2-2020.11.17-000002/oIsVi0TVS4WHHwoh4qgyPg] already exists",
"index_uuid" : "oIsVi0TVS4WHHwoh4qgyPg",
"index" : "packetbeat-7.9.2-2020.11.17-000002"
}
],
"type" : "resource_already_exists_exception",
"reason" : "index [packetbeat-7.9.2-2020.11.17-000002/oIsVi0TVS4WHHwoh4qgyPg] already exists",
"index_uuid" : "oIsVi0TVS4WHHwoh4qgyPg",
"index" : "packetbeat-7.9.2-2020.11.17-000002"
},
"status" : 400
}
Could you tell me how Can I solve this issue please ?
Thanks for your help

How can I use CloudWatch to see detailed monitoring for EC2 instances from Cloudformation?

I could do this from the AWS Console and from the command line :
aws ec2 monitor-instances --region --instance-ids
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html#cfn-ec2-instance-monitoring
I could use the above Monitoring API, however this needs to be done for Existing EC2 Instances.
You can simply use an AWS::CloudWatch::Alarm type with any supported metrics for EC2 instances.
For example, assume you need to monitor CPU utilization.
"CPUAlarm" : {
"Type" : "AWS::CloudWatch::Alarm",
"Properties" : {
"AlarmDescription" : "CPU alarm for my instance",
"AlarmActions" : [ { "Ref" : "logical name of an AWS::SNS::Topic resource" } ],
"MetricName" : "CPUUtilization",
"Namespace" : "AWS/EC2",
"Statistic" : "Average",
"Period" : "60",
"EvaluationPeriods" : "3",
"Threshold" : "90",
"ComparisonOperator" : "GreaterThanThreshold",
"Dimensions" : [ {
"Name" : "InstanceId",
"Value" : { "Ref" : "logical name of an AWS::EC2::Instance resource" }
} ]
}
}
Ref - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-cloudwatch.html

Kibana 3 bettermap ploting lat/long in wrong location on map

I am trying to use bettermap in Kibana 3 to see lat/long data. My geo location is shown in the map in Africa where as the lat/long I have specified are for US.
Any help on the same would be appreciated?
my mapping file is
{"mappings" : {
"livestats" : {
"_source" : {
"enabled" : true
},
"_timestamp" : {
"enabled" : true
},
"_all" : {
"enabled" : false
},
"properties" : {
"state" : { "type" : "string", "index" : "not_analyzed", "store" : "yes" },
"LatLng" : { "type" : "geo_point" , "index" : "analyzed", "store" : "yes"}
}
}
}
}
and dummy data is
{"create":{"_index":"livestats","_type":"livestats"}}
{"state":"CA","LatLng":[-118.252,34.0433]}
thanks
Try with lonlat as the dummy data.
The tooltip on better map says: "geoJSON array! Long,Lat NOT Lat,Long"
The problem is that you have to specify the full fieldname in Bettermaps (Kibana 3.0.0). The autosuggested fieldnames, when you preload the fieldname's of your index, are missleading.
Here is my suggestion:
Replace the mapping of LatLon with:
"LatLng" : { "type" : "geo_point"}
Make sure you comply with GeoJSON Specification: [lon,lat] and not [lat,lon]
In Kibana, use the following field:
"livestats.LatLng"
That should do the trick!

Resources