Debugging Countly Server

Hey there. I've setup the community server using the supplied docker container and was wondering on how to debug the instance. My server is running on port 80 and I did the steps described here: Debugging Countly Server (by modifying the container). However I can't seem to find the mentioned log ("countly/log/countly-api.log"). The log folder only contains the installation log.
Is the documentation up to date? I'm using Countly Community Edition v17.05.

0

Comments

10 comments
  • Hello,
    the log is actually forwarded there by supervisor

    if docker container does not use supervisor, it is possible logs are somewhere else.

    @artem any ideas?

    0
    Comment actions Permalink
  • Hi,
    Docker has its guidelines for logs, which is stdout / stderr. So you can get logs by running docker logs [container].

    0
    Comment actions Permalink
  • Hey, thanks for your help @artem. I ran the log command, however the chromdevtools entry wasn't there either. I set up a virtual machine instead (without using docker). When using a vm the logs are in the folder mentioned by @ar2rsawseen. I was wondering... the debbuging feature is marked as "experimental" from your side anyway.
    I was wondering if debuggin is even possible, as docker containers only share specific ports with the host.

    My thoughts on this:

    1. The mentioned log file has to be found
    2. The container has to be created (that is "docker start") using the -P flag, or with the -p flag forwarding ALL ports necessary for debugging (as far as my research went: 9229 and an, at least for me, unknown Websocket port as chrome devtools use websockets to establish a connection to the debuggin instance...)

    Debugging the VM:
    As I mentioned I setup a VM (using VirtualBox). I tried to debug by forwarding Port 9229 from my VM to the Host computer, as I wanted debug on the host machine instead of within the VM (which seems to work). However chrome devtools looses the connection, as they try to establish the affordmentioned websocket connection to countly. Any ideas on how to solve this?

    0
    Comment actions Permalink
  • Any specific error on loosing connection?
    Maybe you can share a screenshot?

    0
    Comment actions Permalink
  • Sure. There are two screenshots. I've forwarded port 9229 to 5000 here, but I was using 9229 on the host machine as well. There isn't any difference in the behaviour.

    0
    Comment actions Permalink
  • As error message I get:

    0
    Comment actions Permalink
  • I mostly see this message if countly process has stopped.
    Is countly still running on your VM after debugger disconnects?

    0
    Comment actions Permalink
  • Yes, the instance is still running and there's nothing within the "Error" or "Dashboard" logs.

    Hm... maybe I shouldn't use port forwarding, but instead add a second network adapter to my vm enabling me to connect to the machine directly from my host computer. I'll try that today...

    0
    Comment actions Permalink
  • After revisiting my VM I found two problems and was able to solve the problem (without setting up a VM network adapter, but using port forwarding):

    1. I noticed, that I put in the ''-- inspect'' below [program:countly-dashboard] command= node (%here)s --inspect...
      I moved the --inspect to the api section and restarted countly

    2. Additionally I still had chromium open and dev tools enabled on my VM, therefore this was blocking the debugging on my host machine and causing the "Reconnect DevTools" error message.

    After these changes debugging is working fine. ☺

    Thank you for the time you spent investigating @ar2rsawseen

    0
    Comment actions Permalink
  • No problem, glad you got it working

    0
    Comment actions Permalink

Please sign in to leave a comment.