Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    rajeshwaruniversum
    @rajeshwaruniversum
    that make sence
    I took master branch
    but how to add a close method to my adapter
     Faraday::Connection.new(url: url) do |faraday|
          faraday.request  :url_encoded
          faraday.response :logger
          faraday.adapter  Faraday.default_adapter
        end
    Matt
    @iMacTia
    You’ll have to monkey patch the adapter and implement the method. If you’ve never monkey-patched, this is a good start: https://www.justinweiss.com/articles/3-ways-to-monkey-patch-without-making-a-mess/
    The aim is to add the method close to whichever adapter you’re using (default is Net::HTTP) and in that method, close the connection
    rajeshwaruniversum
    @rajeshwaruniversum
    Thanks will have look on this
    Rachel Lanman
    @RSR312-206
    does anyone know of a good way to test the retry option? Is there a way to see if an endpoint ends up being retried, and how many times?
    Matt
    @iMacTia
    Depending on how you configured it (under which circumstances it should retry) then it might be easier or not. If we’re talking about unit tests then webmock is probably your best shot :)
    Rachel Lanman
    @RSR312-206
    @iMacTia it was just to see if it was working - not in a unit test. I see there is a retry_block which I was thinking I could write the env.status to a tmp file. Mainly just trying to get some feedback that it's working.
    Matt
    @iMacTia
    Oh I see what you mean now! Yes that’s a good way to spot when requests have been retried :). You could also add the logger middleware to your stack, AFTER the retry middleware, to see multiple logs of the same request
    Rachel Lanman
    @RSR312-206
    is the logger middleware available on version 0.12.2?
    because retry_block is not
    Matt
    @iMacTia
    Ah right, the latter it was introduced later.
    Yes, logger middleware has been around for years
    So pretty sure it’s available
    Rachel Lanman
    @RSR312-206
    cool - thank you
    side note, I can't upgrade faraday because omniauth-stripe-connect has a dependency which requires a version of Faraday less than 0.13.
    which is really annoying
    Matt
    @iMacTia
    Interesting, not sure why they’d put such a limitation...
    Rachel Lanman
    @RSR312-206
    yeah I haven't had time to dig into why
    joznt
    @joznt
    Hello guys, someone can enlighten me in one problem?, I'm trying to use Faraday to interact with a API from one of our company, the problem is, the API URL is "http://server/selled?startDate=2020-01-01T00:00:00-03:00&endDate=2020-01-01T23:59:59-03:00&categoryID=9878&sellerID=4645" and I'm having trouble when the URL is encoded
    Matheus Santana
    @embs

    @embs sorry I missed your message! I’m trying to reproduce that issue on my Mac but I see a normal Faraday::ConnectionFailed exception being raised. Could you provide some additional information about your OS and if there’s something listening to that port?

    @iMacTia no problem. Thanks for your help! I was able to investigate this further and could reliably reproduce it when running on Docker.

    The problem seems to have been fixed in v1.

    If we build two docker images, say faraday-get-localhost:0.17.3 with a Dockerfile such as

    FROM ruby:2.5.3-slim
    
    RUN gem install faraday -v 0.17.3
    
    CMD ruby -e "require 'faraday'; p Faraday::VERSION; Faraday.get('http://localhost:9875')"

    and another image for v1:

    FROM ruby:2.5.3-slim
    
    RUN gem install faraday
    
    CMD ruby -e "require 'faraday'; p Faraday::VERSION; Faraday.get('http://localhost:9875')"

    Then when we run 0.17.3 we get an EADDRNOTAVAIL:

    $ docker run faraday-get-localhost:0.17.3
    "0.17.3"
    /usr/local/lib/ruby/2.5.0/net/http.rb:939:in `rescue in block in connect': Failed to open TCP connection to localhost:9875 (Cannot assign requested address - connect(2) for "localhost" port 9875) (Errno::EADDRNOTAVAIL)
            from /usr/local/lib/ruby/2.5.0/net/http.rb:936:in `block in connect'
            from /usr/local/lib/ruby/2.5.0/timeout.rb:93:in `block in timeout'
            from /usr/local/lib/ruby/2.5.0/timeout.rb:103:in `timeout'
            from /usr/local/lib/ruby/2.5.0/net/http.rb:935:in `connect'
            from /usr/local/lib/ruby/2.5.0/net/http.rb:920:in `do_start'
            from /usr/local/lib/ruby/2.5.0/net/http.rb:909:in `start'
            from /usr/local/lib/ruby/2.5.0/net/http.rb:1455:in `request'
            from /usr/local/lib/ruby/2.5.0/net/http.rb:1213:in `get'
            from /usr/local/bundle/gems/faraday-0.17.3/lib/faraday/adapter/net_http.rb:85:in `perform_request'                                                                                    
            from /usr/local/bundle/gems/faraday-0.17.3/lib/faraday/adapter/net_http.rb:43:in `block in call'                                                                                      
            from /usr/local/bundle/gems/faraday-0.17.3/lib/faraday/adapter/net_http.rb:92:in `with_net_http_connection'                                                                           
            from /usr/local/bundle/gems/faraday-0.17.3/lib/faraday/adapter/net_http.rb:38:in `call'
            from /usr/local/bundle/gems/faraday-0.17.3/lib/faraday/request/url_encoded.rb:15:in `call'                                                                                            
            from /usr/local/bundle/gems/faraday-0.17.3/lib/faraday/rack_builder.rb:143:in `build_response'                                                                                        
            from /usr/local/bundle/gems/faraday-0.17.3/lib/faraday/connection.rb:387:in `run_request'                                                                                             
            from /usr/local/bundle/gems/faraday-0.17.3/lib/faraday/connection.rb:138:in `get'
            from /usr/local/bundle/gems/faraday-0.17.3/lib/faraday.rb:102:in `method_missing'
            from -e:1:in `<main>'

    But when running v1 we get a proper Faraday::ConnectionFailed:

    $ docker run faraday-get-localhost:1.0
    "1.0.0"
    /usr/local/lib/ruby/2.5.0/net/http.rb:939:in `rescue in block in connect': Failed to open TCP connection to localhost:9875 (Cannot assign requested address - connect(2) for "localhost" port 9875) (Faraday::ConnectionFailed)
            from /usr/local/lib/ruby/2.5.0/net/http.rb:936:in `block in connect'
            from /usr/local/lib/ruby/2.5.0/timeout.rb:93:in `block in timeout'
            from /usr/local/lib/ruby/2.5.0/timeout.rb:103:in `timeout'
            from /usr/local/lib/ruby/2.5.0/net/http.rb:935:in `connect'
            from /usr/local/lib/ruby/2.5.0/net/http.rb:920:in `do_start'
            from /usr/local/lib/ruby/2.5.0/net/http.rb:909:in `start'
            from /usr/local/lib/ruby/2.5.0/net/http.rb:1455:in `request'
            from /usr/local/lib/ruby/2.5.0/net/http.rb:1
    Matheus Santana
    @embs
    Additional info:
    • Docker version 19.03.5, build 633a0ea838
    • Host OS: Debian 10
    • Linux kernel: 4.19.0-6-amd64
    • Nothing listening on the tested port (neither in the host nor in the container)
    Matt
    @iMacTia
    Thanks for the follow-up @embs. This is really useful because it means we somehow fixed it in 1.0, but there are so many differences that it won’t be an easy search 😓
    Matheus Santana
    @embs
    @iMacTia will the 0.Y.Z releases continue to receive bugfixes or is anyone willing to get new bugfixes required to upgrade to 1.0? In other words, is it desirable to have this fix "backported" to 0.Y.Z releases?
    Matheus Santana
    @embs
    This might be the missing bit: lostisland/faraday@148b99e
    Matt
    @iMacTia
    We definitely don’t want to release a 0.18 version, but security and bug fixes can still be released for 0.17
    Thanks for having a look and identifying the possible fix. Feel free to open a PR or I’ll have a look as soon as I can
    As far as the change is backwards compatible, we can definitely back port it as a bugfix
    Matt
    @iMacTia
    @joznt could you please open an issue in GitHub with additional details?
    Matheus Santana
    @embs
    @iMacTia what's the branch such a PR should target? 0.1x?
    Matt
    @iMacTia
    @embs correct!
    Corentin
    @Frenchcooc
    Hi! I'm totally new here. Really don't want to bother. I'm a developer advocate at Bearer.sh. I'm wondering if the "Faraday Team" is open to sponsorship? And if so, who would be the best person to talk to? Thanks 🙏
    Matt
    @iMacTia
    Hi @Frenchcooc, I’ll raise this with the rest of the core team and get back to you. We’re aware GitHub has recently launched a “donations” feature but we haven’t discussed about it yet
    What we definitely don’t want to do is to have a “PRO” version of Faraday or different support levels. Faraday fully embraces the OSS principles and will never make distinctions between developers
    Corentin
    @Frenchcooc
    Thanks @iMacTia! Definitely not looking into adding "PRO" version here. More about supporting the project and adding logo/link to the sponsor website. Let me know
    Srikanth Tanneeru
    @stanneeru
    Faraday::ConnectionFailed (execution expired)
    I am having this issue
    Matheus Santana
    @embs
    Hello @stanneeru. What is the address you're trying to access? I think this error may be thrown when the address is unavailable.
    KazeEnji
    @KazeEnji
    hello everyone. i'm trying to get faraday running for the first time on a Kali 2020.1 VM and it won't let me login. I tried changing the password when it ran and it said the information was incorrect. I then also tried changing the password using faraday-manage change-password and it still won't let me log in. Any idea what I might be doing wrong?
    KazeEnji
    @KazeEnji
    hello everyone. i'm trying to get faraday running for the first time on a Kali 2020.1 VM and it won't let me login. I tried changing the password when it ran and it said the information was incorrect. I then also tried changing the password using faraday-manage change-password and it still won't let me log in. Any idea what I might be doing wrong?
    KazeEnji
    @KazeEnji
    is anyone online who can help?
    Matheus Santana
    @embs

    Hey there @KazeEnji.

    I was unable to understand your question, sorry. I'm not aware of any faraday-manage command regarding the Ruby Faraday library.

    A search quick for "faraday-manage" led me to https://github.com/infobyte/faraday, which is not the project related to this chat. This Gitter relates to https://github.com/lostisland/faraday/

    Maybe you're in the wrong chat?

    KazeEnji
    @KazeEnji
    Hey @embs Thanks for getting back to me. Is this not the faraday chat for the Faraday IPE built into Kali? I got into this chat from the Faraday website...
    KazeEnji
    @KazeEnji
    my apologies then @embs et all. I don't know how i got into the wrong chat from the faraday website haha.
    Matheus Santana
    @embs
    Hahahah. No worries @KazeEnji. Nice to meet you. :)
    André Diego Piske
    @andrepiske
    hello everyone! I saw latest Faraday drops jruby and rubinius support. Why is that? Is it lack of maintainers, or maybe a design decision? -- just asking, not demanding anything here at all :)
    I searched github issues and couldn't find anything for the reason
    Matt
    @iMacTia
    Hi @andrepiske, totally legit question! The main issue for us was that more and more JRuby/Rubinius tests and dependencies were quickly failing, especially after running updates across the line for the Faraday v1.0 release. We had some great contributors over time that introduced JRuby support, but none of them settled as a maintainer, and so keeping support for other rubies was becoming a huge burden on the core team.
    This doesn’t mean Faraday doesn’t work with them, or that we don’t want their support in the code anymore.
    It simply means we can’t afford to officially support them, mainly for lack of knowledge.
    We do however welcome maintainers (not contributors, hence on a regular basis) that would like to help us reintroducing and supporting these rubies