大网数据广告活动
服务器运维问答

Unable to pull Puppet Forge modules with r10k

· 52CE 我爱测

I have what appears to be a functioning r10k setup with respect to publishing branches as environments, but when I run the command to pull modules via sudo /opt/puppetlabs/puppet/bin/r10k deploy environment -p -v I get INFO -> De…

问题原文

原帖链接 · Geoff Johnson · CC BY-SA 3.0

I have what appears to be a functioning r10k setup with respect to publishing branches as environments, but when I run the command to pull modules via

sudo /opt/puppetlabs/puppet/bin/r10k deploy environment -p -v

I get

INFO     -> Deploying environment /etc/puppetlabs/code/environments/production
INFO     -> Environment production is now at cd62f3bb36117b1418672a1039b8212aa8bb36dd
INFO     -> Deploying Puppetfile content /etc/puppetlabs/code/environments/production/modules/ntp
ERROR    -> stream error
INFO     -> Deploying Puppetfile content /etc/puppetlabs/code/environments/production/modules/stdlib
ERROR    -> stream error

My /etc/puppetlabs/r10k/r10k.yaml

:cachedir: '/var/cache/r10k'

# A list of git repositories to create
:sources:
  :operations:
    remote: 'git@git:sysops/puppet.git'
    basedir: '/etc/puppetlabs/code/environments'

My Puppetfile

forge 'forge.puppetlabs.com'

mod 'puppetlabs/ntp', '4.1.0'
mod 'puppetlabs/stdlib'

Neither of those seem relevant to me, just thought I'd add them to preempt that question. If I do a packet capture of HTTPS on my puppet host I get a bunch of outbound traffic like this

15:19:14.507310 IP puppet.domain.net.33955 > ec2-52-10-130-237.us-west-2.compute.amazonaws.com.https: Flags [.], ack 17926, win 545, options [nop,nop,TS val 129210401 ecr 2944333247], length 0

and a bunch of inbound like

15:19:14.520146 IP ec2-52-10-130-237.us-west-2.compute.amazonaws.com.https > puppet.domain.net.33955: Flags [.], seq 20822:22270, ack 628, win 227, options [nop,nop,TS val 2944333252 ecr 129210401], length 1448

So things are communicating, but still the fairly useless "stream error" from r10k. If you turn up debugging with -v debug2 you get the same messages on the modules, just a bunch before and a bunch after.

This is a similar question to https://stackoverflow.com/questions/35712872/r10k-ruby-connection-error-to-the-forge but that question was marked as solved without actually being solved, so not a duplicate IMO.

已采纳解答

原帖链接 · Tomek Habiger · CC BY-SA 3.0

It seems that while the ruby rugged module is being built(which is a r10k dependency) it's using zlib symbols compiled in libgit2 instead of those provided by the operating system. For me, it was enough to remove rugged module gem, install zlib-devel package on the system and install rugged again.

gem uninstall rugged
yum install zlib-devel
gem install rugged

If you want to confirm your problem is the same, just run the code below in the ruby console(irb):

require 'rugged'
require 'zlib'
Zlib::Inflate.new(32 + Zlib::MAX_WBITS)

It should raise a Zlib::StreamError.

Sources that led me to this soulution:

https://github.com/prontolabs/pronto/issues/23

https://github.com/libgit2/rugged/issues/705

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-05-10)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。