FrogTheFrog / moondeck-buddy

A server-side part of the MoonDeck plugin for the SteamDeck.
GNU Lesser General Public License v3.0
151 stars 9 forks source link

Sunshine App sync with buddy returns no apps #54

Closed moontaincow closed 1 year ago

moontaincow commented 1 year ago

Running the appimage on arch linux.

The MoonDeck plugin reports that apps are in sync, but when enabling debug logs I can see that no app names are returned in the response.

I'm not entirely sure why this is as there are no error logs suggesting that the file can't be found / loaded / or JSON decoded.

Entire moondeckbuddy.log:

[14:44:17.791] INFO     buddy.utils: Log location: "/tmp/moondeckbuddy.log"
[14:44:17.791] INFO     buddy.main: startup. Version: 1.5.4
[14:44:17.886] INFO     buddy.server: Server started listening at port 59999
[14:44:17.886] INFO     buddy.main: startup finished.
[14:44:17.886] DEBUG    buddy.shared: getAppName() >>  "MoonDeckBuddy"
[14:44:17.886] DEBUG    buddy.shared: getLogDir() >>  "/tmp"
[14:44:17.886] DEBUG    buddy.shared: getLogName() >>  "moondeckbuddy.log"
[14:44:17.886] DEBUG    buddy.shared: getLogPath() >>  "/tmp/moondeckbuddy.log"
[14:44:17.886] DEBUG    buddy.shared: getSettingsDir() >>  "/home/jarret/.config/moondeckbuddy"
[14:44:17.886] DEBUG    buddy.shared: getSettingsName() >>  "settings.json"
[14:44:17.886] DEBUG    buddy.shared: getSettingsPath() >>  "/home/jarret/.config/moondeckbuddy/settings.json"
[14:44:17.886] DEBUG    buddy.shared: getAutoStartDir() >>  "/home/jarret/.config/autostart"
[14:44:17.886] DEBUG    buddy.shared: getAutoStartPath() >>  "/home/jarret/.config/autostart/moondeckbuddy.desktop"
[14:44:17.886] DEBUG    buddy.shared: getAutoStartExec() >>  "/home/jarret/Applications/MoonDeckBuddy-1.5.4-x86_64_2abe97eb09bb04384c60528dee861c72.AppImage"
[14:44:17.886] DEBUG    buddy.utils: Mapped "SecureProtocols" to 4
[14:44:18.848] DEBUG    buddy.os: Steam is running!
[14:44:18.859] DEBUG    buddy.os: Handling Steam start.
[14:44:18.859] DEBUG    buddy.os: Steam exec path: "/usr/bin/steam"
[14:44:26.776] DEBUG    buddy.main: 
Request: QHttpServerRequest((Url: QUrl("https://192.168.0.42:59999/apiVersion"))(Headers: ("Host": "192.168.0.42:59999"), ("authorization": "basic <REDACTED>"), ("Accept": "*/*"), ("Accept-Encoding": "gzip, deflate"), ("User-Agent": "Python/3.10 aiohttp/3.8.1"))(RemoteHost: QHostAddress("::ffff:192.168.0.55"))(BodySize: 0)) | "" 
Response: QHttpServerResponder::StatusCode::Ok | "{\"version\":3}"
[14:44:26.786] DEBUG    buddy.main: 
Request: QHttpServerRequest((Url: QUrl("https://192.168.0.42:59999/pairingState/a5065fd2-1944-42bb-8887-03ed4c38ef51"))(Headers: ("Host": "192.168.0.42:59999"), ("authorization": "basic <REDACTED>"), ("Accept": "*/*"), ("Accept-Encoding": "gzip, deflate"), ("User-Agent": "Python/3.10 aiohttp/3.8.1"))(RemoteHost: QHostAddress("::ffff:192.168.0.55"))(BodySize: 0)) | "" 
Response: QHttpServerResponder::StatusCode::Ok | "{\"state\":\"Paired\"}"
[14:44:26.791] DEBUG    buddy.main: 
Request: QHttpServerRequest((Url: QUrl("https://192.168.0.42:59999/pcState"))(Headers: ("Host": "192.168.0.42:59999"), ("authorization": "basic <REDACTED>"), ("Accept": "*/*"), ("Accept-Encoding": "gzip, deflate"), ("User-Agent": "Python/3.10 aiohttp/3.8.1"))(RemoteHost: QHostAddress("::ffff:192.168.0.55"))(BodySize: 0)) | "" 
Response: QHttpServerResponder::StatusCode::Ok | "{\"state\":\"Normal\"}"
[14:44:26.798] DEBUG    buddy.main: 
Request: QHttpServerRequest((Url: QUrl("https://192.168.0.42:59999/gamestreamAppNames"))(Headers: ("Host": "192.168.0.42:59999"), ("authorization": "basic <REDACTED>"), ("Accept": "*/*"), ("Accept-Encoding": "gzip, deflate"), ("User-Agent": "Python/3.10 aiohttp/3.8.1"))(RemoteHost: QHostAddress("::ffff:192.168.0.55"))(BodySize: 0)) | "" 
Response: QHttpServerResponder::StatusCode::Ok | "{\"appNames\":[]}"

