Ankündigung

Einklappen
Keine Ankündigung bisher.

Unhandled exception: 'str' object

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    Unhandled exception: 'str' object

    Ich habe hier nach einem Git Pull der Plugins (Develop) von heute einen Exception Fehler in SHNG (Master 1.5.1) der die Ausführung von SHNG und SV verhindert...

    Code:
    2018-09-02  20:44:00 ERROR    __main__          Unhandled exception: 'str' object has no attribute 'keys'
    <class 'AttributeError'>
      File "/usr/local/smarthome/bin/smarthome.py", line 1150, in <module>
        sh.start()
      File "/usr/local/smarthome/bin/smarthome.py", line 474, in start
        self.plugins = lib.plugin.Plugins(self, configfile=self._plugin_conf_basename)
      File "/usr/local/smarthome/lib/plugin.py", line 114, in __init__
        plugin_name, self.meta = self._get_pluginname_and_metadata(plugin, _conf[plugin])
      File "/usr/local/smarthome/lib/plugin.py", line 182, in _get_pluginname_and_metadata
        meta = Metadata(self._sh, plugin_name, 'plugin', (classpath+plugin_version).replace('.',os.sep))
      File "/usr/local/smarthome/lib/metadata.py", line 92, in __init__
        self._itemdeflist = list(self.itemdefinitions.keys())
    Kann mir da jemand helfen?

    Gruss
    Marcus



    #2
    1. Man sollte Master Branch (core) und Develop Branch (plugins) nicht mischen. Es sei denn, man weiss ganz genau was man tut.

    2. Um genauer zu sagen, müsstest Du schon erheblich mehr Informationen beisteuern als nur die Exception. Fang z.B. mal mit der ../etc/plugin.yaml an.
    Viele Grüße
    Martin

    There is no cloud. It's only someone else's computer.

    Kommentar


      #3
      Ja, den Satz hatte ich schon mal gelesen.... Allerdings hat das bisher wunderbar funktioniert. Jetzt leuchtets mir auch ein.

      Hier ist mal meine plugin.yaml:

      Code:
      # plugin.yaml
      
      BackendServer:
          class_name: BackendServer
          class_path: plugins.backend
          # ip: 192.178.168.60
          port: 8383
          updates_allowed: 'True'
          threads: 8
          user: admin
          password: xxxx
          language: de
          # developer_mode: 'on'
          # pypi_timeout: 5
      
      knx:
          class_name: KNX
          class_path: plugins.knx
          # host: 127.0.0.1
          # port: 6720
          # send_time: 3600 # update cycle date/time in seconds. Default is 600
          # time_ga: 3/3/0
          # date_ga: 3/3/1
      
      visu:
          class_name: WebSocket
          class_path: plugins.visu_websocket
          # ip: 0.0.0.0
          # port: 2424
          # tls: no
          wsproto: 4
          acl: rw
      
      smartvisu:
          class_name: SmartVisu
          class_path: plugins.visu_smartvisu
          # '"neue" Linux Versionen (z.B. Debian > 8.x, Ubuntu > 14.x)'
          smartvisu_dir: /var/www/html/smartVISU
          # nur \"alte\" Linux-Variationen
          # smartvisu_dir: /var/www/smartVISU
          # generate_pages: True
          # handle_widgets: True
          # overwrite_templates: Yes
          # visu_style: blk
      
      cli:
          class_name: CLI
          class_path: plugins.cli
          ip: 0.0.0.0
          update: 'True'
      
      sql:
          class_name: SQL
          class_path: plugins.sqlite_visu2_8
          # dumpfile: /tmp/smarthomedb.dump
      
      # Onewire Plugin
      # [ow]
      # class_name: OneWire
      # class_path: plugins.onewire
      
      Sonos:
          class_name: Sonos
          class_path: plugins.sonos
          tts: true                            # optional, default:  false
          local_webservice_path: /tmp/tts      # optional, default:  empty. If 'tts' is enabled, this option is mandatory.
                                               # All tts files will be stored here.
          local_webservice_path_snippet: /tmp/snippet
                                               # optional, default:  empty. For some reasons it could be necessary to have
                                               # separated paths for TTS files and your own snippet files. You can define the
                                               # local path for your snippets here. If 'tts' is enabled and
                                               # 'local_webservice_path_snippet' is empty, the value for
                                               # 'local_webservice_path' is used for your snippet audio files.
          # webservice_ip: 192.168.1.40        # optional, default:  automatic. You can set a specific ip address.
                                               # If you're using a docker container, you have to set the host
                                               # ip address here.  
          webservice_port: 23500               # optional, default:  23500
          discover_cycle: 1200                 # optional, default:  120 (in seconds)
          snippet_duration_offset: 0.0         # optional, default: 0.0 (in seconds)
          speaker_ips:                         # optional. You can set static IP addresses for your Sonos speaker. This
            - 192.168.178.47                   # will disable auto-discovery. This is useful if you're using a
            - 192.168.178.24                   # containerized environment with restricted network access.
            - 192.168.178.34
            - 192.168.178.46
          
      weather_data:
          class_name: Wunderground
          class_path: plugins.wunderground
          apikey: 541a93XXXXXXXX
          language: de
          location: Germany/Viernheim
          item_subtree: wetter
          instance: wetter_vhm
          cycle: 1800
          
      notify:
          class_name: Prowl
          class_path: plugins.prowl
          apikey: 7563e48f11e20a43f2XXXXXXXXXXX             # optional, secret global key for prowl
          # instance: Smarthome Schulte                                  # optional, instance name displayed in messages
          
      ical:
          class_name: iCal
          class_path: plugins.ical
          calendars:
            - smarthome:https://calendar.google.com/calendar/ical/r3r8b5g0q9s44tr8qmb175dpfs%40group.calendar.google.com/private-ef9dc44a8180XXXXXXXXXXXXX/basic.ics
          cycle: 3600
          
      HUE: # ZigBee Gateway Dresden Elektronik 'RaspBee' mit Controller 'FLS-PP lp' ZigBee Light Link RGBW
          class_name: HUE
          class_path: plugins.hue
          hue_user:
            - 38f625a739562a8XXXXXXXXXXX
          hue_ip:
            - 192.168.178.62
          hue_port:
            - '80'
          cycle_lamps: 10
          cycle_bridges: 30
          default_transitionTime: '0.4'
          
      mqtt:
          class_name: Mqtt
          class_path: plugins.mqtt
          host: 127.0.0.1
          # ip: 192.178.168.60
          # host: localhost
          # port: 1883
          # qos: 1
          # last_will_topic: 'shng/$online'
          # last_will_payload: False
          # birth_topic: 'shng/$online'
          # birth_payload: True
      
          # user: None                 # username (or None)
          # password: None             # password (or None)
          # hashed_password: 1245a9633edf47b7091f37c4d294b5be5a9936c81 ...    
          # === The following parameters are not yet implemented:
          # publish_items: no          # NEW: publish using item-path
          # items_topic_prefix: 'shng' # NEW: prefix for publishing items    
          # acl: pub                   # NEW: access control (none, pub, sub, pubsub)
          # tls: None                  # use TLS version (v1 or None)
          # ca_certs: '/etc/...'       # path to the Certificate Authority certificate files

      Gruss & schon mal Danke vorab.
      Marcus
      Zuletzt geändert von SMarcus; 02.09.2018, 20:58.

      Kommentar


        #4
        Von welchem Plugin willst Du denn die Develop Version nutzen?

        Alle Plugins aus Develop zu nehmen hat ein hohes Fehlerrisiko. Du solltest die Plugins schon aus dem Master nehmen und nur das eine Plugin, welches im Master nicht vorhanden ist oder wo Du eine bestimmte neu Funktionalität benötigst dazu kopieren und ausprobieren ob das harmoniert.
        Viele Grüße
        Martin

        There is no cloud. It's only someone else's computer.

        Kommentar


          #5
          Das Sonos-Plugin wäre mir wichtig, da gabs mit den Updates einiges was besser lief bei der TTS Sprechausgabe.
          Bei allen anderen sollte auch der Master gehen.

          Wie würde ich den alle Plugins ausser dem Sonos auf Master umstellen? (Bin nicht so bewandert mit Git)

          Überall bei den Plugins den Stand von z.B. 2 Wochen einspielen geht mit Git wahrscheinlich nicht, oder?

          Gruss
          Marcus

          Kommentar


            #6
            Du machst eine normale Installation aus dem master (wie im Handbuch beschrieben). Oder Du wechselst für die Plugins den Branch auf master (git Dokumentation zu Rate ziehen).

            Wenn Deine Installation richtig auf dem Master läuft, hast Du mehrere Möglichkeiten das eine Plugin aus dem develop dazu zu bekommen. Eine Möglichkeit, ist, den Plugin develop Branch in ein anderes (von der shNG Installation unabhängiges Verzeichnis auszuchecken (mit git clone ...). Dann kannst Du in der shNG Installation zur Sicherheit das sonos Verzeichnis auf sonos_alt umbenennen und aus dem develop Verzeichnis das sonos Verzeichnis rüber kopieren.

            Viele Grüße
            Martin

            There is no cloud. It's only someone else's computer.

            Kommentar


              #7
              Danke. Ich hab erstmal das Plugin-Verzeichnis von Develop auf Master branch umgestellt:

              Code:
              smarthome@smarthome:/usr/local/smarthome/plugins$ [MARKIEREN]git checkout master[/MARKIEREN]
              Zu Branch 'master' gewechselt
              Ihr Branch ist zu 'origin/master' um 27 Commits hinterher, und kann vorgespult werden.
                (benutzen Sie "git pull", um Ihren lokalen Branch zu aktualisieren)
              smarthome@smarthome:/usr/local/smarthome/plugins$ [MARKIEREN]git pull[/MARKIEREN]
              Das schein den Exception-Fehler schon mal behoben zu haben.

              Da ich ein wöchentliches Backup habe, werde ich die Backup-Dateien von Sonos-Plugin (Develop-Status) in das SHNG-Sonos Plugin kopieren.

              Danke an Msinn & Gute Nacht an Alle da draußen
              Marcus

              Kommentar

              Lädt...
              X