Skip to content
This repository has been archived by the owner on Jan 8, 2023. It is now read-only.

Starting pod with network fails when not creating the network manually #28

Closed
fgierlinger opened this issue Dec 1, 2020 · 1 comment · Fixed by #119
Closed

Starting pod with network fails when not creating the network manually #28

fgierlinger opened this issue Dec 1, 2020 · 1 comment · Fixed by #119
Labels
feature This issue/PR relates to a feature request.

Comments

@fgierlinger
Copy link

Summary
I do not know if this is an intended behaviour, but when specifying a network in the pod, the pod creation fails with the error message No such file or directory: OCI runtime command not found error. The specified network is not created automatically when being specified in the molecule.yml.

---
dependency:
  name: galaxy
driver:
  name: podman
platforms:
  - name: centos8
    image: centos:8
    pre_build_image: true
    network: mynet
{"msg": "non-zero return code", "rc": 127, "start": "2020-12-01 22:51:33.431062", "stderr": "Error: error stat'ing file `/home/hashlog/.config/cni/net.d`: No such file or directory: OCI runtime command not found error", "stderr_lines": ["Error: error stat'ing file `/home/hashlog/.config/cni/net.d`: No such file or directory: OCI runtime command not found error"], "stdout": "", "stdout_lines": []}

If the network is created before manually, the pod comes up without any problem.

$ podman network create mynet
$ podman network ls
NAME       VERSION  PLUGINS
mynet      0.4.0    bridge,portmap,firewall,dnsname
$ molecule create
$ molecule login
[root@centos /]# ip -br link
lo               UNKNOWN        00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP> 
eth0@if9         UP             86:09:cd:ee:37:2e <BROADCAST,MULTICAST,UP,LOWER_UP> 

Steps to reproduce

$ cat molecule/default/molecule.yml
dependency:
  name: galaxy
driver:
  name: podman
platforms:
  - name: centos8
    image: centos:8
    pre_build_image: true
    network: mynet
$ molecule create

Expected result
The pod is created and has the specified network attached.

Actual result
The pod creation fails because the specified network does not exist.

System Information

$ molecule --version
molecule 3.2.0 using python 3.9 
    ansible:2.9.15
    delegated:3.2.0 from molecule
    podman:0.3.0 from molecule_podman
$ uname -a
Linux host 5.9.10-200.fc33.x86_64 #1 SMP Mon Nov 23 18:12:50 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
@sshnaidm sshnaidm added the feature This issue/PR relates to a feature request. label Jan 12, 2021
@jdmarble
Copy link
Contributor

It looks like networks are supposed to be created in the create playbook here. It wasn't working for me until I changed one of the conditions to look for the string 'network not found' instead of 'no such network' on this line. I can't tell, but maybe this worked in the past and the message changed. It is currently defined here.

jdmarble added a commit to jdmarble/molecule-podman that referenced this issue Apr 18, 2022
Network creation wasn't working for me until I changed this condition to look for the string `'network not found'` instead of `'no such network'`. I can't tell, but maybe this worked in the past and the message changed. It is currently defined [here](https://github.com/containers/common/blob/707829f80bc7623c6ecea000f2616977e178ccb5/libnetwork/types/define.go#L11).

fixes ansible-community#28
ssbarnea added a commit that referenced this issue Jul 20, 2022
* Update condition for missing network

Network creation wasn't working for me until I changed this condition to look for the string `'network not found'` instead of `'no such network'`. I can't tell, but maybe this worked in the past and the message changed. It is currently defined [here](https://github.com/containers/common/blob/707829f80bc7623c6ecea000f2616977e178ccb5/libnetwork/types/define.go#L11).

fixes #28

* Fix condition

Co-authored-by: Sorin Sbarnea <ssbarnea@redhat.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue/PR relates to a feature request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants