yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #87025
[Bug 1942152] [NEW] write_files owner directive doesn't set the owner
Public bug reported:
On AWS EC2 (ECS-Optimized image), I have the following write_files
section:
write_files:
- path: "/home/ec2-user/cloud-provision-host.sh"
permissions: "0755"
owner: "ec2-user:ec2-user"
content: |
#!/usr/bin/env bash
I'm using the default AWS EC2 instance user ec2-user
The file is created and its content is correct but with the root:root
permissions:
drwxr-xr-x 3 root root 4096 Aug 31 01:59 .
drwxr-xr-x 3 root root 4096 Aug 31 01:59 ..
drwx------ 2 ec2-user ec2-user 4096 Aug 31 01:59 .ssh
-rwxr-xr-x 1 root root 555 Aug 31 01:59 cloud-provision-host.sh
Logs:
Aug 31 01:59:45 cloud-init[3562]: util.py[WARNING]: Running module write-files (<module 'cloudinit.config.cc_write_files' from '/usr/lib/python2.7/site-packages/cloudinit/config/cc_write_files.pyc'>) failed
Aug 31 01:59:45 cloud-init[3562]: util.py[DEBUG]: Running module write-files (<module 'cloudinit.config.cc_write_files' from '/usr/lib/python2.7/site-packages/cloudinit/config/cc_write_files.pyc'>) failed
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cloudinit/stages.py", line 851, in _run_modules
freq=freq)
File "/usr/lib/python2.7/site-packages/cloudinit/cloud.py", line 54, in run
return self._runners.run(name, functor, args, freq, clear_on_fail)
File "/usr/lib/python2.7/site-packages/cloudinit/helpers.py", line 187, in run
results = functor(*args)
File "/usr/lib/python2.7/site-packages/cloudinit/config/cc_write_files.py", line 82, in handle
write_files(name, files)
File "/usr/lib/python2.7/site-packages/cloudinit/config/cc_write_files.py", line 122, in write_files
util.chownbyname(path, u, g)
File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 1461, in chownbyname
raise OSError("Unknown user or group: %s" % (e))
OSError: Unknown user or group: 'getpwnam(): name not found: ec2-user'
How this may happen that the default user is not found?
** Affects: cloud-init
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1942152
Title:
write_files owner directive doesn't set the owner
Status in cloud-init:
New
Bug description:
On AWS EC2 (ECS-Optimized image), I have the following write_files
section:
write_files:
- path: "/home/ec2-user/cloud-provision-host.sh"
permissions: "0755"
owner: "ec2-user:ec2-user"
content: |
#!/usr/bin/env bash
I'm using the default AWS EC2 instance user ec2-user
The file is created and its content is correct but with the root:root
permissions:
drwxr-xr-x 3 root root 4096 Aug 31 01:59 .
drwxr-xr-x 3 root root 4096 Aug 31 01:59 ..
drwx------ 2 ec2-user ec2-user 4096 Aug 31 01:59 .ssh
-rwxr-xr-x 1 root root 555 Aug 31 01:59 cloud-provision-host.sh
Logs:
Aug 31 01:59:45 cloud-init[3562]: util.py[WARNING]: Running module write-files (<module 'cloudinit.config.cc_write_files' from '/usr/lib/python2.7/site-packages/cloudinit/config/cc_write_files.pyc'>) failed
Aug 31 01:59:45 cloud-init[3562]: util.py[DEBUG]: Running module write-files (<module 'cloudinit.config.cc_write_files' from '/usr/lib/python2.7/site-packages/cloudinit/config/cc_write_files.pyc'>) failed
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cloudinit/stages.py", line 851, in _run_modules
freq=freq)
File "/usr/lib/python2.7/site-packages/cloudinit/cloud.py", line 54, in run
return self._runners.run(name, functor, args, freq, clear_on_fail)
File "/usr/lib/python2.7/site-packages/cloudinit/helpers.py", line 187, in run
results = functor(*args)
File "/usr/lib/python2.7/site-packages/cloudinit/config/cc_write_files.py", line 82, in handle
write_files(name, files)
File "/usr/lib/python2.7/site-packages/cloudinit/config/cc_write_files.py", line 122, in write_files
util.chownbyname(path, u, g)
File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 1461, in chownbyname
raise OSError("Unknown user or group: %s" % (e))
OSError: Unknown user or group: 'getpwnam(): name not found: ec2-user'
How this may happen that the default user is not found?
To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1942152/+subscriptions