MARTIMM / raku-mongodb-driver

MongoDB driver for Raku
Artistic License 2.0
18 stars 8 forks source link

Failed to connect: connection refused #17

Closed szabgab closed 7 years ago

szabgab commented 7 years ago

I copy-pasted the first part of the example in the README till the first run-comand and ran the script. I got:

Failed to connect: connection refused
  in method open at /usr/share/perl6/site/sources/5AE1A383104B2204E0D49C98A4764DC550EB8763 (MongoDB::Server::Socket) line 59
  in method get-socket at /usr/share/perl6/site/sources/9C204975B90DE157AA4A198A645BD8AB21804B36 (MongoDB::Server) line 317
  in method query at /usr/share/perl6/site/sources/75DA101655DA0DF9F1B052F6D9017F3AA3E589B2 (MongoDB::Wire) line 57
  in method timed-query at /usr/share/perl6/site/sources/75DA101655DA0DF9F1B052F6D9017F3AA3E589B2 (MongoDB::Wire) line 27
  in method raw-query at /usr/share/perl6/site/sources/9C204975B90DE157AA4A198A645BD8AB21804B36 (MongoDB::Server) line 393
  in block  at /usr/share/perl6/site/sources/320020F919BC24BC1A155DE05C66B59D9FED6B21 (MongoDB::Server::Monitor) line 95

2017-06-15 15:42:09.792451 [E]  3: Server localhost:27017 error Failed to connect: connection refused. At site#sources.320020F919BC24BC1A155DE05C66B59D9FED6B21 (MongoDB::Server::Monitor):155

several times till I stopped it with Ctrl-C.

At the same time:

# mongo 127.0.0.1/27017
MongoDB shell version: 2.4.10
connecting to: 127.0.0.1/27017
> exit
bye

this is:

# perl6 -v
This is Rakudo version 2017.04.3 built on MoarVM version 2017.04-53-g66c6dda
implementing Perl 6.c.

The MongoDB module was installed using the force because #16.

I wonder what could be the problem.

MARTIMM commented 7 years ago

normally the default URI of 'mongodb://' should work to connect to 127.0.0.1/27017. In the code, the Socket class is used to make the connection and on failure, an exception is thrown by the socket. It is caught though to provide an error or fatal message (the last one throws again)

MARTIMM commented 7 years ago

There were some issues when I started to use the newest mongod server. These are solved now. On Travis everything tests ok.

Btw, are you running your program in the same environment as your mongo shell?

MARTIMM commented 7 years ago

Rewrote the synopsis part to fix small problems which surfaced after such a long time since I've written that part. Made also a new version of MongoDB driver after changes in BSON. Please try again.

MARTIMM commented 7 years ago

according to later communications, it seemed to work now for Gabor. Closing this ticket.