Skip to content

Error on proxyAutoconfigUrl set to null #490

Closed

Description

@juangj

Firefox Version

52.0 beta 8

Platform

I'm using Linux, but it probably happens on all of them

Steps to reproduce -

./geckodriver-0.14.0 -b firefox52b8/firefox

curl -d '{"desiredCapabilities": {"proxy": {"proxyAutoconfigUrl": null}}, "requiredCapabilities": {}}' http://localhost:4444/session

Firefox starts up correctly and Marionette appears to handle this just fine, but Geckodriver returns an error:

{
"error":"session not created",
"message":"Expected [object String] \"proxyType\" in [object Object] {\"proxyAutoconfigUrl\":null}",
"stacktrace":"stack backtrace:
   0:           0x4e0eed - backtrace::backtrace::trace::had1fe133e10f4f84
   1:           0x4e13b2 - backtrace::capture::Backtrace::new::hea6d366cd875d5b7
   2:           0x43dc86 - geckodriver::marionette::MarionetteSession::response::h65e4938ffab7411a
   3:           0x43b542 - <geckodriver::marionette::MarionetteHandler as webdriver::server::WebDriverHandler<geckodriver::marionette::GeckoExtensionRoute>>::handle_command::h847e3041a2edbf86
   4:           0x4098ff - std::panicking::try::do_call::h3c184502ab82dbaa
   5:           0x5801da - panic_unwind::__rust_maybe_catch_panic
                        at /buildslave/rust-buildbot/slave/stable-dist-rustc-musl-linux/build/obj/../src/libpanic_unwind/lib.rs:97
   6:           0x41c9e4 - <F as alloc::boxed::FnBox<A>>::call_box::h1e0e39839fbedd5b
   7:           0x576944 - alloc::boxed::{{impl}}::call_once<(),()>
                        at /buildslave/rust-buildbot/slave/stable-dist-rustc-musl-linux/build/obj/../src/liballoc/boxed.rs:605
                         - std::sys_common::thread::start_thread
                        at /buildslave/rust-buildbot/slave/stable-dist-rustc-musl-linux/build/obj/../src/libstd/sys_common/thread.rs:21
                         - std::sys::imp::thread::{{impl}}::new::thread_start
                        at /buildslave/rust-buildbot/slave/stable-dist-rustc-musl-linux/build/obj/../src/libstd/sys/unix/thread.rs:84"
}

This error does not occur on Firefox 51.0.1.

