Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Maddaus <[email protected]>
  • Loading branch information
IanMadd committed Dec 4, 2023
1 parent 0b8b326 commit 9144a8c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 33 deletions.
4 changes: 2 additions & 2 deletions content/data_bags.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ arguments and the following options:

| Option | Description |
|--------------------|-------------------------------------------------------------|
| `--secret SECRET` | The encryption key that is used for values contained within a data bag item. If `secret` is not specified, Chef Infra Client looks for a secret at the path specified by the `encrypted_data_bag_secret` setting in the client.rb file. |
| `--secret SECRET` | The encryption key that's used for values contained within a data bag item. If `secret` is not specified, Chef Infra Client looks for a secret at the path specified by the `encrypted_data_bag_secret` setting in the client.rb file. |
| `--secret-file FILE` | The path to the file that contains the encryption key. |

### Secret Keys
Expand Down Expand Up @@ -316,7 +316,7 @@ be used to store shared environment data within a data bag: by using a
top-level key that corresponds to the environment or by using separate
items for each environment.

A data bag that is storing a top-level key for an environment might look
A data bag stores a top-level key for an environment might look
something like this:

```json
Expand Down
63 changes: 32 additions & 31 deletions content/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ There are multiple causes of the Chef 401 "Unauthorized" error, so please use th
If you're receiving an error like the following it most likely means you'll need to regenerate the ORGANIZATION-validator.pem file:

```bash
INFO: Client key /etc/chef/client.pem is not present - registering
INFO: Client key /etc/chef/client.pem isn't present - registering
INFO: HTTP Request Returned 401 Unauthorized: Failed to authenticate as ORGANIZATION-validator. Ensure that your node_name and client key are correct.
FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
FATAL: Net::HTTPClientException: 401 "Unauthorized"
Expand Down Expand Up @@ -61,17 +61,18 @@ Response: Failed to authenticate as USERNAME. Ensure that your node_name and cl
- Verify you have the correct values in your config.rb file, especially for the `node_name` and `client_key` settings.

- Check if the file referenced in the `client_key` setting (usually USER.pem) exists. Some common locations include:
* `~/.chef`
* `~/projects/current_project/.chef`
* `/etc/chef`

- `~/.chef`
- `~/projects/current_project/.chef`
- `/etc/chef`

If one is present, verify that it has the correct read permissions.

- If there's no client.rb file, regenerate it and ensure the values for the `node_name` and `client_key` settings are correct.
### Organization not found
If you see this error when trying to recreate the ORGANIZATION-validator.pem, it is possible that Chef Infra Client itself was deleted. In this situation, the ORGANIZATION-validator.pem will need to be recreated. In these directions, `ORGANIZATION` should be replaced with the name of your organization.
If you see this error when trying to recreate the ORGANIZATION-validator.pem, it's possible that Chef Infra Client itself was deleted. In this situation, the ORGANIZATION-validator.pem will need to be recreated. In these directions, `ORGANIZATION` should be replaced with the name of your organization.

{{< readfile file="content/reusable/md/manage_webui_policy_validation_reset_key.md" >}}

Expand All @@ -80,7 +81,7 @@ If you see this error when trying to recreate the ORGANIZATION-validator.pem, it
If the system clock drifts more than 15 minutes from the actual time, the following type of error will be shown:

