AtoM 2.1.2 on Docker has 500 Internal Server Errors

107 views
Skip to first unread message

John Fink

unread,
Apr 30, 2015, 1:04:14 PM4/30/15
to ica-ato...@googlegroups.com
Hey folks,

Over the last couple of days I've put together 95% of a functioning Docker development setup for AtoM, which you can see/test here: http://github.com/jbfink/docker-atom . However, the last 5% is killing me -- I'm running into 500 Internal Server errors which seem to be commensurate with a crashing/unavailable Elasticsearch (see https://groups.google.com/forum/#!topic/ica-atom-users/_jfYpIvBZ54 -- basically these are my symptoms; I can reach the functions menu but nothing else). However, logging into the nginx server container, I can ping the elasticsearch server and also run various diagnostic things against it; you can see the various outputs from that, along with nginx error log output here: https://gist.github.com/jbfink/ab2eefa89c65d0fde8c4 . I've also tried messing with ES_HEAP_SIZE, upping it to 2g and it doesn't seem to change anything.

What's *really* stumping me is that I have a running Docker AtoM setup (not using Compose, but otherwise pretty much identical) on a server here and no errors like this! Gah. Can anyone here give me an idea on what might be wrong and what to try?

jf

Jesús García Crespo

unread,
Apr 30, 2015, 1:17:17 PM4/30/15
to ica-ato...@googlegroups.com
Hi John,

What are the contents of config/search.yml?

--
You received this message because you are subscribed to the Google Groups "ICA-AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To post to this group, send email to ica-ato...@googlegroups.com.
Visit this group at http://groups.google.com/group/ica-atom-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/e2163126-60d6-4cf2-b84f-afdba1531d94%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jesús García Crespo,
Software Engineer, Artefactual Systems Inc.
http://www.artefactual.com | +1.604.527.2056

John Fink

unread,
Apr 30, 2015, 2:13:41 PM4/30/15
to ica-ato...@googlegroups.com
Hi Jesús! thanks for the reply. 

I put the search.yml in the gist; you can see it here: https://gist.github.com/jbfink/ab2eefa89c65d0fde8c4#file-search-yml

jf

--
You received this message because you are subscribed to a topic in the Google Groups "ICA-AtoM Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ica-atom-users/p7ACO3jKZv8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ica-atom-user...@googlegroups.com.

To post to this group, send email to ica-ato...@googlegroups.com.
Visit this group at http://groups.google.com/group/ica-atom-users.

Jesús García Crespo

unread,
May 1, 2015, 1:19:07 PM5/1/15
to ica-ato...@googlegroups.com
Hi John,

I'm not sure what is wrong in your setup. The configuration seems fine to me! The only think that I can think of is that your nginx container may be exposing access to the AtoM installer before the elasticsearch container has complete the initialization of the cluster (even if you are dealing with a single-node cluster, the process may take 15-30 seconds). I guess what I would try next is `docker-compose run nginx /bin/bash`, open a terminal multiplexer and keep an eye on the log files (/var/log/nginx and /user/share/nginx/atom) while you run supervisord.

I'm sorry that I can't be of much help. I don't have time to try this myself but I'd love to see some progress done on this direction. In particular, I'm curious to see how Compose reduces some friction between development and production environments.

Let me know how it goes!


For more options, visit https://groups.google.com/d/optout.

John Fink

unread,
May 1, 2015, 3:05:07 PM5/1/15
to ica-ato...@googlegroups.com
Hey Jesús, thanks for the advice. It's *possible* that you're right about the nginx container jumping the gun before the ES container is settled. I'll try what you suggest and probably also try just running mysql and ES with Compose, waiting a few minutes, and then bringing up the AtoM nginx container manually. Ruins the entire *point* of compose but if it solves the 500 error then it's an interesting data point.

jf


John Fink

unread,
May 1, 2015, 3:13:46 PM5/1/15
to ica-ato...@googlegroups.com
One interesting point is that step 3 in setup, right after you tell AtoM where Elasticsearch is, there's a while until AtoM responds with the next step. Like more than half a minute. Not sure if that's *normal* behaviour or not or indicative of anything iffy.

jf

Jesús García Crespo

unread,
May 1, 2015, 3:14:36 PM5/1/15
to ica-ato...@googlegroups.com
The nginx container is based on jessie, right? ... which probably comes with Python bundled in it. One option could be to implement a custom entrypoint for the container written in Python where the launch of supervisord is delayed until the cluster becomes available. But this would be relevant only if my assumption about the cluster initialization being the issue is right :P

It's super interesting. Good luck!


For more options, visit https://groups.google.com/d/optout.

John Fink

unread,
May 1, 2015, 3:59:30 PM5/1/15
to ica-ato...@googlegroups.com
Jesús/other folks,

I've found the problem! For *some* reason, after running the setup, the config/search.yml gets written like this:

server:
    host: es
    port: '9200'

Thought to myself, hey, in the template file for search.yml located at plugins/arElasticSearchPlugin//config/search.yml the 9200 is *not* in quotes. What happens if I stop the server, edit config/search.yml, and take out the quote marks around '9200'?  And it works! No more 500 errors!

What I can't figure out is why this problem seems to affect just me. Shouldn't *everybody* be messed up by the malformed search.yml? And since config/search.yml is only created after you go through the web setup, I don't think I can fix it through Docker. Is this a bug that can be fixed on AtoM's end? Maybe for AtoM-2.1.3? :)

jf


Jesús García Crespo

unread,
May 4, 2015, 1:41:56 PM5/4/15
to ica-ato...@googlegroups.com
Hi John,

That's weird. In the spec, scalar types can be unquoted, single-quoted or even double-quoted seamlessly. I've had all kind of problems with the YAML parser bundled in Symfony1.4 with other structures but scalars seem to be working. I have the feeling that you solved the problem by restarting the pool of php processes but I don't think that it was related to the change you made to search.yml. I tried in my development environment with the different styles in scalars and it worked. It must be something else.


For more options, visit https://groups.google.com/d/optout.

John Fink

unread,
May 4, 2015, 1:47:52 PM5/4/15
to ica-ato...@googlegroups.com
Huh. Man, I was so pleased with myself. OK. I'll keep working on it! Thanks.

jf

John Fink

unread,
May 6, 2015, 4:32:59 PM5/6/15
to ica-ato...@googlegroups.com
Hello folks,

I have a workaround for the 500 errors in my Compose recipe that I'm relatively happy with but it does require running a command outside of Compose and therefore can't be automated. I've updated my Github repo (http://github.com/jbfink/docker-atom); if this is something you can try, I'd be very grateful to hear if it works for you. Please follow the README -- the fix is in step #10.

jf

Jesús García Crespo

unread,
May 7, 2015, 2:08:36 AM5/7/15
to ica-ato...@googlegroups.com
John, thank you so much!


For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages