{"action":"closed","issue":{"url":"https://api.github.com/repos/lxc/lxc/issues/1434","repository_url":"https://api.github.com/repos/lxc/lxc","labels_url":"https://api.github.com/repos/lxc/lxc/issues/1434/labels{/name}","comments_url":"https://api.github.com/repos/lxc/lxc/issues/1434/comments","events_url":"https://api.github.com/repos/lxc/lxc/issues/1434/events","html_url":"https://github.com/lxc/lxc/issues/1434","id":208454698,"number":1434,"title":"Cached resolv.conf issue","user":{"login":"x-yuri","id":730588,"avatar_url":"https://avatars0.githubusercontent.com/u/730588?v=4","gravatar_id":"","url":"https://api.github.com/users/x-yuri","html_url":"https://github.com/x-yuri","followers_url":"https://api.github.com/users/x-yuri/followers","following_url":"https://api.github.com/users/x-yuri/following{/other_user}","gists_url":"https://api.github.com/users/x-yuri/gists{/gist_id}","starred_url":"https://api.github.com/users/x-yuri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/x-yuri/subscriptions","organizations_url":"https://api.github.com/users/x-yuri/orgs","repos_url":"https://api.github.com/users/x-yuri/repos","events_url":"https://api.github.com/users/x-yuri/events{/privacy}","received_events_url":"https://api.github.com/users/x-yuri/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-02-17T14:17:33Z","updated_at":"2018-02-09T10:31:45Z","closed_at":"2018-02-09T10:31:45Z","author_association":"NONE","body":"I'm running `lxc` containers on my notebook. I just moved to the other place, and I have a cache of CentOS 7 in `/var/cache/lxc/centos/x86_64/7/rootfs` `lxc` did before I moved. And there lies `/etc/resolv.conf` with wrong name servers. As a result, when I create a container, I get this:\r\n\r\n```\r\n# lxc-create -n centos -t centos -- -R 7\r\nHost CPE ID from /etc/os-release:\r\nChecking cache download in /var/cache/lxc/centos/x86_64/7/rootfs ...\r\nCache found. Updating...\r\nLoaded plugins: fastestmirror\r\nCould not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was\r\n12: Timeout on http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock: (28, 'Resolving timed out after 30544 milliseconds')\r\n\r\n\r\n One of the configured repositories failed (Unknown),\r\n and yum doesn't have enough cached data to continue. At this point the only\r\n safe thing yum can do is fail. There are a few ways to work \"fix\" this:\r\n\r\n     1. Contact the upstream for the repository and get them to fix the problem.\r\n\r\n     2. Reconfigure the baseurl/etc. for the repository, to point to a working\r\n        upstream. This is most often useful if you are using a newer\r\n        distribution release than is supported by the repository (and the\r\n        packages for the previous distribution release still work).\r\n\r\n     3. Run the command with the repository temporarily disabled\r\n            yum --disablerepo=<repoid> ...\r\n\r\n     4. Disable the repository permanently, so yum won't use it by default. Yum\r\n        will then just ignore the repository until you permanently enable it\r\n        again or use --enablerepo for temporary usage:\r\n\r\n            yum-config-manager --disable <repoid>\r\n        or\r\n            subscription-manager repos --disable=<repoid>\r\n\r\n     5. Configure the failing repository to be skipped, if it is unavailable.\r\n        Note that yum will try to contact the repo. when it runs most commands,\r\n        so will have to try and fail each time (and thus. yum will be be much\r\n        slower). If it is a very temporary problem though, this is often a nice\r\n        compromise:\r\n\r\n            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true\r\n\r\nCannot find a valid baseurl for repo: base/7/x86_64\r\nFailed to update 'CentOS base', continuing with last known good cache\r\nCopy /var/cache/lxc/centos/x86_64/7/rootfs to /var/lib/lxc/centos/rootfs ...\r\nCopying rootfs to /var/lib/lxc/centos/rootfs ...\r\nsed: can't read /var/lib/lxc/centos/rootfs/etc/init/tty.conf: No such file or directory\r\nStoring root password in '/var/lib/lxc/centos/tmp_root_pass'\r\nExpiring password for user root.\r\npasswd: Success\r\nsed: can't read /var/lib/lxc/centos/rootfs/etc/rc.sysinit: No such file or directory\r\nsed: can't read /var/lib/lxc/centos/rootfs/etc/rc.d/rc.sysinit: No such file or directory\r\n\r\nContainer rootfs and config have been created.\r\nEdit the config file to check/enable networking setup.\r\n\r\nThe temporary root password is stored in:\r\n\r\n        '/var/lib/lxc/centos/tmp_root_pass'\r\n\r\n\r\nThe root password is set up as expired and will require it to be changed\r\nat first login, which you should do as soon as possible.  If you lose the\r\nroot password or wish to change it without starting the container, you\r\ncan change it from the host by running the following command (which will\r\nalso reset the expired flag):\r\n\r\n        chroot /var/lib/lxc/centos/rootfs passwd\r\n\r\n```\r\n\r\nThat is, `yum` [fails to update packages][1], and additionally networking doesn't work right away in lxc container. Until I fix `/etc/resolv.conf`.\r\n\r\n[1]: https://github.com/lxc/lxc/blob/lxc-2.0.7/templates/lxc-centos.in#L531"}}
{"actor":{"display_login":"brauner"}}