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

🚫 ope: filterWrapper is not iterable #948

Closed
1 of 3 tasks
Kinuseka opened this issue Jun 23, 2023 · 25 comments · Fixed by #959
Closed
1 of 3 tasks

🚫 ope: filterWrapper is not iterable #948

Kinuseka opened this issue Jun 23, 2023 · 25 comments · Fixed by #959
Labels
bug Something isn't working support

Comments

@Kinuseka
Copy link

What's happening?
Concisely describe what's going wrong.

Logs

logs seems to be not found on console

Additional context
This error occurs randomly while using /play
Confirmed that this is not a user error seems to be the server side.

Runtime
I'm running Muse:

  • Directly from the cloned repository
  • Inside a Docker container
  • Something else (please elaborate)

Versions

  • Muse: 2.3.0
  • Docker (if applicable):
  • OS: Ubuntu v20.04
  • Node.js: v16.20.0
  • ffmpeg: 4.2.7-0ubuntu0.1
@codetheweb
Copy link
Collaborator

Did you try running with DEBUG=* to see if more error details are logged?

@Kinuseka
Copy link
Author

Gotcha

 prisma:client:libraryEngine  sending request, this.libraryStarted: true +1s
  muse Cache miss: ["tokyo rain marcus warner",{"limit":10}] +4s
  muse /home/user/muse/node_modules/ytsr/lib/utils.js:23
  muse   for (const filterGroup of filterWrapper) {
  muse                             ^
  muse
  muse TypeError: filterWrapper is not iterable
  muse     at Object.exports.parseFilters (/home/user/muse/node_modules/ytsr/lib/utils.js:23:29)
  muse     at module.exports (/home/user/muse/node_modules/ytsr/lib/main.js:60:24)
  muse     at runMicrotasks (<anonymous>)
  muse     at processTicksAndRejections (node:internal/process/task_queues:96:5)
  muse     at KeyValueCacheProvider.wrap (/home/user/muse/src/services/key-value-cache.ts:53:20)
  muse     at run (/home/user/muse/node_modules/p-queue/dist/null:109:36) +2s

This is the error I caught, the error is pretty inconsistent sometimes it works and sometimes it doesnt. Hopefully we can make this solve this inconsistency

@codetheweb
Copy link
Collaborator

Looks like this is a bug with the ytsr package: TimeForANinja/node-ytsr#180

@codetheweb codetheweb added the bug Something isn't working label Jul 8, 2023
@fractalcounty
Copy link

Getting an identical error using the latest release through Docker on a fresh install of Ubuntu 22.04. Tried installing a few months ago on a completely different machine through the basic Node.js install route and got the same error. Is there a known fix I'm missing?

  prisma:client:libraryEngine  sending request, this.libraryStarted: true +154ms
  muse Cache miss: ["fart sounds",{"limit":10}] +10s
  muse /usr/app/node_modules/ytsr/lib/utils.js:23
  muse   for (const filterGroup of filterWrapper) {
  muse                             ^
  muse
  muse TypeError: filterWrapper is not iterable
  muse     at Object.exports.parseFilters (/usr/app/node_modules/ytsr/lib/utils.js:23:29)
  muse     at module.exports (/usr/app/node_modules/ytsr/lib/main.js:60:24)
  muse     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  muse     at KeyValueCacheProvider.wrap (/usr/app/src/services/key-value-cache.ts:53:20)
  muse     at run (/usr/app/node_modules/p-queue/dist/null:109:36) +676ms

@JosephBerman
Copy link

JosephBerman commented Jul 23, 2023

I am also getting this same error while using docker on latest release

@hemantgogia09
Copy link

+1 happening to me as well using latest docker build

@LeonardoLeoo89
Copy link

happening to me as well, latest docker release

@Frobby01
Copy link

+1

1 similar comment
@cunhar
Copy link

cunhar commented Jul 25, 2023

+1

@MathiasDevelopes
Copy link

+1 latest docker

@Avapaa
Copy link

Avapaa commented Jul 28, 2023

Same issue, downgraded to codetheweb/muse:2.2.4 for now...

@Bones3951
Copy link

+1 experiencing this issue, latest version and 2.2.4 as well

@drpepper66
Copy link

this issue used to be sporadic, but after a while of running the bot, it occurs on literally every play command (no matter if the input is a search query, spotify or youtube url), rendering the bot entirely unusuable. I would suggest that node-ytsr is forked. in the meantime, I applied the ytsr fix in my docker-compose setup like so in order to avoid building my own image:


  muse:
    image: codetheweb/muse:2.4.1
    restart: always
    volumes:
      - ./muse:/data
    entrypoint: bash
    # hotfix for https://github.com/codetheweb/muse/issues/948
    command: -c "sed -i 's/of filterWrapper[)]/of filterWrapper|| [])/g' /usr/app/node_modules/ytsr/lib/utils.js && tini -- yarn start"

@lilkingjr1
Copy link

@drpepper66 This worked for me! Thank you!

P.S. Could the sporadic nature be due to Muse's caching? I know nothing about this project yet, so sorry if this is a dumb question.

@SeiRann
Copy link

SeiRann commented Aug 1, 2023

how do you do that but with node?

@Bones3951
Copy link

how do you do that but with node?

  1. Stop the bot
  2. Go into your bot's folder and then run that command:

sed -i 's/of filterWrapper[)]/of filterWrapper|| [])/g' /node_modules/ytsr/lib/utils.js

  1. Restart the bot, npm run start.

@codetheweb
Copy link
Collaborator

I don't have the time right now, but if anyone else is interested in fixing this I think we could completely drop the node-ytsr dependency and query for tracks using Google's official API since we have an YOUTUBE_API_KEY anyways.

@MrManiacc
Copy link

MrManiacc commented Aug 8, 2023

As per this this github issue, to fix all you have to do is edit node_modules\ytsr\lib\utils.js. Change line 21 as follows

before
const filterWrapper = (wrapper.subMenu || wrapper.submenu).searchSubMenuRenderer.groups;

after
const filterWrapper = (wrapper.subMenu || wrapper.submenu).searchSubMenuRenderer.groups || [];

@Kinuseka
Copy link
Author

Kinuseka commented Aug 8, 2023

I don't have the time right now, but if anyone else is interested in fixing this I think we could completely drop the node-ytsr dependency and query for tracks using Google's official API since we have an YOUTUBE_API_KEY anyways.

since the API is pretty limited, I believe we can use the API as a failure fallback while keeping ytsr as the main search engine.

@jedichrome
Copy link

Just installed this -- same error. Using the latest docker. =/

@EugeneLeclerc
Copy link
Contributor

Looks like the problem was fixed on TimeForANinja/node-ytsr#203

@github-actions
Copy link

🚀 Released in Release v2.4.2.

@cRaZy92
Copy link

cRaZy92 commented Aug 13, 2023

Running the bot for the first time using docker image (latest 2.4.2 version) and I have the same problem. :(

@EugeneLeclerc
Copy link
Contributor

Running the bot for the first time using docker image (latest 2.4.2 version) and I have the same problem. :(

@cRaZy92 do you have any logs? 2.4.2 completely solved the issue for me.

@cRaZy92
Copy link

cRaZy92 commented Aug 13, 2023

@cRaZy92 do you have any logs? 2.4.2 completely solved the issue for me.

Never mind, it only happened with one specific track on Spotify, sorry for the false alarm. Thank you anyways!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working support
Projects
None yet
Development

Successfully merging a pull request may close this issue.