```bash
INFO: Client key /etc/chef/client.pem is not present - registering
INFO: Client key /etc/chef/client.pem isn't present - registering
INFO: HTTP Request Returned 401 Unauthorized: Failed to authenticate as ORGANIZATION-validator. Synchronize the clock on your host.
FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
FATAL: Net::HTTPClientException: 401 "Unauthorized"
Expand Down Expand Up @@ -126,7 +127,7 @@ The general `Net::HTTPClientException: 401 "Unauthorized"` error will usually oc
2. Make sure to use the same `node_name` as the initial Chef Infra Client run.
This can happen for a number of reasons. For example, if the
client.rb file does not specify the correct node name and the
client.rb file doesn't specify the correct node name and the
system's hostname has changed.
Running `chef-client -l debug` will identify the node name being
Expand Down Expand Up @@ -234,7 +235,7 @@ In working with Chef, you'll most likely encounter issues in your regular workfl
If you're seeing an error like:
```bash
Client key /etc/chef/client.pem is notresent - registering
Client key /etc/chef/client.pem isn'tresent - registering
WARN: Failed to read the private key /etc/che/validation.pem: #<Errno::ENOENT: No such file or directory - /etc/chef/validation.pem>
FATAL: Stacktrace dumped to /etc/chef/cache/chef-stacktrace.out
FATAL: Chef::Exceptions::PrivateKeyMissing: I cannot read /etc/chef/validation.pem, which you told me to use to sign requests
Expand All @@ -249,7 +250,7 @@ It means that Chef Infra Client could not find your validation.pem.
### Commit or stash your changes
This is not really an error, but can be confusing to new users. When you try to install a cookbook with changes that have not been committed to git you will get this error:
This isn't really an error, but can be confusing to new users. When you try to install a cookbook with changes that have not been committed to git you will get this error:
```bash
Installing getting-started to /home/jes/chef-repo/.chef/../cookbooks
Expand Down Expand Up @@ -295,7 +296,7 @@ chef-client -c /etc/chef/client.rb
If you're seeing an error like:
```bash
ERROR: CONFIGURATION ERROR:Specified config file /etc/opscode/pivotal.rb does not exist
ERROR: CONFIGURATION ERROR:Specified config file /etc/opscode/pivotal.rb doesn't exist
```
#### Troubleshooting Steps
Expand All @@ -318,31 +319,31 @@ The following error messages may be present when configuring the Chef Infra Serv
The value of `postgresql['external']` has been changed.
#### Possible Causes
#### Possible causes
- This setting must be set before running
`chef-server-ctl reconfigure`, and may not be changed after
{{< warning >}}
Upgrading is not supported at this time.
Upgrading isn't supported at this time.
{{< /warning >}}
#### Resolution
- Back up the data using `knife ec backup`, create a new backend instance, and then restore the data
- Re-point front end machines at the new backend instance **or** assign the new backend instance the name/VIP of the old backend instance (including certificates, keys, and so on)
- Re-point frontend machines at the new backend instance **or** assign the new backend instance the name/VIP of the old backend instance (including certificates and keys)
### CSPG010 (cannot connect)
#### Reason
Cannot connect to PostgreSQL on the remote server.
#### Possible Causes
#### Possible causes
- PostgreSQL is not running on the remote server
- PostgreSQL isn't running on the remote server
- The port used by PostgreSQL is blocked by a firewall on the remote server
- Network routing configuration is preventing access to the host
- When using Amazon Web Services (AWS), rules for security groups are preventing the Chef Infra Server from communicating with PostgreSQL
Expand All @@ -353,7 +354,7 @@ Cannot connect to PostgreSQL on the remote server.
Cannot authenticate to PostgreSQL on the remote server.
#### Possible Causes
#### Possible causes
- Incorrect password specified for `db_superuser_password`
- Incorrect user name specified for `db_superuser`
Expand All @@ -365,10 +366,10 @@ Cannot authenticate to PostgreSQL on the remote server.
Cannot connect to PostgreSQL on the remote server because rules in
`pg_hba` are incorrect.
#### Possible Causes
#### Possible causes
- There is no `pg_hba.conf` rule for the `db_superuser` in PostgreSQL
- A rule exists for the `db_superuser` in `pg_hba.conf`, but it does not specify `md5` access
- No `pg_hba.conf` rule exists for the `db_superuser` in PostgreSQL
- A rule exists for the `db_superuser` in `pg_hba.conf`, but it doesn't specify `md5` access
- A rule in `pg_hba.conf` specifies an incorrect originating address
#### Resolution
Expand Down Expand Up @@ -444,11 +445,11 @@ Rules in the `pg_hba.conf` file should allow only specific application names:
The `db_superuser` account has incorrect permissions.
#### Possible Causes
#### Possible causes
- The `db_superuser` account has not been granted `SUPERUSER` access
- The `db_superuser` account hasn't been granted `SUPERUSER` access
- The `db_superuser` account has not been granted `CREATE DATABASE` and `CREATE ROLE` privileges
- The `db_superuser` account hasn't been granted `CREATE DATABASE` and `CREATE ROLE` privileges
```bash
ALTER ROLE "$your_db_superuser_name" WITH SUPERUSER
Expand All @@ -466,17 +467,17 @@ The `db_superuser` account has incorrect permissions.
Bad version of PostgreSQL.
#### Possible Causes
#### Possible causes
- The remote server is not running PostgreSQL version 9.2.x
- The remote server isn't running PostgreSQL version 9.2.x
### CSPG015 (missing database)
#### Reason
The database template `template1` does not exist.
The database template `template1` doesn't exist.
#### Possible Causes
#### Possible causes
- The `template1` database template has been removed from the remote
server
Expand All @@ -501,14 +502,14 @@ The database template `template1` does not exist.
One (or more) of the PostgreSQL databases already exists.
#### Possible Causes
#### Possible causes
- The `opscode_chef`, `oc_id`, and/or `bifrost` databases already exist on the remote machine
- The PostgreSQL database exists for another application
#### Resolution
- Verify that the `opscode_chef`, `oc_id`, and/or `bifrost` databases exist, and then verify that they are not being used by another internal application
- Verify that the `opscode_chef`, `oc_id`, and/or `bifrost` databases exist, and then verify that they're not being used by another internal application
- Back up the PostgreSQL data, remove the existing databases, and reconfigure the Chef server
### CSPG017 (user exists)
Expand All @@ -517,15 +518,15 @@ One (or more) of the PostgreSQL databases already exists.
One (or more) of the PostgreSQL predefined users already exists.
#### Possible Causes
#### Possible causes
- The `opscode_chef`, `ospcode_chef_ro`, `bifrost`, `bifrost_ro`, `oc_id`, or `oc_id_ro` users already exist on the remote machine
- The `postgresql['vip']` setting is configured to a remote host, but `postgresql['external']` is not set to `true`, which causes the `opscode_chef` and `ospcode_chef_ro` users to be created before the machine is reconfigured, which will return a permissions error
- The `postgresql['vip']` setting is configured to a remote host, but `postgresql['external']` isn't set to `true`, which causes the `opscode_chef` and `ospcode_chef_ro` users to be created before the machine is reconfigured, which will return a permissions error
- Existing, valid naming conflicts are present, where the users were created independently of the Chef server
#### Resolution
- Run the following, if it is safe to do so, to update the user name that's specified in the error message:
- Run the following, if it's safe to do so, to update the user name that's specified in the error message:
```bash
DROP ROLE "name-of-user";
Expand Down

0 comments on commit 9144a8c

Please sign in to comment.