Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

variabes being changed from snake_case to camelCase #3754

Open
lenisko opened this issue Apr 30, 2023 · 9 comments
Open

variabes being changed from snake_case to camelCase #3754

lenisko opened this issue Apr 30, 2023 · 9 comments

Comments

@lenisko
Copy link

lenisko commented Apr 30, 2023

Expected behaviour:

Pushover with variables should send message.

Actual behaviour:

Pushover is not sending messages when variables are used. When variables are replaced by strings, it works.

EDIT

#3754 (comment) Found issue

Config:

web_server:
  bind: 0.0.0.0
  port: 5050
  web_ui: yes

variables: yes

schedules:
  - tasks: 'series-anime-automatic'
    interval:
      minutes: 30

tasks:
  series-anime-automatic:
    rss: "https://nyaa.si/?page=rss&u=subsplease"
    quality: 1080p
    template: anilist_series
    notify:
      entries:
        title: Anime(A) {{series_name}} - {{series_id}}
        via:
          - pushover:
              user_key: "{? pushover.userKey ?}"
              api_key: "{? pushover.apiKey ?}"
              priority: -1

templates:
  anilist_series:
    template: anime_series
    configure_series:
      settings:
        identified_by: sequence
      from:
        anilist:
          username: "{? anilist.username ?}"
          status: current
          release_status:
            - releasing
            - not_yet_released
          format:
            - tv
            - tv_short

  anime_series:
    transmission:
      host: "{? transmission.hostname ?}"
      port: 9091
      username: "{? transmission.username ?}"
      password: "{? transmission.password ?}"
      path: "/leech/anime/series/{{series_name|replace(':', '')}}"
      add_paused: no

Variables:

anilist:
  username: xxx
pushover:
  apiKey: xxx
  userKey: xxx
transmission:
  hostname: xxx
  password: xxx
  username: xxx

Log:

(click to expand)
2023-04-28 00:44:36 WARNING notify series -anime Error while sending notification to `pushover`: application token is invalid
2023-04-28 00:44:31 WARNING notify series -anime Error while sending notification to `pushover`: application token is invalid
2023-04-28 00:44:26 WARNING notify series -anime Error while sending notification to `pushover`: application token is invalid
2023-04-28 00:44:21 WARNING notify series -anime Error while sending notification to `pushover`: application token is invalid

Additional information:

  • FlexGet version: 3.6.4
  • Python version: 3.9
  • Installation method: Docker wiserain/flexget
  • Using daemon (yes/no): yes
  • OS and version: DSM 7.1.1-42962 Update 5
@ksurl
Copy link
Contributor

ksurl commented May 3, 2023

I'm on the latest and pushover works with variables. Can you try adding quotes in the variables file for pushover? Also try renaming the variable.

Not sure if it matters but I also have variables set to variables: variables.yml

Side note, what is your docker compose file? The official image has come a long way in the past couple years so it may suit your needs.

@gazpachoking
Copy link
Member

You should be able to run flexget --test execute --tasks series-anime-automatic --dump-config to see what the config for the task ends up looking like after variable replacement. Maybe that helps debug.

@lenisko
Copy link
Author

lenisko commented May 3, 2023

Thanks for hints. I'm using database storage.

Here's what I noticed:

Variables in WebUI

anilist:
  username: xxx
pushover:
  apikey: xxx
  userkey: xxx
transmission:
  hostname: xxx
  password: xxx
  username: xxx

In database

{"pushover": {"api_key": "xxx", "user_key": "xxx"}, "transmission": {"hostname": "xxx", "password": "xxx", "username": "xxx"}, "anilist": {"username": "xxx"}}

Looks like the keys are auto translated from camelCase to snake_case. Switched to snake_case in yml for now and I'll report later!

@BrutuZ
Copy link
Contributor

BrutuZ commented May 3, 2023

Random bit of information in case there's more to the config: Variables \ Secrets are not expanded in include files

@lenisko
Copy link
Author

lenisko commented May 6, 2023

After swapping variable names to something without _ I have no issue.

Looks like WebUI or Flexget is converting variable names from camelCase to snake_case on the fly, and not doing it again db select is called.

@gazpachoking
Copy link
Member

Hmm. Nothing should be transforming the variable names, we should look into that an fix.

@github-actions
Copy link

github-actions bot commented Oct 7, 2023

This issue is stale because it has been open 150 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Oct 7, 2023
@lenisko
Copy link
Author

lenisko commented Oct 7, 2023

bump

@github-actions github-actions bot removed the Stale label Oct 7, 2023
Copy link

github-actions bot commented Mar 5, 2024

This issue is stale because it has been open 150 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Mar 5, 2024
@gazpachoking gazpachoking removed the Stale label Mar 6, 2024
@gazpachoking gazpachoking changed the title Pushover ignoring variables variabes being changed from snake_case to camelCase Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants