maz
Using erlports and jaxon to grab youtube metadata via python -- handle_info/2 FunctionClauseError
With the genserver code I’m calling a python script. The script returns back asynchronously a large json blob to stdout.
What’s not clear to me is why there an error after the successful call to handle_info, ** (FunctionClauseError) no function clause matching in GrabAdapter.handle_info/2
Any insight into this? Is there a better way to do this than ports? I’ve noticed that if the JSON returned is ever malformed, The GenServer crashes and never comes back (“BROKEN PIPE”)
iex(2)> GrabAdapter.start_link("https://www.youtube.com/watch?v=ABuNwLP-z9o")
{:ok, #PID<0.518.0>}
Received message from port: {"id": "ABuNwLP-z9o", "uploader": "Phan Trieu", "uploader_id": "trieuphan1", "uploader_url": "http://www.youtube.com/user/trieuphan1", "channel_id": "UCG0SzK_t4-Ylf1yZq9Xmi_g", "channel_ur...
...wed ! Gaming Music | The Best of All Time | 2020", "_filename": "\ud83d\udd25 Top 50 NoCopyRightSounds _ Best of NCS _ Most viewed ! Gaming Music _ The Best of All Time _ 2020-ABuNwLP-z9o.mp4"}
title: 🔥 Top 50 NoCopyRightSounds | Best of NCS | Most viewed ! Gaming Music | The Best of All Time | 2020
iex(3)> [error] GenServer #PID<0.518.0> terminating
** (FunctionClauseError) no function clause matching in GrabAdapter.handle_info/2
(grabber 0.1.0) lib/grab_adapter.ex:29: GrabAdapter.handle_info({#Port<0.19>, {:exit_status, 0}}, %{port: #Port<0.19>, ytchannel: "https://www.youtube.com/watch?v=ABuNwLP-z9o"})
(stdlib 3.11) gen_server.erl:637: :gen_server.try_dispatch/4
(stdlib 3.11) gen_server.erl:711: :gen_server.handle_msg/6
(stdlib 3.11) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: {#Port<0.19>, {:exit_status, 0}}
State: %{port: #Port<0.19>, ytchannel: "https://www.youtube.com/watch?v=ABuNwLP-z9o"}
** (EXIT from #PID<0.515.0>) shell process exited with reason: an exception was raised:
** (FunctionClauseError) no function clause matching in GrabAdapter.handle_info/2
(grabber 0.1.0) lib/grab_adapter.ex:29: GrabAdapter.handle_info({#Port<0.19>, {:exit_status, 0}}, %{port: #Port<0.19>, ytchannel: "https://www.youtube.com/watch?v=ABuNwLP-z9o"})
(stdlib 3.11) gen_server.erl:637: :gen_server.try_dispatch/4
(stdlib 3.11) gen_server.erl:711: :gen_server.handle_msg/6
(stdlib 3.11) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Marked As Solved
Popular in Questions
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2733ms. You can configure how long re...
New
Hello everyone,
I try to use an Javascript Event Handler in my root.html.leex file.
Therefore I created a function in the app.js file: ...
New
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
After calling mix ecto.create I get this error:
17:00:32.162 [error] GenServer #PID<0.412.0> terminating
** (Postgrex.Error) FATAL...
New
Hello, I have map which I want to convert it to string like this:
the map:
%{last_name: "tavakkoli", name: "shahryar"}
the string I ne...
New
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this
"1000"
What is the ...
New
How to handle excepions in elixir?
Suppose i have A, B, C ,D, E modules. and each module has get() function.
A.get() method will call t...
New
Other popular topics
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors:
[WARN] - (starship::utils): Executing command ...
New
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum.
...
New
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!)
This post collects co...
New
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