I've tried updating the apps.json location in the config to confirm that errors are logged when it doesn't exist in the expected location, manually pointed it to the correct location, and my apps.json looks fine and has read permission for everyone.

FrogTheFrog commented 1 year ago

I've started a new build with more logging: https://github.com/FrogTheFrog/moondeck-buddy/actions/runs/5911921903

I will replace the existing 1.5.4 release with binaries from this build.

FrogTheFrog commented 1 year ago

@moontaincow Get the latest release and paste the logs please

moontaincow commented 1 year ago

Thanks for the fast response. Here you go:

[15:36:02.800] INFO     buddy.utils: Log location: "/tmp/moondeckbuddy.log"
[15:36:02.800] INFO     buddy.main: startup. Version: 1.5.4
[15:36:02.881] INFO     buddy.server: Server started listening at port 59999
[15:36:02.881] INFO     buddy.main: startup finished.
[15:36:02.881] DEBUG    buddy.shared: getAppName() >>  "MoonDeckBuddy"
[15:36:02.881] DEBUG    buddy.shared: getLogDir() >>  "/tmp"
[15:36:02.881] DEBUG    buddy.shared: getLogName() >>  "moondeckbuddy.log"
[15:36:02.881] DEBUG    buddy.shared: getLogPath() >>  "/tmp/moondeckbuddy.log"
[15:36:02.881] DEBUG    buddy.shared: getSettingsDir() >>  "/home/jarret/.config/moondeckbuddy"
[15:36:02.881] DEBUG    buddy.shared: getSettingsName() >>  "settings.json"
[15:36:02.881] DEBUG    buddy.shared: getSettingsPath() >>  "/home/jarret/.config/moondeckbuddy/settings.json"
[15:36:02.881] DEBUG    buddy.shared: getAutoStartDir() >>  "/home/jarret/.config/autostart"
[15:36:02.881] DEBUG    buddy.shared: getAutoStartPath() >>  "/home/jarret/.config/autostart/moondeckbuddy.desktop"
[15:36:02.881] DEBUG    buddy.shared: getAutoStartExec() >>  "/home/jarret/Applications/MoonDeckBuddy-1.5.4-x86_64_1ee834865f94c577b3482b9a519ffcaa.AppImage"
[15:36:02.881] DEBUG    buddy.utils: Mapped "SecureProtocols" to 4
[15:36:03.844] DEBUG    buddy.os: Steam is running!
[15:36:03.855] DEBUG    buddy.os: Handling Steam start.
[15:36:03.855] DEBUG    buddy.os: Steam exec path: "/usr/bin/steam"
[15:36:10.850] DEBUG    buddy.main: 
Request: QHttpServerRequest((Url: QUrl("https://192.168.0.42:59999/apiVersion"))(Headers: ("Host": "192.168.0.42:59999"), ("authorization": "basic <REDACTED>"), ("Accept": "*/*"), ("Accept-Encoding": "gzip, deflate"), ("User-Agent": "Python/3.10 aiohttp/3.8.1"))(RemoteHost: QHostAddress("::ffff:192.168.0.55"))(BodySize: 0)) | "" 
Response: QHttpServerResponder::StatusCode::Ok | "{\"version\":3}"
[15:36:10.856] DEBUG    buddy.main: 
Request: QHttpServerRequest((Url: QUrl("https://192.168.0.42:59999/pairingState/a5065fd2-1944-42bb-8887-03ed4c38ef51"))(Headers: ("Host": "192.168.0.42:59999"), ("authorization": "basic <REDACTED>"), ("Accept": "*/*"), ("Accept-Encoding": "gzip, deflate"), ("User-Agent": "Python/3.10 aiohttp/3.8.1"))(RemoteHost: QHostAddress("::ffff:192.168.0.55"))(BodySize: 0)) | "" 
Response: QHttpServerResponder::StatusCode::Ok | "{\"state\":\"Paired\"}"
[15:36:10.863] DEBUG    buddy.main: 
Request: QHttpServerRequest((Url: QUrl("https://192.168.0.42:59999/pcState"))(Headers: ("Host": "192.168.0.42:59999"), ("authorization": "basic <REDACTED>"), ("Accept": "*/*"), ("Accept-Encoding": "gzip, deflate"), ("User-Agent": "Python/3.10 aiohttp/3.8.1"))(RemoteHost: QHostAddress("::ffff:192.168.0.55"))(BodySize: 0)) | "" 
Response: QHttpServerResponder::StatusCode::Ok | "{\"state\":\"Normal\"}"
[15:36:10.870] DEBUG    buddy.os: selected filepath for Sunshine apps: "/home/jarret/.config/sunshine/apps.json"
[15:36:10.870] DEBUG    buddy.os: Sunshine apps file content: 
{
    "apps": [
        {
            "name": "Low Res Desktop",
            "prep-cmd": [
                {
                    "do": "xrandr --output HDMI-1 --mode 1920x1080",
                    "undo": "xrandr --output HDMI-1 --mode 1920x1200"
                }
            ]
        },
        {
            "detached": [
                "setsid steam steam://open/bigpicture"
            ],
            "image-path": "./assets/steam.png",
            "name": "Steam BigPicture",
            "output": "steam.txt"
        },
        {
            "cmd": "/home/jarret/Applications/MoonDeckBuddy-1.5.4-x86_64_2abe97eb09bb04384c60528dee861c72.AppImage --exec MoonDeckStream",
            "elevated": "false",
            "exclude-global-prep-cmd": "false",
            "image-path": "",
            "name": "MoonDeckStream",
            "output": ""
        },
        {
            "cmd": "",
            "detached": [
                "setsid steam steam://rungameid/18071461303276273664"
            ],
            "elevated": "false",
            "exclude-global-prep-cmd": "false",
            "image-path": "/home/jarret/.config/sunshine/covers/igdb_1877.png",
            "name": "Cyberpunk 2077",
            "output": ""
        }
    ],
    "env": {
        "PATH": "$(PATH):$(HOME)/.local/bin"
    }
}

