0

I've been trying to understand how to deploy Opa apps on dotcloud. The default app works, but the wiki example from the Opa docs fails to launch with:

==> /var/log/supervisor/opa.log <==
[Opa] _no_name DbGen/Mongo/SynchroStart Db is ready
[Opa] _no_name DbGen/Mongo/SynchroStart Process 0 operations on the db wait list, start
[Opa] _no_name DbGen/Mongo/SynchroStart Process 0 operations on the db wait list, finished
[Opa] Server dispatch Decoded URL to /
[Opa] DbGen/Mongo (failure) Read from wiki set doesn't returns anything
File "stdlib/database/mongo/db.opa", line 776, characters 6-32, (776:6-776:32 | 28076-28102)
fail: undefinedDbSet build error
Error : uncaught OPA exn { 'size`': 2,
fail: 'DbSet build error',
position: 'File "stdlib/database/mongo/db.opa", line 776, characters 6-32, (776:6-776:32 | 28076-28102)' }

Is this something I have improperly set up or a bug in dotcloud's system?

my .yml:

opa:
type: custom
buildscript: builder
process: ~/run
ports:
    www: http

db:
    type: mongodb

This image shows what the monogdb looks like locally. https://i.stack.imgur.com/mT10d.jpg

UPDATE: I found out mongodb had a separate log. I found this:

auth: couldn't find user root, _no_name.system.users

which seems to point to the fact authentication isn't working.(aka, running the opa program local but pointing to remote mongodb gives same error.) Any ideas why it has this issue?

UPDATE2: Was chasing my tail around the past few days because I didn't quite understand what Cédrics was talking about. Here's what I replaced the database lines in the example with to get working:

database admin {
stringmap(string) /wiki;
/wiki[_] = "This page is empty. Double-click to edit.";
}

The problem was I was changing the path, not the db name:

ex: database int /admin/wiki 

and not

ex. database admin {int /wiki;}

I'm curious if there's a way to use any other named database besides admin through opa, but at least this gets me running.

eyecreate
  • 1,017
  • 3
  • 14
  • 26

1 Answers1

1

update2:

I pushed a working dotcloud conf here: https://github.com/cedricss/opa-on-dotcloud.git


Are you sure mongodb is running? Did you add the following lines in your dotcloud.yml file?

db:
    type: mongodb

More information about Opa on dotcloud here: https://github.com/dotcloud/opa-on-dotcloud

update: indeed something is broken now. Two updates can be done in the conf example above:

  • builder should be updated to use Opa 1.0.5 to have all mongodb related fix: BINURL="http://download.opalang.org/linux/opa_1.0.5%2Bbuild2988_amd64.release.run"

  • opa 1.0.5 needs node 0.6.x at least, dotcloud.yml have to be completed like explained here: http://docs.dotcloud.com/services/nodejs/#node-js-versions but I don't know why my instances keeps having node 0.4.0 installed even after creating a fresh new app. I'll have another try later.

Cédrics
  • 1,974
  • 11
  • 13
  • Yes, that's what I used as a base for my .yml. Added my yml to OP. – eyecreate Aug 15 '12 at 17:10
  • I had tried the newer Opa previously, but didn't know you could specify a different node.js version in the .yml. Is it possible the node_version config section only is read if the type is of nodejs? – eyecreate Aug 15 '12 at 19:48
  • I'm trying some builder script material from here: https://github.com/dotcloud/node-on-dotcloud looks promising. – eyecreate Aug 15 '12 at 20:11
  • seems it still has a monogdb problem with 0.6.20 got using the above builder script addition. – eyecreate Aug 15 '12 at 20:18
  • ok indeed changing type to nodejs did the trick to have the node version taken into account (so github.com/dotcloud/node-on-dotcloud is outdated) – Cédrics Aug 16 '12 at 06:58
  • I pushed a working dotcloud conf here: https://github.com/cedricss/opa-on-dotcloud.git have a try! – Cédrics Aug 16 '12 at 15:55
  • Hm...I seem to still be getting mongodb errors, Maybe I'm doing something wrong since it worked fine locally. Here's the folder I've pushed: http://www.sendspace.com/file/snw89a – eyecreate Aug 16 '12 at 16:24
  • as a quick fix change your database name to "admin" (and replace all your `/wiki` with `/admin`), for some reasons only the admin namespace has root the user for authentification. More info here: http://docs.dotcloud.com/services/mongodb/ – Cédrics Aug 16 '12 at 16:45
  • I'm getting the same error, but with admin instead of wiki in the error for not returning anything. Maybe I don't know how to change the db name, but what I did seemed right: --db-remote:admin "$MONGO_URL"(doesn't help I haven't used mongodb before.) – eyecreate Aug 16 '12 at 17:11
  • if you have a single database, just use the `--db-remote` option (without `:admin`). Btw I pushed a more complexe example (wiki mvc) here on the branch origin/wiki_mvc: https://github.com/cedricss/opa-on-dotcloud – Cédrics Aug 16 '12 at 17:37
  • --db-remote is what I had before, so that means there's something else causing my(actually the Opa example code: http://doc.opalang.org/manual/Hello--wiki) code to not run on dotcloud. Since it ran fine locally before, could it be something related to the mongodb used on dotcloud or something is else missing? – eyecreate Aug 17 '12 at 20:52
  • Hm...This image seems to show when run locally, the DB isn't being stored in "admin". IS this part of the problem? http://imgur.com/LJ1RY – eyecreate Aug 21 '12 at 21:22
  • hm..on my update about the unable to find root, it goes away if I use --db-remote:admin. Still have the same dbset build error, though. – eyecreate Aug 21 '12 at 23:08
  • yes only the admin db on dotcloud has a ready to use root user for authentification by default, but I imagine there is a way on dotcloud to configure user accesses for other databases. – Cédrics Aug 22 '12 at 16:06