AWS Lambda errors you don’t want to see

Just want to make a not for myself regarding the errors you might get in case of AWS outage or service degradation. It is what we got on June 22, 2017.

AwsOutageJun22-2017.png

We currently do not have sufficient capacity in the region you requested.

{
"errorMessage": "We currently do not have sufficient capacity in the region you requested. Our system will be working on provisioning additional capacity. You can avoid getting this error by temporarily reducing your request rate.",
"errorType": "ServiceException",
"stackTrace": [
"Object.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/json.js:48:27)",
"Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/rest_json.js:37:8)",
"Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:105:20)",
"Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:77:10)",
"Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:678:14)",
"Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)",
"AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)",
"/var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10",
"Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)",
"Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:680:12)"
]
}

InternalFailure


{
"errorMessage": null,
"errorType": "InternalFailure",
"stackTrace": [
"Object.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/json.js:48:27)",
"Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/rest_json.js:37:8)",
"Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:105:20)",
"Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:77:10)",
"Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:678:14)",
"Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)",
"AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)",
"/var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10",
"Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)",
"Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:680:12)"
]
}

 ServiceUnavailableException

{
"errorMessage": null,
"errorType": "ServiceUnavailableException",
"stackTrace": [
"Object.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/json.js:48:27)",
"Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/rest_json.js:37:8)",
"Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:105:20)",
"Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:77:10)",
"Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:678:14)",
"Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)",
"AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)",
"/var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10",
"Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)",
"Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:680:12)"
]
}

Silent IIS UrlRewrite, ARR and FARM provisioning by #PowerShell

Recently, I had the task to run several fitnesse instances in on the single AWS EC2 instance. The requirement was what each fitnesse instance should be accessible trough port 80 (HTTP). IIS as reverse proxy came to the rescue. But there were one more requirement – IIS Reverse Proxy configuration should be automated.

Here >> konstantinvlasenko/IIS Reverse Proxy << you can find a complete PowerShell script how to install IIS and configure it as reverse proxy.

Prepare your Amazon Linux for Sencha ExtJS 6.0 development

  1. install unzip
  2. install java
  3. download ExtJS 6.0 GPL
  4. download SenchaCMD 6.0
  5. unzip SenchaCMD
  6. unzip ExtJS 6.0
  7. install SenchaCMD
  8. logout/login
sudo yum install unzip
sudo yum install java-1.7.0-openjdk 
curl http://cdn.sencha.com/ext/gpl/ext-6.0.0-gpl.zip -o ext-6.0.0-gpl.zip
curl http://cdn.sencha.com/cmd/6.0.0.202/no-jre/SenchaCmd-6.0.0.202-linux-amd64.sh.zip -o SenchaCmd-6.0.0.202-linux-amd64.sh.zip
unzip SenchaCmd-6.0.0.202-linux-amd64.sh.zip
unzip ext-6.0.0-gpl.zip
./SenchaCmd-6.0.0.202-linux-amd64.sh

Apache proxy for sencha app watch

  1. sudo yum -y install httpd
  2. sudo service httpd start
  3. sudo vi /etc/httpd/conf/httpd.conf
  4. <VirtualHost *:80>
      ProxyPass / http://localhost:1841/
      ProxyPassReverse / http://localhost:1841/
    </VirtualHost>
  5. now you can access your server trough port 80

Howto register AWS SAML metadata in SimpleSAMLphp

  1. There is the page Configuring a Relying Party and Adding Claims. It explains how to get AWS metadata https://signin.aws.amazon.com/static/saml-metadata.xml
  2. Go to you SimpleSAMLphp Federation tab
  3. Click on XML to simpleSAMLphp metadata converter link
    XMLtoMetadata
  4. Copy content of https://signin.aws.amazon.com/static/saml-metadata.xml
  5. Paste it into Metadata parser window. Click Parse button.
  6. Copy Converted metadata content
  7. Paste into Noteapd
  8. Add Auth Procc Filter (mentioned at https://groups.google.com/forum/#!topic/simplesamlphp/AgHEy-5vHdA)

    ‘authproc’ => array(
    10 => array(
    ‘class’ => ‘core:AttributeAdd’,
    https://aws.amazon.com/SAML/Attributes/Role‘ => array(‘arn:aws:iam::<account_number_without_spaces>:role/<role_name>,arn:aws:iam::<account_number_without_spaces>:saml-provider/<’saml_provider_name)
    ),
    20 => array(
    ‘class’ => ‘core:AttributeAdd’,
    https://aws.amazon.com/SAML/Attributes/RoleSessionName‘ => array(‘uid’)
    ),
    ),

  9. Open /var/simplesamlphp/metadata/saml20-sp-remote.php file
  10. Replace its content by content from Notepad

Howto install AWS CodeDeploy on EC2 Windows instance by using CloudInit

  1. Create user-data.txt file
    ————–

    <powershell>
    New-Item -ItemType Directory -Force -Path c:\temp
    Read-S3Object -BucketName aws-codedeploy-us-east-1/latest -Key codedeploy-agent.msi -File c:\temp\codedeploy-agent.msi
    start c:\temp\codedeploy-agent.msi '/qn /l*v c:\temp\host-agent-install-log.txt'
    </powershell>
    

    ————–

  2. Go to AWS EC2 console and select Windows image (e.g. Windows_Server-2012-R2_RTM-English-64Bit-Base-2014.10.15 (ami-ba13abd2))
  3. Click Launch/Spot Request
  4. Provide user data as user-data.txt file
  5. Now you will get Windows instance with AWS CodeDeploy installed. Enjoy!

Amazon RDS Now Supports T2 Instances

That is good news.

T2 instances CPU credits is really great feature introduced 2 months ago for EC2. Amazon RDS Now Supports T2 Instances

At the same time the price for T2 RDS instances is twice less then for the previous generation.

T2.micro EC2 + T2.micro RDS are good if you are thinking about web app which will have the “scheduled” workload. E.g. the main customers are from the particular region.

While the instance is IDLE it accumulate CPU credits. And you servers will be able to burst above the baseline as needed. You can track your CPU Credits trough AWS Console. It is really fun to track them

On the image below one of my EC2 instance has 150 CPU Credits. This means that it will be able to rocket up to the “cloud”  if needed. But still you pay for micro instance. CPU Credits really brilliant idea from Amazon!


CPUCredits