[15:36:10.870] DEBUG    buddy.os: parsed the following Sunshine apps: QSet()
[15:36:10.870] DEBUG    buddy.main: 
Request: QHttpServerRequest((Url: QUrl("https://192.168.0.42:59999/gamestreamAppNames"))(Headers: ("Host": "192.168.0.42:59999"), ("authorization": "basic <REDACTED>"), ("Accept": "*/*"), ("Accept-Encoding": "gzip, deflate"), ("User-Agent": "Python/3.10 aiohttp/3.8.1"))(RemoteHost: QHostAddress("::ffff:192.168.0.55"))(BodySize: 0)) | "" 
Response: QHttpServerResponder::StatusCode::Ok | "{\"appNames\":[]}"
FrogTheFrog commented 1 year ago

It works for me, WTH? Can you please upload the file itself? Maybe it has some hidden characters or something.

moontaincow commented 1 year ago

Here you go! apps.zip

FrogTheFrog commented 1 year ago

Yeah, no luck. Download the latest release again please, I now log every step. At least should see where it fails.

moontaincow commented 1 year ago
[16:21:02.422] INFO     buddy.utils: Log location: "/tmp/moondeckbuddy.log"
[16:21:02.422] INFO     buddy.main: startup. Version: 1.5.4
[16:21:02.510] INFO     buddy.server: Server started listening at port 59999
[16:21:02.510] INFO     buddy.main: startup finished.
[16:21:02.510] DEBUG    buddy.shared: getAppName() >>  "MoonDeckBuddy"
[16:21:02.510] DEBUG    buddy.shared: getLogDir() >>  "/tmp"
[16:21:02.510] DEBUG    buddy.shared: getLogName() >>  "moondeckbuddy.log"
[16:21:02.510] DEBUG    buddy.shared: getLogPath() >>  "/tmp/moondeckbuddy.log"
[16:21:02.510] DEBUG    buddy.shared: getSettingsDir() >>  "/home/jarret/.config/moondeckbuddy"
[16:21:02.510] DEBUG    buddy.shared: getSettingsName() >>  "settings.json"
[16:21:02.510] DEBUG    buddy.shared: getSettingsPath() >>  "/home/jarret/.config/moondeckbuddy/settings.json"
[16:21:02.510] DEBUG    buddy.shared: getAutoStartDir() >>  "/home/jarret/.config/autostart"
[16:21:02.510] DEBUG    buddy.shared: getAutoStartPath() >>  "/home/jarret/.config/autostart/moondeckbuddy.desktop"
[16:21:02.510] DEBUG    buddy.shared: getAutoStartExec() >>  "/home/jarret/Applications/MoonDeckBuddy-1.5.4-x86_64_6a73e309e8f297287dee7f7874eb820a.AppImage"
[16:21:02.510] DEBUG    buddy.utils: Mapped "SecureProtocols" to 4
[16:21:03.572] DEBUG    buddy.os: Steam is running!
[16:21:03.584] DEBUG    buddy.os: Handling Steam start.
[16:21:03.584] DEBUG    buddy.os: Steam exec path: "/usr/bin/steam"
[16:21:05.458] DEBUG    buddy.main: 
Request: QHttpServerRequest((Url: QUrl("https://192.168.0.42:59999/apiVersion"))(Headers: ("Host": "192.168.0.42:59999"), ("authorization": "basic <REDACTED>"), ("Accept": "*/*"), ("Accept-Encoding": "gzip, deflate"), ("User-Agent": "Python/3.10 aiohttp/3.8.1"))(RemoteHost: QHostAddress("::ffff:192.168.0.55"))(BodySize: 0)) | "" 
Response: QHttpServerResponder::StatusCode::Ok | "{\"version\":3}"
[16:21:05.471] DEBUG    buddy.main: 
Request: QHttpServerRequest((Url: QUrl("https://192.168.0.42:59999/pairingState/a5065fd2-1944-42bb-8887-03ed4c38ef51"))(Headers: ("Host": "192.168.0.42:59999"), ("authorization": "basic <REDACTED>"), ("Accept": "*/*"), ("Accept-Encoding": "gzip, deflate"), ("User-Agent": "Python/3.10 aiohttp/3.8.1"))(RemoteHost: QHostAddress("::ffff:192.168.0.55"))(BodySize: 0)) | "" 
Response: QHttpServerResponder::StatusCode::Ok | "{\"state\":\"Paired\"}"
[16:21:05.478] DEBUG    buddy.main: 
Request: QHttpServerRequest((Url: QUrl("https://192.168.0.42:59999/pcState"))(Headers: ("Host": "192.168.0.42:59999"), ("authorization": "basic <REDACTED>"), ("Accept": "*/*"), ("Accept-Encoding": "gzip, deflate"), ("User-Agent": "Python/3.10 aiohttp/3.8.1"))(RemoteHost: QHostAddress("::ffff:192.168.0.55"))(BodySize: 0)) | "" 
Response: QHttpServerResponder::StatusCode::Ok | "{\"state\":\"Normal\"}"
[16:21:05.483] DEBUG    buddy.os: selected filepath for Sunshine apps: "/home/jarret/.config/sunshine/apps.json"
[16:21:05.483] DEBUG    buddy.os: Sunshine apps file content: 
{
    "apps": [
        {
            "name": "Low Res Desktop",
            "prep-cmd": [
                {
                    "do": "xrandr --output HDMI-1 --mode 1920x1080",
                    "undo": "xrandr --output HDMI-1 --mode 1920x1200"
                }
            ]
        },
        {
            "detached": [
                "setsid steam steam://open/bigpicture"
            ],
            "image-path": "./assets/steam.png",
            "name": "Steam BigPicture",
            "output": "steam.txt"
        },
        {
            "cmd": "/home/jarret/Applications/MoonDeckBuddy-1.5.4-x86_64_2abe97eb09bb04384c60528dee861c72.AppImage --exec MoonDeckStream",
            "elevated": "false",
            "exclude-global-prep-cmd": "false",
            "image-path": "",
            "name": "MoonDeckStream",
            "output": ""
        },
        {
            "cmd": "",
            "detached": [
                "setsid steam steam://rungameid/18071461303276273664"
            ],
            "elevated": "false",
            "exclude-global-prep-cmd": "false",
            "image-path": "/home/jarret/.config/sunshine/covers/igdb_1877.png",
            "name": "Cyberpunk 2077",
            "output": ""
        }
    ],
    "env": {
        "PATH": "$(PATH):$(HOME)/.local/bin"
    }
}

