MARTIMM / raku-mongodb-driver

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

zef install: MongoDB fails #20

Closed tbrowder closed 4 years ago

tbrowder commented 7 years ago

Note the failure is when using the very latest rakudo (branch nom) with bumps to nqp and MoarVM: perl6 -v:

This is Rakudo version 2017.06-45-g86e7b2b built on MoarVM version 2017.06-13-g7405dfa implementing Perl 6.c.

===> Testing: MongoDB:ver('0.37.3')

# Failed test 'Server selected'
# at t/110-Client.t line 62

# Failed test 'Status of server is SS-Unknown'
# at t/110-Client.t line 64
# expected: 'SS-Standalone'
#      got: 'SS-Unknown'

# Failed test 'Topology TT-Unknown'
# at t/110-Client.t line 67
# expected: 'TT-Single'
#      got: 'TT-Unknown'
# Looks like you failed 3 tests of 3

[... and more failures]

MARTIMM commented 7 years ago

This test (110-client) is tricky in that there is some time spent in calculating the topology. The test might ask for it too early. This should not happen of course and any investigation to that info should be delayed (by the program) until the info is stable. In the meantime, I've upgraded the rakudo and saw that it still ran this test ok. I have to dig in deeper to find this problem. At the moment there's not much time to work on it but it will be solved!

tbrowder commented 7 years ago

Thanks, Marcel. I got interested in your module because I took David Goldman's MongoDB class Thursday at TPC NA 2017 and want to use Perl 6 instead of Perl 5 . I, too, am a Perl 6 lover since 2014.

Thank you for your contribution.

MARTIMM commented 7 years ago

Hi Tom, perhaps installing without testing (zef --/test install MongoDB) might keep you going and you could then try out this package. I just found out that there were other problems when I was installing from the ecosystem using zef. Most of the time I install using the local directory '.'. Furthermore, I must mention that there are also some concurrency issues in BSON which this package depends on. Pawel has helped by giving a tip on how to solve that, so also that will pass. It will occur when bigger documents are communicated from the server.

I am also very interested in your experience with this package. Is it convenient/usable enough to use it etcetera. David Golden helped me out also once or twice. He is very knowledgeable about perl and MongoDB

Regards, Marcel

tbrowder commented 7 years ago

I will try that--thanks! BTW, do you have an IRC #perl6 name? Mine is "tbrowder".

MARTIMM commented 7 years ago

Mine is MARTIMM, same as on Github. I am not there often though, sometimes I look there to follow discussions or ask questions but I am a bit slow in digesting suggestions so I hesitate to ask things there.

tbrowder commented 7 years ago

On Sat, Jun 24, 2017 at 5:17 AM, Marcel Timmerman notifications@github.com wrote:

Mine is MARTIMM, same as on Github. I am not there often though,

Thanks. I completely understand.

I do like it, but I often make stupid comments, e.g., I reply too quickly to a thread and have to retract or apologize for the noise. I also feel like I'm sending msgs to a black hole when I never see a response to some reasonable comment. In spite of all that, I'm glad the channel is there, and most people are really nice and helpful.

MARTIMM commented 7 years ago

I like it too. I've had responses from people who helped me out with things or explained things of perl6 which I only understood a few hours later :-) But in the end, we'll get there.

MARTIMM commented 7 years ago

In the meantime I inserted two tests if the client is ready to return info. uploaded a new version but may take some time in the ecosystem? Version 0.37.4 Take a shot at it ;-) Regards Marcel

tbrowder commented 7 years ago

Ok, I will fork it, get a local copy, and give it a try.

MARTIMM commented 7 years ago

Maybe cloning is more convenient, you can git pull later when new versions arrive? Btw, Travis did fine on the tests

tbrowder commented 7 years ago

Cloned MongoDB, attempted a normal install:

 cd mongo-perl-driver; zef install .

results:

===> Testing: MongoDB:ver('0.37.4')

    # Failed test 'Server selected'
    # at t/110-Client.t line 62

    # Failed test 'Status of server is SS-Unknown'
    # at t/110-Client.t line 64
    # expected: 'SS-Standalone'
    #      got: 'SS-Unknown'

    # Failed test 'Topology TT-Unknown'
    # at t/110-Client.t line 67
    # expected: 'TT-Single'
    #      got: 'TT-Unknown'
    # Looks like you failed 3 tests of 3

# Failed test 'Standalone server'
# at t/110-Client.t line 54

    # Failed test 'Server localhost:65010 is SS-Unknown'
    # at t/110-Client.t line 84
    # expected: 'SS-Standalone'
    #      got: 'SS-Unknown'

    # Failed test 'Server localhost:65011 is SS-Unknown'
    # at t/110-Client.t line 87
    # expected: 'SS-Standalone'
    #      got: 'SS-Unknown'
    # Looks like you failed 2 tests of 4

# Failed test 'Two equal standalone servers'
# at t/110-Client.t line 71
# Looks like you failed 2 tests of 3

    # Failed test 'Status of server is SS-Standalone'
    # at t/111-Client.t line 32
    # expected: 'SS-Standalone'
    #      got: 'SS-Unknown'

    # Failed test 'Server is defined'
    # at t/111-Client.t line 47

    # Failed test 'Status of server is SS-Standalone again'
    # at t/111-Client.t line 48
    # expected: 'SS-Standalone'
    #      got: 'SS-Unknown'
    # Looks like you failed 3 tests of 6

# Failed test 'Shutdown and start server'
# at t/111-Client.t line 22

    # Failed test 'Standalone server'
    # at t/111-Client.t line 65
    # expected: 'SS-Standalone'
    #      got: 'SS-Unknown'
Cannot look up attributes in a BSON::Document type object
  in method find-key at /usr/local/rakudo.d/share/perl6/site/sources/800244C768E3CB522CDE84C6E13D0A91FDA2D00B (BSON::Document) line 250
  in method AT-KEY at /usr/local/rakudo.d/share/perl6/site/sources/800244C768E3CB522CDE84C6E13D0A91FDA2D00B (BSON::Document) line 268
  in block <unit> at t/111-Client.t line 70

Cannot look up attributes in a BSON::Document type object
  in method find-key at /usr/local/rakudo.d/share/perl6/site/sources/800244C768E3CB522CDE84C6E13D0A91FDA2D00B (BSON::Document) line 250
  in method AT-KEY at /usr/local/rakudo.d/share/perl6/site/sources/800244C768E3CB522CDE84C6E13D0A91FDA2D00B (BSON::Document) line 268
  in block <unit> at t/112-Client.t line 68

Cannot look up attributes in a BSON::Document type object
  in method find-key at /usr/local/rakudo.d/share/perl6/site/sources/800244C768E3CB522CDE84C6E13D0A91FDA2D00B (BSON::Document) line 250
  in method AT-KEY at /usr/local/rakudo.d/share/perl6/site/sources/800244C768E3CB522CDE84C6E13D0A91FDA2D00B (BSON::Document) line 268
  in block <unit> at t/200-Database.t line 39
[more similar lines...]

I used Ctl-C to stop the test after 11 minutes. Then I installed with no test. Will attempt using it in a while.

MARTIMM commented 7 years ago

That will take a while before I recover from this :-\ after that I'll work it... Would you please show the outcome of the first test? (009-mk-sandbox.t)

tbrowder commented 7 years ago

perl6 t/009-mk-sandbox.t:

ok 1 - Server 's1' already started
ok 2 - Server 's2' already started
ok 3 - Server 's3' already started
    1..3
    ok 1 - code dies
    ok 2 - right exception type (X::MongoDB)
    ok 3 - .message matches /:s exited unsuccessfully/
ok 4 - did we throws-like X::MongoDB?
1..4
MARTIMM commented 7 years ago

Thanks, Tom, I was afraid that no server was started at all. This outcome shows that the servers were started.

At the start of test1110-client.t you can find the following lines;

drop-send-to('mongodb');
drop-send-to('screen');
#modify-send-to( 'screen', :level(MongoDB::MdbLoglevels::Fatal));
info-message("Test $?FILE start");

would you please change these into the following and then run that test again?

drop-send-to('mongodb');
#drop-send-to('screen');
modify-send-to( 'screen', :level(MongoDB::MdbLoglevels::Info));
info-message("Test $?FILE start");

A lot of messages are generated because tests are done with nonexistent servers etc. Hopefully, this might help me a bit.

tbrowder commented 7 years ago

I have to leave my hotel now. I'll try to check your suggestion out later today or tomorrow. Thanks for pursuing this!

MARTIMM commented 7 years ago

Well, I have to leave too for a much longer time, but I'll return Thanks so far

tbrowder commented 7 years ago

I modified test 110-Client.t as you said. Then

perl6 t/110-Client.t
2017-06-26 11:58:32.698519 [I]  1: Test /usr/local/people/tbrowde/mydata/tbrowde-home-bzr/perl6/perl6-repo-forks/mongo-perl6-driver/t/110-Client.t start
    ok 1 - The object is-a 'MongoDB::Client'
