hit counter

Timeline

My development logbook

AWS Dynamo Exception: 400 Bad Request

Getting this error from my server code which uses boto to interace with Dynamo

   [Mon Feb 16 07:25:22 2015] [error] JSONResponseError: JSONResponseError: 400 Bad Request
   [Mon Feb 16 07:25:22 2015] [error] {u'message': u'Signature expired: 20150216T072522Z is now earlier than 20150216T07252
   2Z (20150216T074022Z - 15 min.)', u'__type': u'com.amazon.coral.service#InvalidSignatureException'}

The server is a Window Server 2012 Standard box

Reboot the box fixed the problem

It Happens Too Often

The provisioning failed a few times this morning:

   Reading state information...
   The following extra packages will be installed:
     patch
   Suggested packages:
     diffutils-doc policykit-1
   The following NEW packages will be installed:
     patch update-notifier-common
   0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
   Need to get 248 kB of archives.
   After this operation, 2,361 kB of additional disk space will be used.
   Err http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main patch amd64 2.7.1-4ubuntu1
     Could not resolve 'us.archive.ubuntu.com'
   Err http://us.archive.ubuntu.com/ubuntu/ trusty/main update-notifier-common all 0.154.1
     Could not resolve 'us.archive.ubuntu.com'
   STDERR: E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/patch/patch_2.7.1-4ubuntu1_amd64.deb  Could not resolve 'us.archive.ubuntu.com'

   E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/u/update-notifier/update-notifier-common_0.154.1_all.deb  Could not resolve 'us.archive.ubuntu.com'

But when I ping the server, it responds perfectly.

Setting Value in Chef Cooking

If you set a variable this way in a cookbook:

node['mysqld']['root_password'] = 'password'

you will get this exception

   Chef::Exceptions::ImmutableAttributeModification
   ------------------------------------------------
   Node attributes are read-only when you do not specify which precedence level to set. To set an attribute use code like `node.default["key"] = "value"'

Solution to Php Needs Version Number Problem

I finally found a solution to the ‘No version specified, and no candidate version available for php’ problem

According to this AskUbuntu answer, I need to run the following command to add more repository

    sudo add-apt-repository universe
    sudo add-apt-repository multiverse

    sudo apt-get update

To resolve it in the Chef way, I need this in my recipe:

 include_recipe "ubuntu"

The ubuntu recipe will replace the /etc/apt/sources.list with this content:

    #
    # Ubuntu trusty - Generated by Chef
    #

    deb http://us.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
    deb-src http://us.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse

    deb http://us.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
    deb-src http://us.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse

    #
    # Security updates
    #
    deb http://security.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
    deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted universe multiverse

Chef: No Version Specified, and No Candidate Version Available for Php

In my recipes\default.rb, I added a line

       package "php"

And this caused this exception:

       * No version specified, and no candidate version available for php
       ================================================================================
       Error executing action `install` on resource 'apt_package[php]'
       ================================================================================

       Chef::Exceptions::Package
       -------------------------
       No version specified, and no candidate version available for php

I should use package "php5"

Now I am getting a different set of errors:

       * apt_package[php5] action install

       ================================================================================
       Error executing action `install` on resource 'apt_package[php5]'
       ================================================================================

       Mixlib::ShellOut::ShellCommandFailed
       ------------------------------------
       Expected process to exit with [0], but received '100'
       ---- Begin output of apt-get -q -y install php5=5.5.9+dfsg-1ubuntu4.4 ----
       STDOUT: Reading package lists...
       Building dependency tree...
       Reading state information...
       The following extra packages will be installed:
         apache2 apache2-bin apache2-data libapache2-mod-php5 libapr1 libaprutil1
         libaprutil1-dbd-sqlite3 libaprutil1-ldap php5-cli php5-common php5-json
         php5-readline ssl-cert
       Suggested packages:
         www-browser apache2-doc apache2-suexec-pristine apache2-suexec-custom
         apache2-utils php-pear php5-user-cache openssl-blacklist
       The following NEW packages will be installed:
         apache2 apache2-bin apache2-data libapache2-mod-php5 libapr1 libaprutil1
         libaprutil1-dbd-sqlite3 libaprutil1-ldap php5 php5-cli php5-common php5-json
         php5-readline ssl-cert
       0 upgraded, 14 newly installed, 0 to remove and 0 not upgraded.
       Need to get 6,137 kB of archives.
       After this operation, 25.8 MB of additional disk space will be used.
       Err http://us.archive.ubuntu.com/ubuntu/ trusty/main libapr1 amd64 1.5.0-1
         Could not resolve 'us.archive.ubuntu.com'
       Err http://us.archive.ubuntu.com/ubuntu/ trusty/main libaprutil1 amd64 1.5.3-1
         Could not resolve 'us.archive.ubuntu.com'
       Err http://us.archive.ubuntu.com/ubuntu/ trusty/main php5-json amd64 1.3.2-2build1
         Could not resolve 'us.archive.ubuntu.com'
       Err http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main php5-common amd64 5.5.9+dfsg-1ubuntu4.4
         Could not resolve 'us.archive.ubuntu.com'
       Err http://us.archive.ubuntu.com/ubuntu/ trusty/main libaprutil1-dbd-sqlite3 amd64 1.5.3-1
         Could not resolve 'us.archive.ubuntu.com'
       Err http://us.archive.ubuntu.com/ubuntu/ trusty/main libaprutil1-ldap amd64 1.5.3-1
         Could not resolve 'us.archive.ubuntu.com'
       Err http://us.archive.ubuntu.com/ubuntu/ trusty/main ssl-cert all 1.0.33
         Could not resolve 'us.archive.ubuntu.com'
       Err http://security.ubuntu.com/ubuntu/ trusty-security/main php5-common amd64 5.5.9+dfsg-1ubuntu4.4
         Could not resolve 'security.ubuntu.com'
       Err http://security.ubuntu.com/ubuntu/ trusty-security/main php5-cli amd64 5.5.9+dfsg-1ubuntu4.4
         Could not resolve 'security.ubuntu.com'
       Err http://security.ubuntu.com/ubuntu/ trusty-security/main php5-readline amd64 5.5.9+dfsg-1ubuntu4.4
         Could not resolve 'security.ubuntu.com'
       Err http://security.ubuntu.com/ubuntu/ trusty-security/main apache2-bin amd64 2.4.7-1ubuntu4.1
         Could not resolve 'security.ubuntu.com'
       Err http://security.ubuntu.com/ubuntu/ trusty-security/main apache2-data all 2.4.7-1ubuntu4.1
         Could not resolve 'security.ubuntu.com'
       Err http://security.ubuntu.com/ubuntu/ trusty-security/main apache2 amd64 2.4.7-1ubuntu4.1
         Could not resolve 'security.ubuntu.com'
       Err http://security.ubuntu.com/ubuntu/ trusty-security/main libapache2-mod-php5 amd64 5.5.9+dfsg-1ubuntu4.4
         Could not resolve 'security.ubuntu.com'
       Err http://security.ubuntu.com/ubuntu/ trusty-security/main php5 all 5.5.9+dfsg-1ubuntu4.4
         Could not resolve 'security.ubuntu.com'
       STDERR: E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/a/apr/libapr1_1.5.0-1_amd64.deb  Could not resolve 'us.archive.ubuntu.com'

       E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/a/apr-util/libaprutil1_1.5.3-1_amd64.deb  Could not resolve 'us.archive.ubuntu.com'

       E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/php-json/php5-json_1.3.2-2build1_amd64.deb  Could not resolve 'us.archive.ubuntu.com'

       E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/php5/php5-common_5.5.9+dfsg-1ubuntu4.4_amd64.deb  Could not resolve 'security.ubuntu.com'

       E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/php5/php5-cli_5.5.9+dfsg-1ubuntu4.4_amd64.deb  Could not resolve 'security.ubuntu.com'

   ntu4.4_amd64.deb  Could not resolve 'security.ubuntu.com'

       E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/a/apr-util/libaprutil1-dbd-sqlite3_1.5.3-1_amd64.deb  Could not resolve 'us.archive.ubuntu.com'

       E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/a/apr-util/libaprutil1-ldap_1.5.3-1_amd64.deb  Could not resolve 'us.archive.ubuntu.com'

       E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/a/apache2/apache2-bin_2.4.7-1ubuntu4.1_amd64.deb  Could not resolve 'security.ubuntu.com'

       E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/a/apache2/apache2-data_2.4.7-1ubuntu4.1_all.deb  Could not resolve 'security.ubuntu.com'

       E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/a/apache2/apache2_2.4.7-1ubuntu4.1_amd64.deb  Could not resolve 'security.ubuntu.com'

       E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/php5/libapache2-mod-php5_5.5.9+dfsg-1ubuntu4.4_amd64.deb  Could not resolve 'security.ubuntu.com'



       E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/s/ssl-cert/ssl-cert_1.0.33_all.deb  Could not resolve 'us.archive.ubuntu.com'

       E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
       ---- End output of apt-get -q -y install php5=5.5.9+dfsg-1ubuntu4.4 ----
       Ran apt-get -q -y install php5=5.5.9+dfsg-1ubuntu4.4 returned 100


       ---------------------
       # In /tmp/kitchen/cache/cookbooks/zeeting-analytics/recipes/default.rb

         9: package "php5"