Activity

  1. andreastt commented on Feb 22, 2017

    @andreastt
    Contributor

    According to the specification it should be a string type.

  2. juangj commented on Feb 22, 2017

    @juangj
    ContributorAuthor

    It still seems wrong to launch Firefox and then return the error, doesn't it? Also, the other string capabilities in the "proxy" object don't cause this (e.g., "httpProxy").

    If you're insistent that this is OK behavior, then I can take this over to Selenium and make sure language bindings never pass null, as they seem to sometimes do now.

  3. andreastt commented on Feb 22, 2017

    @andreastt
    Contributor

    We currently do capabilities parsing in Firefox itself, because that is where Marionette lives. We expect this to move to geckodriver soon-ish, so that Firefox is not started if the capabilities passed are invalid.

    When I implemented capabilities parsing in Marionette, I tried to follow the specification as it were at the time with regards to parsing proxy settings. It seems to have improved somewhat since then, but it still says proxyAutoconfigUrl should be a string type. Other properties we get from JSON Objects that are null or undefined are ignored, so I do feel that the proxy configuration object as described in the spec right now are slightly out of sync with what we do elsewhere.

    In my opinion, we should ignore all properties which values are null or undefined, so I will look into whether we need to raise a spec bug on this.

  4. changed the title [-]Geckodriver error when proxyAutoconfigUrl capability is null[/-] [+]Error on proxyAutoconfigUrl set to null[/+] on Feb 28, 2017
  5. thibaut-sticky commented on Feb 28, 2017

    @thibaut-sticky

    Waiting for a fix or clarification of the spec, do you see any workaround about this?

  6. andreastt commented on Feb 28, 2017

    @andreastt
    Contributor

    The “workaround” is to not define the fields holding null values. E.g. {proxyAutoconfigUrl: null} → {}.

  7. thibaut-sticky commented on Mar 1, 2017

    @thibaut-sticky

    Too bad, it does not help.

    11:10:27.751 WARN - Exception: java.util.HashMap cannot be cast to java.lang.String
    11:10:27.766 INFO - Executing: [new session: Capabilities [{proxy={proxyAutoconfigUrl={}, httpProxy=192.168.0.23, sslProxyPort=65497, proxyType=MANUAL, httpProxyPort=65497, sslProxy=192.168.0.23}, marionette=true, browserName=firefox, version=, platform=ANY, firefox_profile=UEsDBBQACAgIAE1ZYUoAAAAAAAAAA...}]])
    
  8. andreastt commented on Mar 1, 2017

    @andreastt
    Contributor

    Well proxyAutoconfigUrl should certainly not be an object: proxy={proxyAutoconfigUrl={}

  9. thibaut-sticky commented on Mar 1, 2017

    @thibaut-sticky

    Hum, sorry I read too quickly your previous message.

  10. andreastt commented on Mar 1, 2017

    @andreastt
    Contributor

    The point is that proxyAutoconfigUrl needs to be either a string or undefined (missing) currently.

  11. 5 remaining items

  12. alessandro-aglietti commented on May 30, 2017

    @alessandro-aglietti

    geckodriver wants lowercase proxyType so, intead of MANUAL, send manual ;)

  13. whimboo commented on Aug 3, 2017

    @whimboo
    Collaborator

    @andreastt, I had another look at this and actually we have different issues here with the originally filed code:

    1. The failure @juangj gets is not because proxyAutoconfigUrl is null, but there is no entry for proxyType in the capabilities. As such Marionette bails out. Shouldn't this be a required property when defining proxy settings? I would suggest to raise a better message when it is missing.

    2. With proxyType set to pac we indeed get a failure in checking the type of proxyAutoconfigUrl. This also happens for any other kind of proxy. Here proxyAutoconfigUrl should only be checked if proxyType is set to pac but not otherwise. So this property should be optional. I cannot see that we mark it that way in the spec. Should we update that?

    3. With both 1) and 2) fixed Marionette returns a valid session, but webdriver-rust fails now in extracting the data.

    I would like to fix all the issues in https://bugzilla.mozilla.org/show_bug.cgi?id=1370959, but would need some feedback first from @andreastt to the above issues.

  14. andreastt commented on Aug 3, 2017

    @andreastt
    Contributor
  15. whimboo commented on Aug 16, 2017

    @whimboo
    Collaborator
        desiredCapabilities.proxy = {proxyType: 'direct'};
    

    @eyal919, this is a different issue and doesn't fit into here. But anyway I will let you know that I fixed that recently via bug 1387092. It will need a new geckodriver release, and Firefox 57.0.

        desiredCapabilities.proxy = {
        proxyType: "manual",
        httpProxy: proxyUrl,
        sslProxy: proxyUrl
        };
    

    I'm currently refactoring all the code around manual proxy settings right now on bug 1369827. It will have the same target as the issue above.

    Regarding the original issue here, my patch on bug 1391016 should improve the failure message. But we still need bug 1370959 fixed which moves all checks over to geckodriver.

  16. whimboo commented on Sep 1, 2017

    @whimboo
    Collaborator

    Please note that everything except the noProxy capability as has been discussed here is available now in Firefox 57.0 Nightly. To actually use it with geckodriver you will have to wait for the next release, or build it from source on your own.

    If you still see problems please file a new issue. Thanks.

    I will only keep this issue open to really fix the original issue as reported by @juangj. As it looks like by using curl directly we bypass the validate_proxy checks.

  17. andreastt commented on Sep 1, 2017

    @andreastt
    Contributor

    As it looks like by using curl directly we bypass the validate_proxy checks.

    What do you mean by this? An HTTP request is an HTTP request.

  18. andreastt commented on Sep 1, 2017

    @andreastt
    Contributor

    Note that the capabilities JSON Object used in the curl request is now incorrect, however. It should be updated to use the WebDriver conforming capabilities negotiation.

    I think this is correct, but I haven’t tested it:

    curl -d '{"capabilities": {"alwaysMatch": {"proxy": {"proxyAutoconfigUrl": null}}}' http://localhost:4444/session
    
  19. whimboo commented on Sep 5, 2017

    @whimboo
    Collaborator

    There was a missing closing bracket in your last example but it clearly did it:

    curl -d '{"capabilities": {"alwaysMatch": {"proxy": {"proxyAutoconfigUrl": null}}}}' http://localhost:4444/session

    results in

    {"value":{"error":"invalid argument","message":"proxyAutoconfigUrl was not a string",...

    Something suspicious I still noticed is that if you specify an invalid capability object your are not always getting an exception. I filed bug 1396883 for that.

    Otherwise I'm going to close this issue now. It's all fixed.

  20. lock commented on Aug 17, 2019

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you have run into an issue you think is related, please open a new issue.

  21. locked and limited conversation to collaborators on Aug 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    ⌂ 换网址