Beiträge von DesasterMaster

    /etc/nginx/conf.d/mysite_nextcloud.conf

    /etc/nginx/conf.d/mysite.de.conf

    /var/[definition='1','0']log[/definition]/nginx/error.[definition='1','0']log[/definition]

    Code
    2023/06/23 14:21:21 [warn] 1383#1383: conflicting server name "127.0.0.1" on 127.0.0.1:82, ignored
    2023/06/23 22:32:32 [warn] 1398#1398: conflicting server name "127.0.0.1" on 127.0.0.1:82, ignored
    2023/06/23 23:07:50 [crit] 1576#1576: *6 connect() to unix:/var/run/php/php7.4-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: 127.0.0.1, request: "GET /nextcloud/ HTTP/1.0", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock:", host: "192.168.178.40"
    2023/06/23 23:07:50 [error] 1576#1576: *4 open() "/etc/nginx/html/favicon.ico" failed (2: No such file or directory), client: 192.168.178.40, server: mysite.com, request: "GET /favicon.ico HTTP/2.0", host: "192.168.178.40", referrer: "https://192.168.178.40/nextcloud/"
    2023/06/23 23:11:44 [crit] 1576#1576: *10 connect() to unix:/var/run/php/php7.4-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: 127.0.0.1, request: "GET /nextcloud/ HTTP/1.0", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock:", host: "192.168.178.40"
    2023/06/23 23:11:44 [error] 1576#1576: *8 open() "/etc/nginx/html/favicon.ico" failed (2: No such file or directory), client: 192.168.178.40, server: mysite.com, request: "GET /favicon.ico HTTP/2.0", host: "192.168.178.40", referrer: "https://192.168.178.40/nextcloud/"

    Ich habe das Update auf Ubuntu 22.04 auf meiner Backup HDD durchlaufen lassen. Das eig. System läuft weiterhin auf Ubuntu 20.04 ohne Probleme.

    Das ganze dient der Sicherheit, dass nach dem Update, auch noch alles läuft.

    Der andere PC mit der Backup HDD hat die Lokale IP 192.168.178.40, während das eig. System mit dieser IP 192.168.178.32 angesteuert wird.

    Also habe ich versucht die NC mit https://192.168.178.40/nextcloud zu erreichen. Auch hier wird der Bad Gateway Fehler ausgegeben.

    Währenddessen das default System erst eine Zertifikat Warnung anzeigt und dann den Zugriff auf die NC verhindert, weil die IP nicht zu den trusted IPs gehört.

    Im [definition='1','0']log[/definition] file steht fastcgi://unix:/var/run/php/php7.4-fpm.sock:. Sollte das nicht auf php8.1-fpm laufen?

    Sieht eig. okay aus..

    Nach einem Systemupdate von Ubuntu 20.04 auf Ubuntu 22.04 bekomme nur noch den 502 Bad Gateway Fehler beim Aufruf von NC. Ich habe google schon genötigt, aber leider nicht viel gefunden.

    Unter 20.04 lief die NC25 mit php7.3, mariaDB und nginx.

    Ich habe fehlende Module und auch die php 8.1 fpm Version nachinstalliert. Auch das downgrade auf php 8.0 hat keine Besserung gebracht. Auch die NC config wurde auf php8.0-fpm bzw. php8.1-fpm geupdated.

    Hat wer eine Idee wo es klemmen könnte?


    Code
    etc/php/8.1/fpm/pool.d/www.conf enthält: `listen = /run/php/php8.1-fpm.sock`
    Code
    etc/nginx/conf.d/mysite_nextcloud.conf enthält `fastcgi_pass unix:/run/php/php8.1-fpm.sock
    Code
    The php8.1-fpm.sock and the php8.1-fpm.pid files are available in /run/php/
    Code
    etc/nginx/conf.d/mysite.de.conf enthält `server unix:/run/php/php8.1-fpm.sock;`
    Bash
    #!/bin/bash
    cd /home/htpc/easyepg-lite
    python3 main & disown
    sleep 10
    curl http://192.168.178.32:4000/api/start-grabber

    Naja, es funktioniert leider nicht.

    Code
    htpc@htpc:~/easyepg-lite$ bash easyepglite.sh
    easyepglite.sh: Zeile 2: cd: $'/home/htpc/easyepg-lite\r': Datei oder Verzeichnis nicht gefunden
    easyepglite.sh: Zeile 3: $'disown\r': Befehl nicht gefunden
    sleep: ungültiges Zeitintervall »10\r“
    „sleep --help“ liefert weitere Informationen.
    {"success": true}htpc@htpc:~/easyepg-lite$ python3: can't open file 'main.py': [Errno 2] No such file or directory
    Code
    >>> import sys
    >>> print(sys.path)
    ['', 'C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\python311.zip', 'C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\DLLs', 'C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib', 'C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311', 'C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages']
    >>>

    Windows

    Code
    >>> import sys
    >>> print(sys.path)
    ['', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/home/htpc/.local/lib/python3.8/site-packages', '/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages']

    Ubuntu

    Code
    python -V
    Python 3.8.10

    Ubuntu

    Code
    python -V
    Python 3.11.2

    Windows


    @DesasterMaster Kannst du bitte die Ausgabe des Befehls hier posten? Denn scheinbar stimmt etwas mit den konfigurierten Paths nicht. Und welche Python-Version kommt zum Einsatz (sowohl unter Windows als auch unter Linux)?

    [cbox]import sys
    print(sys.path)
    [/cbox]

    Ich habe keine Ahnung von Python und kann mit dem Befehl nichts anfangen, sorry

    @DesasterMaster
    Füge bitte mal die folgenden Zeilen ganz oben ein und führe dann das Skript aus...

    [cbox]import os, sys
    sys.path.append(os.path.dirname(__file__))
    [/cbox]

    ich habe die Zeilen der main.py oben hinzugefügt.

    Python
    python main.py
    Traceback (most recent call last):
      File "main.py", line 3, in <module>
        from resources.lib import epg, web
    ModuleNotFoundError: No module named 'resources.lib'; 'resources' is not a package

    Ich kann den Fehler reproduzieren, indem ich manuell mittels pip die Module resources und staty installiere. Dann bekomme ich die Fehlermeldung, dass es kein Modul "resources.lib" gibt - da Python versucht, anstelle des Verzeichnisses das Modul zu laden.

    Lösung: python -m pip uninstall resources

    Habe ich gemacht

    Code
    python -m pip uninstall resources
    Found existing installation: resources 0.0.1
    Uninstalling resources-0.0.1:
      Would remove:
        /usr/local/lib/python3.8/dist-packages/resources-0.0.1.dist-info/*
        /usr/local/lib/python3.8/dist-packages/resources/*
    Proceed (y/n)? y
      Successfully uninstalled resources-0.0.1

    Resultat beim ausführen von python main.py

    Python
    Traceback (most recent call last):
      File "main.py", line 1, in <module>
        from resources.lib import epg, web
    ModuleNotFoundError: No module named 'resources.lib'; 'resources' is not a package

    python3 -m pip install staty

    Code
    Collecting staty
      Downloading staty-1.2.4.tar.gz (9.4 kB)
    Building wheels for collected packages: staty
      Building wheel for staty (setup.py) ... done
      Created wheel for staty: filename=staty-1.2.4-py2.py3-none-any.whl size=9557 sha256=6b1765fdb5edb87be88409617375e434970997acd45272fb8f7e02609f6ec001
      Stored in directory: /root/.cache/pip/wheels/44/6a/65/15d3b4138efded819587e4ad0ed0afa6521002eaa26b5a120e
    Successfully built staty
    Installing collected packages: staty
    Successfully installed staty-1.2.4


    pip install python-resources


    Code
    Collecting python-resources
      Downloading python-resources-0.3.tar.gz (8.3 kB)
    Building wheels for collected packages: python-resources
      Building wheel for python-resources (setup.py) ... done
      Created wheel for python-resources: filename=python_resources-0.3-py3-none-any.whl size=7509 sha256=94b23c35c34b97d68ef70361dc6a9a4c146ed6c9e348d887b46dc3b78258fb37
      Stored in directory: /root/.cache/pip/wheels/95/3a/30/624733cad0f3b5b854240180c11336187192d9e4aacc1f5e7a
    Successfully built python-resources
    Installing collected packages: python-resources
    Successfully installed python-resources-0.3

    @PvD
    Ja, die Pfadangabe ist korrekt

    Es funktioniert aber dennoch nicht

    Python
    Traceback (most recent call last):
      File "main.py", line 1, in <module>
        from resources.lib import epg, web
    ImportError: No module named resources.lib
    htpc@htpc:~/1234$ python3 main.py
    Traceback (most recent call last):
      File "main.py", line 1, in <module>
        from resources.lib import epg, web
    ModuleNotFoundError: No module named 'resources.lib'