[16:21:05.483] DEBUG    buddy.os: skipping entry as it's not an object: QJsonValue(array, QJsonArray([{"name":"Low Res Desktop","prep-cmd":[{"do":"xrandr --output HDMI-1 --mode 1920x1080","undo":"xrandr --output HDMI-1 --mode 1920x1200"}]},{"detached":["setsid steam steam://open/bigpicture"],"image-path":"./assets/steam.png","name":"Steam BigPicture","output":"steam.txt"},{"cmd":"/home/jarret/Applications/MoonDeckBuddy-1.5.4-x86_64_2abe97eb09bb04384c60528dee861c72.AppImage --exec MoonDeckStream","elevated":"false","exclude-global-prep-cmd":"false","image-path":"","name":"MoonDeckStream","output":""},{"cmd":"","detached":["setsid steam steam://rungameid/18071461303276273664"],"elevated":"false","exclude-global-prep-cmd":"false","image-path":"/home/jarret/.config/sunshine/covers/igdb_1877.png","name":"Cyberpunk 2077","output":""}]))
[16:21:05.484] DEBUG    buddy.os: parsed the following Sunshine apps: QSet()
[16:21:05.484] DEBUG    buddy.main: 
Request: QHttpServerRequest((Url: QUrl("https://192.168.0.42:59999/gamestreamAppNames"))(Headers: ("Host": "192.168.0.42:59999"), ("authorization": "basic <REDACTED>"), ("Accept": "*/*"), ("Accept-Encoding": "gzip, deflate"), ("User-Agent": "Python/3.10 aiohttp/3.8.1"))(RemoteHost: QHostAddress("::ffff:192.168.0.55"))(BodySize: 0)) | "" 
Response: QHttpServerResponder::StatusCode::Ok | "{\"appNames\":[]}"
moontaincow commented 1 year ago

So it looks like it's not iterating over the apps array properly.

FrogTheFrog commented 1 year ago

Yup, but I have no idea why... I will switch to my linux setup and try replicating it further

FrogTheFrog commented 1 year ago

@moontaincow Please try binaries from this build: https://github.com/FrogTheFrog/moondeck-buddy/actions/runs/5912371903?pr=55

I think it might be compiler-related issue.

moontaincow commented 1 year ago

Yep that was it. Thanks :)