faucetsdn / faucetagent

gNMI agent for faucet configuration
5 stars 2 forks source link

Send a configuration file to FAUCET fails #16

Closed alshaboti closed 5 years ago

alshaboti commented 5 years ago

I am using gNMI faucet agent to remotely get and set faucet.yaml file.

gnmi_get works fine, but when I tried to use gnmi_set I get these issues: Note: I am using docker ubuntu:16.04 image.

1- gnmi_set $AUTH -replace=/:$(<faucet.yaml) not working

F0518 13:13:52.315985 37 gnmi_set.go:160] Set failed: rpc error: code = Unknown desc = Exception calling application: [Errno 2] No such file or directory: 'fuser'

3- I installed psmisc package for fuser on faucetagent container and now it works (faucet.yaml is replaced and faucet is reloaded), however, it returns an error.

root@8c57dfa15a14:/pegler/etc/faucet# gnmi_set $AUTH -replace=/:"$(<faucet.yaml)" == setRequest: replace: < path: <

val: < string_val: "acls:\n block_acl:\n - rule:\n actions:\n allow: false\n def_acl:\n - rule:\n actions:\n allow: true\n mirror_acl:\n - rule:\n actions:\n allow: true\n mirror: 3\ndps:\n sw1:\n dp_id: 1\n hardware: Open vSwitch\n interfaces:\n 1:\n acls_in:\n - mirror_acl\n description: web server\n name: lan2\n native_vlan: office\n 2:\n acls_in:\n - def_acl\n description: web client\n name: lan3\n native_vlan: office\n 3:\n description: BRO IDS\n name: BRO\n native_vlan: office\nvlans:\n office:\n description: office network\n vid: 101"

F0518 13:28:21.209323 55 gnmi_set.go:160] Set failed: rpc error: code = Unknown desc = Exception calling application: 'config_files'

lantz commented 5 years ago

1) README.md issue; fixed in #14 and is now merged 2) Surprising that fuser was missing in 16.04 by default; will add psmisc to deps; fix in #17 3) Can't reproduce yet; @alshaboti could you possibly a) confirm that it happens with the latest FAUCET master b) provide a faucet.yaml that triggers the bug? c) include the output or log file from faucetagent.py?

lantz commented 5 years ago

3) Looks like the same issue as #19 which is technically not a bug but expected behavior with an older version of FAUCET.

Created #20 to add FAUCET version 1.9.3+ version requirement to README.md.

lantz commented 5 years ago

@alshaboti Can you confirm that the same config_files exception occurs with FAUCET version 1.9.3 and FAUCET master?

alshaboti commented 5 years ago

I installed faucet from apt repo as follows.

apt-get install curl gnupg apt-transport-https lsb-release -y \
    && echo "deb https://packagecloud.io/faucetsdn/faucet/$(lsb_release -si
| awk '{print tolower($0)}')/ $(lsb_release -sc) main" | tee
/etc/apt/sources.list.d/faucet.list \
    && curl -L https://packagecloud.io/faucetsdn/faucet/gpgkey | apt-key
add - \
    && apt-get update \
    && apt-get install faucet -y

On Tue, May 21, 2019 at 12:44 PM lantz notifications@github.com wrote:

  1. Might be the same as #19 https://github.com/faucetsdn/faucetagent/issues/19 which is technically not a bug but expected behavior with an older version of FAUCET.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/faucetsdn/faucetagent/issues/16?email_source=notifications&email_token=AEE3Q3VDNR3Q2444B4UHRJLPWNAXBA5CNFSM4HN57WHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV2N3ZA#issuecomment-494198244, or mute the thread https://github.com/notifications/unsubscribe-auth/AEE3Q3U4NS4QIYAISVLILGTPWNAXBANCNFSM4HN57WHA .

-- Best regards, Mohammed Al-Shaboti

alshaboti commented 5 years ago

It is Faucet version 1.9.2.

On Tue, May 21, 2019 at 1:37 PM Mohammed Alshaboti alshaboti.it@gmail.com wrote:

I installed faucet from apt repo as follows.

apt-get install curl gnupg apt-transport-https lsb-release -y \
    && echo "deb https://packagecloud.io/faucetsdn/faucet/$(lsb_release
-si | awk '{print tolower($0)}')/ $(lsb_release -sc) main" | tee
/etc/apt/sources.list.d/faucet.list \
    && curl -L https://packagecloud.io/faucetsdn/faucet/gpgkey | apt-key
add - \
    && apt-get update \
    && apt-get install faucet -y

On Tue, May 21, 2019 at 12:44 PM lantz notifications@github.com wrote:

  1. Might be the same as #19 https://github.com/faucetsdn/faucetagent/issues/19 which is technically not a bug but expected behavior with an older version of FAUCET.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/faucetsdn/faucetagent/issues/16?email_source=notifications&email_token=AEE3Q3VDNR3Q2444B4UHRJLPWNAXBA5CNFSM4HN57WHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV2N3ZA#issuecomment-494198244, or mute the thread https://github.com/notifications/unsubscribe-auth/AEE3Q3U4NS4QIYAISVLILGTPWNAXBANCNFSM4HN57WHA .

-- Best regards, Mohammed Al-Shaboti

-- Best regards, Mohammed Al-Shaboti

alshaboti commented 5 years ago

Yes, you are right, it is because of Facuet version. I installed Faucet using pip3, and it works fine. Faucet version in apt is 1.9.2 and in pip3 is 1.9.4

Thanks

On Tue, May 21, 2019 at 1:50 PM Mohammed Alshaboti alshaboti.it@gmail.com wrote:

It is Faucet version 1.9.2.

On Tue, May 21, 2019 at 1:37 PM Mohammed Alshaboti alshaboti.it@gmail.com wrote:

I installed faucet from apt repo as follows.

apt-get install curl gnupg apt-transport-https lsb-release -y \
    && echo "deb https://packagecloud.io/faucetsdn/faucet/$(lsb_release
-si | awk '{print tolower($0)}')/ $(lsb_release -sc) main" | tee
/etc/apt/sources.list.d/faucet.list \
    && curl -L https://packagecloud.io/faucetsdn/faucet/gpgkey | apt-key
add - \
    && apt-get update \
    && apt-get install faucet -y

On Tue, May 21, 2019 at 12:44 PM lantz notifications@github.com wrote:

  1. Might be the same as #19 https://github.com/faucetsdn/faucetagent/issues/19 which is technically not a bug but expected behavior with an older version of FAUCET.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/faucetsdn/faucetagent/issues/16?email_source=notifications&email_token=AEE3Q3VDNR3Q2444B4UHRJLPWNAXBA5CNFSM4HN57WHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV2N3ZA#issuecomment-494198244, or mute the thread https://github.com/notifications/unsubscribe-auth/AEE3Q3U4NS4QIYAISVLILGTPWNAXBANCNFSM4HN57WHA .

-- Best regards, Mohammed Al-Shaboti

-- Best regards, Mohammed Al-Shaboti

-- Best regards, Mohammed Al-Shaboti

lantz commented 5 years ago

OK, when #20 is merged I will close this.

gizmoguy commented 5 years ago

@alshaboti What distribution and version of linux are you using? I just checked the packaging server and it has debs for faucet 1.9.4.

This command might help you debug:

$ apt-cache policy python3-faucet

alshaboti commented 5 years ago

@gizmoguy I am using ubuntu:16:04, for some reason it was installing 1.9.2. Maybe I forgot to update it. It works fine now. sorry for this part. Thank you.

lantz commented 5 years ago

I think we can declare this as fixed in #20. Thanks everyone.