[CRIU] problem restoring TUN

Chenji, Harshavardhan chenji at ohio.edu
Fri Nov 8 00:13:02 MSK 2019


It looks like the tun device was created as part of the command run by 
docker inside the container when it starts and not at "creation time". I 
am using docker API to create a container and then restore it from 
criu's state, which is presumably causing the problem at hand.

dump and restore logs attached.ip a output:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
group default qlen 1000
     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
     inet 127.0.0.1/8 scope host lo
        valid_lft forever preferred_lft forever
     inet6 ::1/128 scope host
        valid_lft forever preferred_lft forever
2: ogstun: <NO-CARRIER,POINTOPOINT,MULTICAST,NOARP,UP> mtu 1500 qdisc 
fq_codel state DOWN group default qlen 500
     link/none
     inet 192.168.215.1/24 scope global ogstun
        valid_lft forever preferred_lft forever
154: eth0 at if155: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc 
noqueue state UP group default
     link/ether 02:42:ac:16:0b:05 brd ff:ff:ff:ff:ff:ff link-netnsid 0
     inet 172.22.11.5/24 brd 172.22.11.255 scope global eth0
        valid_lft forever preferred_lft forever
     inet6 fe80::42:acff:fe16:b05/64 scope link
        valid_lft forever preferred_lft forever



On 10/7/19 1:08 PM, Andrei Vagin wrote:
> On Wed, Sep 25, 2019 at 09:32:51PM +0000, Chenji, Harshavardhan wrote:
>> Hi all,
>>
>> Using criu 3.13 via docker 19.03 and containerd/runc. When I try to
>> restore a container with a TUN interface (created within the container,
>> not passed via docker's --device), I get an error. How should I debug
>> this? Any help is greatly appreciated.
>>
>> In restore.log:
>>
>> (00.313337)     19: Error (criu/tun.c:391): tun: No tun device for file
>> pgwtun
>> (00.313347)     19: Error (criu/files.c:1196): Unable to open fd=16 id=0x51
>> (00.313653)      1: Error (criu/cr-restore.c:1454): 19 exited, status=1
> 
> criu was trying to dump a tun file descriptor, but failed to find its
> tun device. Could you attach a whole dump.log and output for "ip a" from
> the container?
> 
>>
>>
>> Using crit x (0x51 is 81 in dec):
>>
>>          {
>>               "type": "REG",
>>               "id": 81,
>>               "reg": {
>>                   "id": 81,
>>                   "flags": "O_RDWR | O_LARGEFILE | 0x800",
>>                   "pos": 48,
>>                   "fown": {
>>                       "uid": 0,
>>                       "euid": 0,
>>                       "signum": 0,
>>                       "pid_type": 0,
>>                       "pid": 0
>>                   },
>>                   "name": "/dev/net/tun",
>>                   "mnt_id": 416,
>>                   "mode": 8630
>>               }
>>           },
>>           {
>>               "type": "TUNF",
>>               "id": 81,
>>               "tunf": {
>>                   "id": 81,
>>                   "netdev": "pgwtun",
>>                   "ns_id": 9
>>               }
>>           }
>>
>> The corresponding log during the dumping process:
>>
>> (06.802221) inet: Dumping inet socket at 15
>> (06.802222) inet:       Dumping: ino   0x4740 family AF_INET    type
>> SOCK_DGRAM     port     2152 state TCP_CLOSE        src_addr 172.22.11.5
>> (06.802225) inet:       Dumped: family AF_INET    type SOCK_DGRAM
>> proto IPPROTO_UDP      port 2152 state 0                src_addr 172.22.11.5
>> (06.802236) 1610 fdinfo 16: pos:             0x30 flags:           104002/0
>> (06.802249) Dumping path for 16 fd via self 30 [/dev/net/tun]
>> (06.802254) tun: Dumping tun-file 30 with id 0x51
>> (06.802257) tun: `- attached to device pgwtun (flags 1801)
>> (06.802267) ----------------------------------------
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> CRIU mailing list
>> CRIU at openvz.org
>> https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.openvz.org%2Fmailman%2Flistinfo%2Fcriu&amp;data=02%7C01%7Cchenji%40ohio.edu%7Ceff07284109f44b9b51c08d74b48ef8f%7Cf3308007477c4a70888934611817c55a%7C0%7C0%7C637060648932699766&amp;sdata=yZXaCLVBN5gfpCi1GcNKxgNnypzQIzxerC8uh86IwEI%3D&amp;reserved=0
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dump.log-1573160411474
URL: <http://lists.openvz.org/pipermail/criu/attachments/20191107/105bd36c/attachment-0002.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: restore.log-1573160471576
URL: <http://lists.openvz.org/pipermail/criu/attachments/20191107/105bd36c/attachment-0003.ksh>


More information about the CRIU mailing list