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

zef install: MongoDB fails #20

Closed
tbrowder opened this issue Jun 22, 2017 · 28 comments
Closed

zef install: MongoDB fails #20

tbrowder opened this issue Jun 22, 2017 · 28 comments

Comments

@tbrowder
Copy link

tbrowder commented Jun 22, 2017

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
Copy link
Owner

MARTIMM commented Jun 24, 2017

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
Copy link
Author

tbrowder commented Jun 24, 2017

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
Copy link
Owner

MARTIMM commented Jun 24, 2017

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
Copy link
Author

tbrowder commented Jun 24, 2017

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

@MARTIMM
Copy link
Owner

MARTIMM commented Jun 24, 2017

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
Copy link
Author

tbrowder commented Jun 24, 2017 via email

@MARTIMM
Copy link
Owner

MARTIMM commented Jun 24, 2017

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
Copy link
Owner

MARTIMM commented Jun 24, 2017

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
Copy link
Author

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

@MARTIMM
Copy link
Owner

MARTIMM commented Jun 24, 2017

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

@tbrowder
Copy link
Author

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
Copy link
Owner

MARTIMM commented Jun 24, 2017

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
Copy link
Author

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
Copy link
Owner

MARTIMM commented Jun 24, 2017

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
Copy link
Author

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

@MARTIMM
Copy link
Owner

MARTIMM commented Jun 24, 2017

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

@tbrowder
Copy link
Author

tbrowder commented Jun 26, 2017

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

perl6 t/110-Client.t
�[38;2;0;200;0m2017-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�[0m
    ok 1 - The object is-a 'MongoDB::Client'
�[38;2;200;200;0m2017-06-26 11:58:33.288016 [W] 15: Failed to resolve host name. At site#sources/A31274084A67EB3FEE452A7B82BFE729C54D6F91 (MongoDB::Wire):101�[0m
�[38;2;200;200;0m2017-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�[0m
�[38;2;200;200;0m2017-06-26 11:58:33.727780 [W] 15: Failed to resolve host name. At site#sources/A31274084A67EB3FEE452A7B82BFE729C54D6F91 (MongoDB::Wire):101�[0m
�[38;2;200;200;0m2017-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�[0m
�[38;2;200;200;0m2017-06-26 11:58:34.207057 [W] 15: Failed to resolve host name. At site#sources/A31274084A67EB3FEE452A7B82BFE729C54D6F91 (MongoDB::Wire):101�[0m
�[38;2;200;200;0m2017-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�[0m
�[38;2;200;200;0m2017-06-26 11:58:34.646736 [W] 15: Failed to resolve host name. At site#sources/A31274084A67EB3FEE452A7B82BFE729C54D6F91 (MongoDB::Wire):101�[0m
�[38;2;200;200;0m2017-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�[0m
�[38;2;200;200;0m2017-06-26 11:58:35.126834 [W] 15: Failed to resolve host name. At site#sources/A31274084A67EB3FEE452A7B82BFE729C54D6F91 (MongoDB::Wire):101�[0m
�[38;2;200;200;0m2017-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�[0m
�[38;2;200;200;0m2017-06-26 11:58:35.576371 [W] 15: Failed to resolve host name. At site#sources/A31274084A67EB3FEE452A7B82BFE729C54D6F91 (MongoDB::Wire):101�[0m
�[38;2;200;200;0m2017-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�[0m
�[38;2;200;200;0m2017-06-26 11:58:36.055124 [W] 15: Failed to resolve host name. At site#sources/A31274084A67EB3FEE452A7B82BFE729C54D6F91 (MongoDB::Wire):101�[0m
�[38;2;200;200;0m2017-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�[0m
�[38;2;0;200;0m2017-06-26 11:58:36.178605 [I] 12: Client topology type set to TT-Unknown�[0m

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
Copy link
Owner

MARTIMM commented Jun 27, 2017 via email

@tbrowder
Copy link
Author

tbrowder commented Jun 27, 2017 via email

@MARTIMM
Copy link
Owner

MARTIMM commented Jul 31, 2017

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

@tbrowder
Copy link
Author

tbrowder commented Jul 31, 2017 via email

@MARTIMM
Copy link
Owner

MARTIMM commented Aug 20, 2017

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
Copy link
Owner

MARTIMM commented Sep 5, 2017

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
Copy link

JJ commented May 27, 2020

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
Copy link
Owner

MARTIMM commented May 30, 2020

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
Copy link

JJ commented May 30, 2020

Thanks!

@MARTIMM
Copy link
Owner

MARTIMM commented May 31, 2020

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
Copy link
Owner

MARTIMM commented Jun 2, 2020

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...

@MARTIMM MARTIMM closed this as completed Jun 2, 2020
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

3 participants