Giter VIP home page Giter VIP logo

Comments (10)

cryptooth avatar cryptooth commented on July 23, 2024 2

It took a bit of fiddling, but I've forked the Dasshio repository and gotten things working for me. The only real differences between 0.3.1 and my version is that the add-on generates the Docker image on the fly (instead of using a published image) and moves the tcpdump binary to /usr/bin during creation. I changed some of the add-on text as well just to make it explicitly clear that this is a work-around version, and isn't really a permanent solution.

If you're encountering the issue described here, you should be able to add my repository to your Hass.io add-on store, and install the add-on that way. My repository is:
https://github.com/theastropath/dasshio

I would love to not have to keep my fork up to date, so hopefully a proper fix gets added to the main repository eventually!

It's working on Ubunut 16.04 and latest hassio without crash.

Thank you.

from dasshio.

SmightyCrown avatar SmightyCrown commented on July 23, 2024

I have the same Problem, with nearly the same setup: Dasshio 0.3.1 in Hass.io supervisor 125 on an Ubuntu 16.04.
Is there a solution for it ?
Or is it possible to downgrade to 0.21 because that version worked without problems?

from dasshio.

theastropath avatar theastropath commented on July 23, 2024

For what it's worth, I have since upgraded to Dasshio 0.3.1 and Hassio supervisor 125 as well, and it still doesn't work for me.

I had previously set up another Hassio instance (Which had DNS issues) on Ubuntu 17.10, and Dasshio is working in that setup. My current workaround is to keep Dasshio running on that host, but sending commands to the Ubuntu 16.04 instance (Which works perfectly otherwise)

from dasshio.

IvoryAguado avatar IvoryAguado commented on July 23, 2024

from dasshio.

theastropath avatar theastropath commented on July 23, 2024

I've determined the cause of the problem and half determined a work-around, but not entirely sure how to get it actually working. Let me outline everything that I've determined:

By entering the Dasshio container and manually executing the dasshio.py, I was able to determine that the "sniff" function was picking up every packet that was hitting the network interface and not filtering out packets that don't match the specified filter.

I was able to find this issue:
secdev/scapy#393
Which mentions that the filter gets installed by tcpdump. Trying to manually run tcpdump gave me the following output:

bash-4.4# tcpdump
Error loading shared library libcrypto.so.43: Permission denied (needed by /usr/sbin/tcpdump)
Error loading shared library libpcap.so.1: Permission denied (needed by /usr/sbin/tcpdump)
Error relocating /usr/sbin/tcpdump: EVP_CIPHER_CTX_new: symbol not found
Error relocating /usr/sbin/tcpdump: EVP_CIPHER_iv_length: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_create: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_dump_ftell: symbol not found
Error relocating /usr/sbin/tcpdump: bpf_dump: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_compile: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_dump_close: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_datalink_name_to_val: symbol not found
Error relocating /usr/sbin/tcpdump: MD5_Update: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_tstamp_type_val_to_description: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_set_snaplen: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_snapshot: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_list_tstamp_types: symbol not found
Error relocating /usr/sbin/tcpdump: MD5_Final: symbol not found
Error relocating /usr/sbin/tcpdump: EVP_get_cipherbyname: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_list_datalinks: symbol not found
Error relocating /usr/sbin/tcpdump: EVP_CIPHER_CTX_free: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_stats: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_breakloop: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_open_offline: symbol not found
Error relocating /usr/sbin/tcpdump: OPENSSL_add_all_algorithms_noconf: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_close: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_dump_open: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_datalink_val_to_name: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_dump: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_tstamp_type_val_to_name: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_open_offline_with_tstamp_precision: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_lookupnet: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_set_immediate_mode: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_lib_version: symbol not found
Error relocating /usr/sbin/tcpdump: SSLeay_version: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_statustostr: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_geterr: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_setfilter: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_setdirection: symbol not found
Error relocating /usr/sbin/tcpdump: EVP_Cipher: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_set_buffer_size: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_set_rfmon: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_freealldevs: symbol not found
Error relocating /usr/sbin/tcpdump: EVP_CipherInit_ex: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_can_set_rfmon: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_tstamp_type_name_to_val: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_findalldevs: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_free_tstamp_types: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_set_timeout: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_freecode: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_loop: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_strerror: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_set_tstamp_type: symbol not found
Error relocating /usr/sbin/tcpdump: EVP_CIPHER_CTX_block_size: symbol not found
Error relocating /usr/sbin/tcpdump: OBJ_NAME_add: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_datalink: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_dump_flush: symbol not found
Error relocating /usr/sbin/tcpdump: MD5_Init: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_datalink_val_to_description: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_free_datalinks: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_set_tstamp_precision: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_activate: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_set_promisc: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_set_datalink: symbol not found

Which obviously seems bad (And yes, I verified that I was root, so the lack of permission seemed odd)

Further searching to determine why tcpdump might not be working lead me to the following issue:
moby/moby#14140
In which this is mentioned as "likely an AppArmor issue" (A ha! That sort of makes sense!). A temporary workaround is described in the discussion to try moving tcpdump to "/usr/local/bin" (and then run "hash -r" to rehash your path). I did so, and manually ran the dasshio script. It worked! The button press was detected, but since the script that was run during the container creation crashed, the container died.

So there's some sort of privilege issue being caused by AppArmor that is preventing tcpdump from being executed in /usr/sbin/ but not in /usr/local/bin/.

What I'm not sure about (being a Docker noob) is how to move the tcpdump binary in the container and make that permanent until the issue gets resolved properly. Ideas?

from dasshio.

theastropath avatar theastropath commented on July 23, 2024

It took a bit of fiddling, but I've forked the Dasshio repository and gotten things working for me. The only real differences between 0.3.1 and my version is that the add-on generates the Docker image on the fly (instead of using a published image) and moves the tcpdump binary to /usr/bin during creation. I changed some of the add-on text as well just to make it explicitly clear that this is a work-around version, and isn't really a permanent solution.

If you're encountering the issue described here, you should be able to add my repository to your Hass.io add-on store, and install the add-on that way. My repository is:
https://github.com/theastropath/dasshio

I would love to not have to keep my fork up to date, so hopefully a proper fix gets added to the main repository eventually!

from dasshio.

danimtb avatar danimtb commented on July 23, 2024

So, looking at the @theastropath workaround it seems easy to add it. I have been running this version in RPI for a long time and now I run it inside an Ubuntu 18 an it working without issue.

I am willing to make the workaround suggested but would like to know if any of you found another way of making it work without the IndexError: Layer [ARP] not found

Thanks!

from dasshio.

theastropath avatar theastropath commented on July 23, 2024

@danimtb I believe the other (proper) solution would be to figure out how AppArmor needs to be configured to allow tcpdump to run in its current location. That being said, I have absolutely no understanding of how AppArmor really works, so I can't provide much insight. I think just moving tcpdump is the easy/good enough solution.

from dasshio.

smartsoldier avatar smartsoldier commented on July 23, 2024

I have been experiencing the crashing issue as well so please implement this workaround. Or did you already? I checked the releases page of your github and the other guys fork and they both say Aug was latest but your posts are only 25 days old. Where is your latest code lol am I missing it?

from dasshio.

theastropath avatar theastropath commented on July 23, 2024

There were some minor changes (documentation, IIRC) to the base version around when I made the workarounds in my fork. If you are experiencing the "Layer [ARP] not found" crash, I would recommend using my fork for the time being, then switch back to the original version once the workaround has been implemented there. You should be able to just copy the configuration from my version and just dump it into the base version once you need to make the switch.

from dasshio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.