frenetic-lang / pyretic

The Pyretic language and runtime system
http://frenetic-lang.org/pyretic/
159 stars 99 forks source link

frenetic not found #59

Open bovenyan opened 8 years ago

bovenyan commented 8 years ago

running pyretic.py -m p0 pyretic.modules.mac_learner in the tutorial gives the following errors ./frenetic: No such file or directory. ERROR:pyretic.core.netkat.netkat:2015-12-07 10:32:03,111: Compiling with the netkat compilation server failed. ([Errno 97] Address family not supported by protocol)

Tried working cloning and running frenetic by frenetic compile-server --verbosity=error gives the following error when mininet boots up.

Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 810, in bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 763, in run self.__target(_self.args, _self.__kwargs) File "/home/bovenyan/Documents/src/pyretic/pyretic/core/runtime.py", line 2194, in f self.runtime.handle_network_change() File "/home/bovenyan/Documents/src/pyretic/pyretic/core/runtime.py", line 402, in handle_network_change self.update_switch_classifiers() File "/home/bovenyan/Documents/src/pyretic/pyretic/core/runtime.py", line 462, in update_switch_classifiers classifier = self.whole_policy_compile() File "/home/bovenyan/Documents/src/pyretic/pyretic/evaluations/stat.py", line 158, in profiled_func res = func(_args, _kwargs) File "/home/bovenyan/Documents/src/pyretic/pyretic/evaluations/stat.py", line 109, in profiled_func res = func(_args, *_kwargs) File "/home/bovenyan/Documents/src/pyretic/pyretic/core/runtime.py", line 424, in whole_policy_compile p = self.policy.netkat_compile(self.sw_cnt())[0] # directly compile with netkat File "/home/bovenyan/Documents/src/pyretic/pyretic/core/language.py", line 174, in netkat_compile print_json) File "/home/bovenyan/Documents/src/pyretic/pyretic/core/netkat.py", line 137, in generate_classifier return httplib_channel_compilation(pol, qdict) File "/home/bovenyan/Documents/src/pyretic/pyretic/core/netkat.py", line 131, in httplib_channel_compilation classifier = json_to_classifier(netkat_out, qdict, multistage) File "/home/bovenyan/Documents/src/pyretic/pyretic/core/netkat.py", line 464, in json_to_classifier queries = get_queries_from_names(rule['queries'], qdict) KeyError: 'queries'

chelobarreto commented 8 years ago

Same problem. Install frenetic: On ubuntu 14.04.4 LTS

Patch for message KeyError: 'queries': The error appears to be in the pyretic/core/netkat.py file Replace the function json_to_classifier

def json_to_classifier(fname, qdict, multistage): from pyretic.core.classifier import Rule, Classifier data = json.loads(fname) rules = [] for sw_tbl in data: switch_id = sw_tbl['switch_id'] for rule in sw_tbl['tbl']: prio = rule['priority'] m = create_match(rule['pattern'], switch_id) action = create_action(rule['action'], multistage) try: queries = get_queries_from_names(rule['queries'], qdict) except KeyError: queries = set() if rule.has_key('queries'): pyrule = Rule(m, action | queries, [None], "netkat_query") else: pyrule = Rule(m, action | queries, [None], "netkat") rules.append((prio, pyrule))

rules.sort()

rules = [v for (k,v) in rules]
return Classifier(rules)
thkaw commented 8 years ago

same problem in latest branch on 14.04.

@chelobarreto can you provide right indent format? Thanks~

chelobarreto commented 8 years ago

Check that frenetic is intalled, run frenetic from command line. If it runs then check whereis installed in mi case in /usr/bin/frenetic:

user@localhost#whereis frenetic /usr/bin/frenetic

Then update the path in /pyretic/start-frenetic.sh

yansh commented 8 years ago

I have the same issue with the provided VirtualBox VM. Frenetic seems to be missing in the VM.

himanshurawlani commented 6 years ago

root@mininet-vm:/pyretic# ./pyretic.py pyretic.pyresonance.apps.ids Traceback (most recent call last): File "./pyretic.py", line 313, in main() File "./pyretic.py", line 275, in main write_log=options.write_log) File "/home/mininet/pyretic/pyretic/core/runtime.py", line 87, in init self.forwarding = main(**kwargs) TypeError: main() takes exactly 1 argument (0 given) root@mininet-vm:/pyretic#

I'm following this wiki : https://github.com/Resonance-SDN/pyresonance/wiki/PyResonance-overhaul:-Running-example-applications I solved the frenetic problem after going through the above discussion. But now I'm stuck here, please help...