christgau / wsdd

A Web Service Discovery host daemon.
MIT License
841 stars 99 forks source link

Error in main loop KeyError: 'DisplayName' #58

Closed justinvreeland closed 4 years ago

justinvreeland commented 4 years ago

To be honest i'm not even sure that I'm using this correctly I wanted to discover the share on my network from my linux machine I started with wsdd -D -i wlp2s0 hoping it would just spit out a list of shares on my network but instead I the following error and it hangs forever. I'm using the aur package which is version 0.6.1

Thanks,

2020-09-08 21:01:57,093:wsdd WARNING(pid 9093): Discovery enabled but no listen option provided. Falling back to port 5359
2020-09-08 21:02:00,274:wsdd ERROR(pid 9093): error in main loop
Traceback (most recent call last):
  File "/usr/bin/wsdd", line 1630, in main
    key.data.handle_request(key)
  File "/usr/bin/wsdd", line 170, in handle_request
    handler.handle_request(msg, address)
  File "/usr/bin/wsdd", line 518, in handle_request
    self.handle_message(msg, self.mch, address)
  File "/usr/bin/wsdd", line 348, in handle_message
    retval = handler(header, body)
  File "/usr/bin/wsdd", line 558, in handle_probe_match
    self.perform_metadata_exchange(endpoint, xaddr)
  File "/usr/bin/wsdd", line 606, in perform_metadata_exchange
    self.handle_metadata(stream.read(), endpoint, xaddr)
  File "/usr/bin/wsdd", line 619, in handle_metadata
    self.known_devices[device_uuid] = WSDDiscoveredDevice(
  File "/usr/bin/wsdd", line 424, in __init__
    self.update(xml_str, xaddr, interface)
  File "/usr/bin/wsdd", line 454, in update
    self.props['DisplayName'], self.props['BelongsTo'], addr,
KeyError: 'DisplayName'
christgau commented 4 years ago

To be honest i'm not even sure that I'm using this correctly I wanted to discover the share on my network from my linux machine I started with wsdd -D -i wlp2s0 hoping it would just spit out a list of shares on my network

wsdd does not scan (if in discovery mode) for shares but for computers fulfilling the WSD protocol. Thus you will only see machines providing shares. Everything else is subject to Samba or whatever other client/protocol.

I the following error and it hangs forever.

Thanks for reporting that. Could you please try the issue-59 branch. There is (accidentally) a work-in-progress commit that should fix the problem. Currently it displays the device's UUID when using the socket-based API and the list command but that's cosmetic...

justinvreeland commented 4 years ago

Thanks for the response! Using that branch does eliminate that issue. However when using the verbose flag while I can see the hosts on my network, I have a new error.

Traceback (most recent call last):
  File "/usr/lib/python3.8/logging/__init__.py", line 1081, in emit
    msg = self.format(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 925, in format
    return fmt.format(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 664, in format
    record.message = record.getMessage()
  File "/usr/lib/python3.8/logging/__init__.py", line 369, in getMessage
    msg = msg % self.args
ValueError: unsupported format character '{' (0x7b) at index 20
Call stack:
  File "wsdd.py", line 1680, in <module>
    sys.exit(main())
  File "wsdd.py", line 1660, in main
    key.data.handle_request(key)
  File "wsdd.py", line 184, in handle_request
    handler.handle_request(msg, address)
  File "wsdd.py", line 548, in handle_request
    self.handle_message(msg, self.mch, address)
  File "wsdd.py", line 372, in handle_message
    retval = handler(header, body)
  File "wsdd.py", line 588, in handle_probe_match
    self.perform_metadata_exchange(endpoint, xaddr)
  File "wsdd.py", line 636, in perform_metadata_exchange
    self.handle_metadata(stream.read(), endpoint, xaddr)
  File "wsdd.py", line 650, in handle_metadata
    self.known_devices[device_uuid] = WSDDiscoveredDevice(
  File "wsdd.py", line 449, in __init__
    self.update(xml_str, xaddr, interface)
  File "wsdd.py", line 483, in update
    logger.info('discovered {} on {}%{}', self.props['FriendlyName'],

Should I open a new ticket for that one.

christgau commented 4 years ago

Should I open a new ticket for that one.

No, thanks. As I said, the commit was WIP ;-)

Give the issue branch (see above) a try.