Monday, June 21, 2010

Ruby Stack Too Deep Error Generating Chef Metadata

If you get a "stack too deep" exception from the json gem when generating chef metadata (either rake metadata or knife cookbook metadata), you may need to roll back you json gem version to 1.4.2.

See this bug report.

Thursday, April 15, 2010

Problems with S3Fox?

I've been using S3Fox to access AWS S3 for quite a while now but recently I've had trouble with it. When I launch it from Tools | S3 Organizer, it fails with an "error connecting to server" message. Launching it in "dropbox mode" from the status bar works fine, though.

I found this thread suggesting a workaround. Apparently you have to log out of your Google account before launching S3Fox. I don't know why this would cause problems, but it works for me.

I'm using Firefox 3.6.2 and the most recent version of S3Fox on Windows 98

Monday, March 29, 2010

More fun with Chef in the Cloud

I've been working with Chef on the RightScale platform for about six months now. I've written several cookbooks to stand up self-service applications for internal use at my company. I and my colleague think we know enough about how it works now to do it right.

When we started out, RightScale hadn't yet released their chef infrastruture. So I started out by installing two chef servers: one in the public EC2 and one in our VPC. I used these to start writing and testing my cookbooks so that they'd be ready once RightScale released.

Once RightScale did release, I shutdown my chef servers and forgot about them. But recently, we've been talking to Adam Jacob and his crew at Opscode and we want to see what a hybrid RightScale / Opscode environment would look like. That means going back to owning our own chef servers (and possibly later replacing them with the Opscode Platform).

But Chef is moving pretty quickly. They've made a major release since I last had chef servers running in which they've changed the authentication system dramatically. Sadly, the CentOS RPM at ELFF hasn't caught up, so to take advantages of the new 0.8.x features, I had to install it myself.

It hasn't been easy, so I'll post what I've done here in case someone else has the same problems I did. I'm using a custom AMI of CentOS 5.3 on Amazon's EC2 in our VPC, launched with RightScale

First off, I followed the directions at the Chef Wiki for preparing a CentOS host to be come a chef server. Next I followed the directions for bootstrapping a server. The things that tripped me up were
  • RightScale runs their own AMQP service on their instances to manage communications with their infrastructure. You'll have to remove it, turn it off, or change the chef RabbitMQ port to something else. I just turned it off for this experiment. I don't know the implications of changing the chef RabbitMQ port.
  • Don't forget the final bit at the bottom of the first page that describes setting up the chef user, setting permissions on run diretories and starting the services for CentOS.
  • Be sure to use "init_style": "init" in your json file when bootstrapping.
  • Be sure to modify your init scripts to add -P $pidfile as in CHEF-1074 so service stop/restart work properly.
Even after this I still had problems. Because I had re-run chef-solo a number of times, the default admin password in /etc/chef/server.rb had changed (though the one in the db had not). Lucky for me, chef backs up templated files so I was able to recover it. Once I had changed the admin account password, I got a 500 error from merb: "named route not found: new_nodes".

Google found this IRC chat log (search for "BobFunk" and read on) which suggested I downgrade merb from 1.1.0 to 1.0.15 and that fixed the problem. Here are the commands to do that

gem install merb-core merb-assets merb-haml merb-helpers merb-param-protection merb-slices -v=1.0.15
gem uninstall -I merb-core merb-assets merb-haml merb-helpers merb-param-protection merb-slices -v=1.1.0

So now I seem to have a working chef server once again. I just need to hide it behind an Apache proxy so I can serve it over SSL on port 443 (though I guess I'll need two secure ports, one for the webui and one for the api). Next I'll need to actually install my cookbooks and test them out on some new clients.

Friday, January 22, 2010

Absentee Gamer Rules for 4th Edition D&D

It's always tough to figure out what to do when a player can't make it to the game (or is coming, but will be late) but his character cannot be removed from the game without really stretching credibility. Many times, someone ends up running the absentee character as well as his own, which slows things down and makes it less fun. Sometimes you don't even have the absentee character's sheet, which makes this an impossible situation.

So here's how I solved it last night. When a character is expected to be in a session, but the player cannot, the reset of the player characters gain the following Encounter Power:

Encounter Power:
Put a "Hell to Pay" token on the table and select one of the following:
  • Immediate interrupt (free action). Trigger: when you are hit by a melee or ranged attack. Effect: You don't take any damage.
  • Minor action: make a basic melee or basic ranged attack
  • Minor action: make a skill check in which the absentee character is trained. You are considered trained in this skill for this check only.
  • Minor action: One adjacent enemy grants combat advantage to you and all allies adjacent to the enemy.
When the absentee player returns to the game, all characters lose this power and the absentee character loses a healing surge for every "Hell to Pay" token on the table. If he has no more healing surges, he takes damage equal to one quarter his total hit points for every remaining tokens. Remove all "Hell to Pay" tokens from the table.

Wednesday, January 06, 2010

The Map to the Coterminous Bazaar

I haven't posted in a long time. Been busy I guess. Things like Facebook and Twitter kind of take the need to blog out of you. At any rate, here's a 4th Edition D&D ritual I made for my campaign. It allows the players to travel to an extra-dimensional marketplace where they can fence loot, shop for exotic items and get themselves into trouble. It's an idea I heisted from my previous 3rd Edition "Three Lakes" campaign.

The Map of the Coterminous Bazaar
You hold a large parchment bearing the map of a circular city on one side and an arcane ritual on the other. Each map has a unique ritual which drops the travelers to a specific location in the Coterminous Bazaar.

The Map Ritual
Level: 8 Component Cost: 100 gp per traveler
Category: Travel Market Price: 1000 gp
Time: 30 minutes Duration: Instantaneous
Key Skill: Arcana

All creatures those touching the map (and the map itself) are instantly transported to the Coterminous Bazaar. The components are not actually arcane components but must be valuables equaling at least the cost described above. These are tribute to the ruler of the Bazaar. Upon arrival, each traveler loses a healing surge. You must succeed at a DC20 Arcana check to travel to the Bazaar.

In order to return, you must perform this ritual again without the component cost but you must make an Arcana check to determine how much time has elapsed while you were visiting the Bazaar. You may pick a time ratio lower for a check result lower than the one you actually achieved.

Arcana Check Result / Time Ratio (home : Bazaar)
20 or lower / 2 : 1
21-25 / 1 : 1
26-30 / 1 : 2
31-35 / 1 : 4
35 or higher / no time elapses at home

Focus: Each traveler must be holding the map.