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

Figure out way to improve stack trace when fails to connect to Chromedriver #6

Open
paulcsmith opened this issue Apr 16, 2018 · 4 comments

Comments

@paulcsmith
Copy link
Member

Right now there are lots of loops so the stacktrace is huge. Maybe using a while would shorten that up

@hanneskaeufler
Copy link
Contributor

hanneskaeufler commented Jun 24, 2018

Is that starting with a

[1529857725.524][SEVERE]: bind() returned an error, errno=48: Address already in use (48) for you as well?

(Almost full stacktrace, omitted the hundreds of repetitions):

``` .................................................[1529857725.524][SEVERE]: bind() returned an error, errno=48: Address already in use (48) E

Failures:

  1. Publishing a post results in a post on the frontpage

    Expected to find element on page, but it was not found.

    ▸ looking for: [name='post:title']
    

    lib/lucky_flow/src/lucky_flow/find_element.cr:48:5 in 'raise_element_not_found_error'
    lib/lucky_flow/src/lucky_flow/find_element.cr:22:7 in 'retry'
    lib/lucky_flow/src/lucky_flow/find_element.cr:14:33 in 'run'
    lib/lucky_flow/src/lucky_flow/find_element.cr:32:5 in 'retry_after_delay'
    lib/lucky_flow/src/lucky_flow/find_element.cr:20:7 in 'retry'
    lib/lucky_flow/src/lucky_flow/find_element.cr:14:33 in 'run'
    lib/lucky_flow/src/lucky_flow/find_element.cr:32:5 in 'retry_after_delay'

</details>

@paulcsmith
Copy link
Member Author

Yeah, that huge stacktrace would be nice to shorten up. I think using a while or loop in

def run
matching_elements.first? || retry
end
private def retry
self.tries += 1
if has_retries_left?
retry_after_delay
else
raise_element_not_found_error
end
end
might work better. But I haven't tried it yet so it may still have the same issue

And no I don't see that error. That means you probably already have a chromedriver instance running. Maybe for some other app?

@johansmitsnl
Copy link

johansmitsnl commented Oct 21, 2018

I have the same issue on my Debian laptop (testing)

crystal spec
Already created node_development
Did nothing. No pending migrations.
Unhandled exception in spawn:
bind: Address already in use (Errno)
  from /usr/share/crystal/src/socket/tcp_server.cr:73:15 in 'initialize'
  from /usr/share/crystal/src/socket/tcp_server.cr:32:3 in 'initialize:reuse_port'
  from /usr/share/crystal/src/socket/tcp_server.cr:32:3 in 'new:reuse_port'
  from /usr/share/crystal/src/http/server.cr:139:5 in 'bind_tcp'
  from src/app.cr:48:5 in 'listen'
  from spec/setup/start_app_server.cr:4:3 in '->'
  from /usr/share/crystal/src/fiber.cr:255:3 in 'run'
  from /usr/share/crystal/src/fiber.cr:29:34 in '->'
  from ???
[1540129866,250][SEVERE]: bind() returned an error, errno=98: Adres is al in gebruik (98)

It only works again when I kill: 6315 pts/3 Sl 0:00 lib/lucky_flow/src/lucky_flow/../../vendor/chromedriver-2.40-linux64 --port=4444 --url-base=/wd/hub

@jwoertink
Copy link
Member

Just came across this. We had pointed to Brave as the browser_binary, but it would throw the Already in use error on this repo's specs. Running the lucky flow specs with crystal spec -DDEBUG let us see that the chromedriver didn't support anything other than Chrome 78.

This would be a great message to be able to display. As for how? no clue 😆

/cc @russ

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