question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

backup and restore not working in 0.22.0 with python2

See original GitHub issue

following https://tcconfig.readthedocs.io/en/latest/pages/usage/backup_and_restore.html

problem:

user@host:~$ sudo tcshow eth0
{
    "eth0": {
        "outgoing": {},
        "incoming": {}
    }
}

user@host:~$ sudo tcset eth0 --delay 10ms --direction incoming

user@host:~$ sudo tcshow eth0 > tcconfig.json

user@host:~$ cat tcconfig.json 
{
    "eth0": {
        "outgoing": {},
        "incoming": {
            "protocol=ip": {
                "delay": "10.0ms",
                "rate": "32Gbps",
                "filter_id": "800::800"
            }
        }
    }
}

user@host:~$ sudo tcset tcconfig.json --import-setting
Traceback (most recent call last):
  File "/usr/local/bin/tcset", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/tcconfig/tcset.py", line 346, in main
    return set_tc_from_file(logger, options.device, options.overwrite)
  File "/usr/local/lib/python2.7/dist-packages/tcconfig/_importer.py", line 139, in set_tc_from_file
    loader.load_tcconfig(config_file_path)
  File "/usr/local/lib/python2.7/dist-packages/tcconfig/_importer.py", line 43, in load_tcconfig
    schema(self.__config_table)
  File "/usr/local/lib/python2.7/dist-packages/voluptuous/schema_builder.py", line 267, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python2.7/dist-packages/voluptuous/schema_builder.py", line 589, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python2.7/dist-packages/voluptuous/schema_builder.py", line 427, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: required key not provided @ data[<type 'unicode'>]

user@host:~$ pip list | grep tcconfig
tcconfig (0.22.0)

user@host:~$ pip list | grep voluptuous
voluptuous (0.11.5)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
XN137commented, Mar 19, 2019

@thombashi thanks for the quick feedback, 0.22.1 indeed does fix the problem:

user@host:~$ sudo tcshow eth1
{
    "eth1": {
        "outgoing": {},
        "incoming": {}
    }
}
user@host:~$ cat tcconfig.json 
{
  "eth1": {
    "incoming": {
      "dst-network=0.0.0.0/0": {},
      "dst-network=192.168.12.0/24": {
        "delay": "112ms",
        "rate": "155Mbps"
      },
      "dst-network=192.168.13.0/24": {
        "delay": "64ms",
        "rate": "200Mbps"
      }
    }
  },
  "eth2": {
    "incoming": {
      "dst-network=0.0.0.0/0": {},
      "dst-network=192.168.11.0/24": {
        "delay": "112ms",
        "rate": "155Mbps"
      },
      "dst-network=192.168.13.0/24": {
        "delay": "176ms",
        "rate": "155Mbps"
      }
    }
  },
  "eth3": {
    "incoming": {
      "dst-network=0.0.0.0/0": {},
      "dst-network=192.168.11.0/24": {
        "delay": "64ms",
        "rate": "200Mbps"
      },
      "dst-network=192.168.12.0/24": {
        "delay": "176ms",
        "rate": "155Mbps"
      }
    }
  }
}
user@host:~$ sudo tcset --import-setting tcconfig.json
user@host:~$ sudo tcshow eth1
{
    "eth1": {
        "outgoing": {},
        "incoming": {
            "dst-network=192.168.13.0/24, protocol=ip": {
                "delay": "64.0ms",
                "rate": "200Mbps",
                "filter_id": "800::800"
            },
            "dst-network=192.168.12.0/24, protocol=ip": {
                "delay": "112.0ms",
                "rate": "155Mbps",
                "filter_id": "800::801"
            }
        }
    }
}
user@host:~$ sudo tcshow eth2
{
    "eth2": {
        "outgoing": {},
        "incoming": {
            "dst-network=192.168.13.0/24, protocol=ip": {
                "delay": "176.0ms",
                "rate": "155Mbps",
                "filter_id": "800::800"
            },
            "dst-network=192.168.11.0/24, protocol=ip": {
                "delay": "112.0ms",
                "rate": "155Mbps",
                "filter_id": "800::801"
            }
        }
    }
}
user@host:~$ pip list | grep tcconfig
tcconfig (0.22.1)

closing this issue then, thanks again!

0reactions
XN137commented, Mar 19, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

AWXRestore fails - never ending loop of 'awxbackup-restore ...
I have a problem with the restore of an instance. It's about an initial demo setup - we need to ensure a working...
Read more >
azure backend not working with latest Azure Storage SDK for ...
There is a problem using latest version of duplicity (0.7.12) with latest Azure Storage SDK for Python (2.0.0) for access Azure resources.
Read more >
1482696 – dnf update aborts with Python3 exception
Description of problem: When running a "dnf update" I have gotten the following exception on two separate systems after doing distribution installs: ...
Read more >
recovery error - Google Groups
The backup is working fine, but the recovery is not working: barman.log: ... File "/usr/lib/python2.7/site-packages/barman/cli.py", line 554, in main
Read more >
Os.system and mysql restore not working in python unittest
What I tried: making a function with the os.system and calling it; importing a file with that function; using the exec() function to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found