Chef::Exceptions::ValidationFailed 错误 EncryptedDataBagItem.load 由于假设的正则表达式不匹配
Chef::Exceptions::ValidationFailed error during EncryptedDataBagItem.load due to supposed regex mismatch
我正在 bootstrapping 一个带有菜谱的节点,该菜谱截至 11 月在 chef-client 上运行良好,不幸的是以下代码:
45: #Configure PostgreSQL cluster -- create pertinent databases, users, and groups based on uploaded, decrypted shell here-document.
47>> here_doc_name = Chef::EncryptedDataBagItem.load("database_configs", "tlcworx_#{node["tlcworx_db"]["environment"]}")["filename"]
48: here_doc_content = Chef::EncryptedDataBagItem.load("database_configs", "tlcworx_#{node["tlcworx_db"]["environment"]}")["content"]
49:
50: open("#{node["tlcworx_db"]["tmp_dir"]}/#{here_doc_name}", 'w') { |f| f.puts here_doc_content }
出现了以下错误,导致 bootstrap 停止:
Chef::Exceptions::ValidationFailed: Option data_bag's value {"encrypted_data"=>"PffgOkpIpdoEJO8khrUOUQwqv2/vqrtzOf1U/z/a5xD4KqSH2/CkD1zHndzW\nwJL1\n", "iv"=>"d/kiiPRQWQoKBTU5WF8NPw==\n", "version"=>1, "cipher"=>"aes-256-cbc"} does not match regular expression /^[\-[:alnum:]_]+$/
显然,我提供的 --secret-file
与我当时通过 knife CLI 参数所做的相同。 运行 knife data bag edit database_configs tlcworx_uat --secret-file /path/to/secret.pem
正确解密食谱内容,不会出错。我以前从未见过此错误,查看此错误的其他实例我发现它们涉及直接 CLI 操作,其中未命名有问题的数据包,例如 this instance。同样,这仅在 bootstrap 服务器的 chef-client 与远程 chef-server 通信时才发生。
我希望有人能就可能导致错误的原因提供一些见解。 Chef 客户端版本为 12.7.2.
在此先感谢您对此事的任何帮助!
对于未来,我们非常确定这是 DataBagItem.to_hash
改变其数据的错误的副作用。将在下一版本的 Chef 中修复。
我正在 bootstrapping 一个带有菜谱的节点,该菜谱截至 11 月在 chef-client 上运行良好,不幸的是以下代码:
45: #Configure PostgreSQL cluster -- create pertinent databases, users, and groups based on uploaded, decrypted shell here-document.
47>> here_doc_name = Chef::EncryptedDataBagItem.load("database_configs", "tlcworx_#{node["tlcworx_db"]["environment"]}")["filename"]
48: here_doc_content = Chef::EncryptedDataBagItem.load("database_configs", "tlcworx_#{node["tlcworx_db"]["environment"]}")["content"]
49:
50: open("#{node["tlcworx_db"]["tmp_dir"]}/#{here_doc_name}", 'w') { |f| f.puts here_doc_content }
出现了以下错误,导致 bootstrap 停止:
Chef::Exceptions::ValidationFailed: Option data_bag's value {"encrypted_data"=>"PffgOkpIpdoEJO8khrUOUQwqv2/vqrtzOf1U/z/a5xD4KqSH2/CkD1zHndzW\nwJL1\n", "iv"=>"d/kiiPRQWQoKBTU5WF8NPw==\n", "version"=>1, "cipher"=>"aes-256-cbc"} does not match regular expression /^[\-[:alnum:]_]+$/
显然,我提供的 --secret-file
与我当时通过 knife CLI 参数所做的相同。 运行 knife data bag edit database_configs tlcworx_uat --secret-file /path/to/secret.pem
正确解密食谱内容,不会出错。我以前从未见过此错误,查看此错误的其他实例我发现它们涉及直接 CLI 操作,其中未命名有问题的数据包,例如 this instance。同样,这仅在 bootstrap 服务器的 chef-client 与远程 chef-server 通信时才发生。
我希望有人能就可能导致错误的原因提供一些见解。 Chef 客户端版本为 12.7.2.
在此先感谢您对此事的任何帮助!
对于未来,我们非常确定这是 DataBagItem.to_hash
改变其数据的错误的副作用。将在下一版本的 Chef 中修复。