2017-06-26 11:58:33.288016 [W] 15: Failed to resolve host name. At site#sources/A31274084A67EB3FEE452A7B82BFE729C54D6F91 (MongoDB::Wire):101
2017-06-26 11:58:33.302835 [W] 15: no response from server non-existent-server.with-unknown.domain:65535. At site#sources/1DE3CB502E7944F2328B683978F7F2C70ED2702C (MongoDB::Server::Monitor):123
2017-06-26 11:58:33.727780 [W] 15: Failed to resolve host name. At site#sources/A31274084A67EB3FEE452A7B82BFE729C54D6F91 (MongoDB::Wire):101
2017-06-26 11:58:33.734473 [W] 15: no response from server non-existent-server.with-unknown.domain:65535. At site#sources/1DE3CB502E7944F2328B683978F7F2C70ED2702C (MongoDB::Server::Monitor):123
2017-06-26 11:58:34.207057 [W] 15: Failed to resolve host name. At site#sources/A31274084A67EB3FEE452A7B82BFE729C54D6F91 (MongoDB::Wire):101
2017-06-26 11:58:34.213945 [W] 15: no response from server non-existent-server.with-unknown.domain:65535. At site#sources/1DE3CB502E7944F2328B683978F7F2C70ED2702C (MongoDB::Server::Monitor):123
2017-06-26 11:58:34.646736 [W] 15: Failed to resolve host name. At site#sources/A31274084A67EB3FEE452A7B82BFE729C54D6F91 (MongoDB::Wire):101
2017-06-26 11:58:34.722016 [W] 15: no response from server non-existent-server.with-unknown.domain:65535. At site#sources/1DE3CB502E7944F2328B683978F7F2C70ED2702C (MongoDB::Server::Monitor):123
2017-06-26 11:58:35.126834 [W] 15: Failed to resolve host name. At site#sources/A31274084A67EB3FEE452A7B82BFE729C54D6F91 (MongoDB::Wire):101
2017-06-26 11:58:35.136848 [W] 15: no response from server non-existent-server.with-unknown.domain:65535. At site#sources/1DE3CB502E7944F2328B683978F7F2C70ED2702C (MongoDB::Server::Monitor):123
2017-06-26 11:58:35.576371 [W] 15: Failed to resolve host name. At site#sources/A31274084A67EB3FEE452A7B82BFE729C54D6F91 (MongoDB::Wire):101
2017-06-26 11:58:35.581916 [W] 15: no response from server non-existent-server.with-unknown.domain:65535. At site#sources/1DE3CB502E7944F2328B683978F7F2C70ED2702C (MongoDB::Server::Monitor):123
2017-06-26 11:58:36.055124 [W] 15: Failed to resolve host name. At site#sources/A31274084A67EB3FEE452A7B82BFE729C54D6F91 (MongoDB::Wire):101
2017-06-26 11:58:36.061678 [W] 15: no response from server non-existent-server.with-unknown.domain:65535. At site#sources/1DE3CB502E7944F2328B683978F7F2C70ED2702C (MongoDB::Server::Monitor):123
2017-06-26 11:58:36.178605 [I] 12: Client topology type set to TT-Unknown

and more similar lines.

Is there some special mongod configuration I'm expected to have?

My current configuration file (/etc/mongod.conf) as installed (db version 3.4.5; I have not modified it in any way):

# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# Where and how to store data.
storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true
#  engine:
#  mmapv1:
#  wiredTiger:

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1

#processManagement:

#security:

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options:

#auditLog:

#snmp:
MARTIMM commented 7 years ago

Well, in the beginning it is supposed to be many error messages, because that's part of the test. I am interested in the part where the tests themselves are failing.

For the tests, the setup of the server is controlled by the test. Important however, is the servers version. At the moment as high as possible which is 3.4.5 I believe.

Btw, I will not be often in a wifi zone at the moment, so don't worry if I don't respond.

tbrowder commented 7 years ago

On Tue, Jun 27, 2017 at 05:45 Marcel Timmerman notifications@github.com wrote:

Well, in the beginning it is supposed to be many error messages, because

Hm, any estimate of how many failures or how long it should take? I will try to let them run to completion and time it.

MARTIMM commented 7 years ago

A new version is made where a lot is changed in the Client, Server and Monitor classes. Please try again.

tbrowder commented 7 years ago

On Mon, Jul 31, 2017 at 01:57 Marcel Timmerman notifications@github.com wrote:

A new version is made where a lot is changed in the Client, Server and Monitor classes. Please try again.

Thank you, Marcel. I wiil, but it will be a while.

MARTIMM commented 7 years ago

In the meantime, I've cut back the number of tests when installing the driver. The removed tests will later run only on my system and the test servers Travis and later on AppVeyor.

MARTIMM commented 7 years ago

Some test I should've done a long time ago. I relied too much on the results shown by Travis and my own experience by installing from local dir zef install some-dir-to-mongo-driver. Now, I did what everyone does zef install MongoDB! and it fails. What I missed is not yet clear but there is something I can investigate.

JJ commented 4 years ago

So am I correct to guess that tests are still failing, since this is not resolved? I didn't manage to pass them, same error as indicated in the last comment of #31. Maybe we can lend a hand here?

MARTIMM commented 4 years ago

This happened a long time ago. In the meantime, I thought that this was installable. In a short time, I'll make version 0.43.10.2 available if Travis will handle it without problems.

JJ commented 4 years ago

Thanks!

MARTIMM commented 4 years ago

It is published and installs fine. For the test, I need mongo servers which I download. I noticed that I download two versions of which only one is used when testing on a users system. The other is only meant to test on Travis. So there is still room for improvement...

MARTIMM commented 4 years ago

It is published and installs fine. For the test, I need mongo servers which I download. I noticed that I download two versions of which only one is used when testing on a user's system. The other is only meant to test on Travis. So there is still room for improvement...