Overview
Customers may experience multiple issues while trying to deploy their application on a new environment. These issues can range from failure to install certain gems due to missing packages on the utility server, deployment failure due to missing encryption keys, errors related to Redis installation, errors when uploading and applying recipes from localhost console, to TypeErrors during a Chef run.
Solution
- If there's a missing package for example libxml2-dev , Install the missing libxml2-dev package on the utility server using the following commands:
apt-get install libxml2-dev gem install libxml-ruby -v '4.1.1'
- To resolve the missing encryption key error, ask your team for your master key and put it in ENV["RAILS_MASTER_KEY"].
- To resolve the Redis installation error, modify the `ey-redis/attributes/default.rb` file as per the provided options. To install Redis on a solo instance, modifications to the recipe are required.
To resolve this, you can use an overlay to modify ey-redis/attributes/default.rb. Here are two options:
-
Solution: Overlay
ey-redis/attributes/default.rb
using one of the options below: - Option 1: Modify condition to check if env var is equal to util and included in the list of utility instances[OR]solo instance:
40 # Run Redis on a named util instance
41 # This is the default
42 redis["utility_name"] = fetch_env_var(node, "EY_REDIS_INSTANCE_NAME", "redis")
43 redis_instances << redis["utility_name"]
44 redis["is_redis_instance"] = (
45 node["dna"]["instance_role"] == fetch_env_var(node, "EY_REDIS_INSTANCE_ROLE", "util") &&
46 redis_instances.include?(node["dna"]["name"]) ||
47 )- Option 2: Comment out lines 42-47 and uncomment line 51, which will install redis in solo instance:
49 # Run redis on a solo instance
50 # Not recommended for production environments
51 redis['is_redis_instance'] = (node['dna']['instance_role'] == 'solo')- For more information on using overlays, you can refer to this guide - Customizing Your Environment Using Overlay Chef Recipes
We recommend creating an overlay as suggested above, uploading the cookbooks again, and then checking with the chef if this resolves the issue. -
Solution: Overlay
- To resolve the 'Unknown cookie parameter 'samesite'' error, update `ey-core` to the latest version, remove the old version of `ey-core`, and install `cookiejar` from sources with the following commands:
gem update ey-core gem cleanup ey-core gem install specific_install gem specific_install -l 'https://github.com/dwaite/cookiejar' -b master
- If you encounter a TypeError during a Chef run, this indicates a type mismatch issue within the Ruby code of your Chef recipe. Examine the lines in your recipe that are mentioned in the error trace. If you need further assistance with this, consider engaging with the Professional Services team for a more tailored solution.
Summary
This article provides solutions for multiple deployment issues that customers may face while deploying their application on a new environment. These solutions include installing missing packages, resolving encryption key errors, fixing Redis installation errors, resolving 'Unknown cookie parameter 'samesite'' errors, and addressing TypeErrors during a Chef run.
FAQ
-
What should I do if I encounter a TypeError during a Chef run?
This indicates a type mismatch issue within the Ruby code of your Chef recipe. Examine the lines in your recipe that are mentioned in the error trace. If you need further assistance with this, consider engaging with the Professional Services team for a more tailored solution. -
How can I resolve the 'Unknown cookie parameter 'samesite'' error?
Update `ey-core` to the latest version, remove the old version of `ey-core`, and install `cookiejar` from sources with the provided commands. -
What should I do if I fail to install certain gems due to a missing package on the utility server?
Install the missing libxml2-dev package on the utility server using the provided commands.
Comments
Article is closed for comments.