dorel14 / 3CX-Cdr-Server

GNU General Public License v3.0
7 stars 4 forks source link

SERVER_TYPE=TCP causes crash #62

Open SamKr opened 2 days ago

SamKr commented 2 days ago

Describe the bug When SERVER_TYPE is configured as TCP, even when setting the SERVER_PORT variable, 3cxcdrserver-1 keeps crashing with the following error:

3cxcdrserver-1  | INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
3cxcdrserver-1  | INFO  [alembic.runtime.migration] Will assume transactional DDL.
3cxcdrserver-1  | /home/appuser/app
3cxcdrserver-1  | Traceback (most recent call last):
3cxcdrserver-1  |   File "/home/appuser/app/srv/runserver.py", line 63, in <module>
3cxcdrserver-1  |     client_config = get_client_config(server_type)
3cxcdrserver-1  |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3cxcdrserver-1  |   File "/home/appuser/app/myhelpers/config.py", line 52, in get_client_config
3cxcdrserver-1  |     'port': env_vars['SERVER_PORT']
3cxcdrserver-1  |             ~~~~~~~~^^^^^^^^^^^^^^^
3cxcdrserver-1  | KeyError: 'SERVER_PORT'
3cxcdrserver-1 exited with code 0

Additional context I'm running through Docker on Debian 12. Been tweaking the configs all day (if I get this working, I'll create some PR's for you with extra troubleshooting / readme info if you want). I have everything working except this part.

Something that may be relevant:

In config.py, I don't see the SERVER_PORT variable in the env_vars array:

https://github.com/dorel14/3CX-Cdr-Server/blob/master/myhelpers/config.py

image

Yet it tries to grab it from that array:

image

Perhaps this is the issue?

Thanks for sharing this great project, and thanks in advance for your help!

SamKr commented 2 days ago

Update: I manually edited config.py to add the follow entry to the array (note that the 30000 is my arbitrarily picked port):

'SERVER_PORT': int(os.environ.get('SERVER_PORT', '30000')),

And that solved the issue.

dorel14 commented 2 days ago

Hello , happy to hear that you solved your issue.

The bug is exactly where you point it, feel free to submit a PR

Thx , next version will bring some more features

SamKr commented 2 days ago

I'll start working on some PRs in the coming days :)

quick question, do you have any other grafana dashboards apart from the basic default one?

SamKr commented 22 hours ago

Created the first PRs, let me know if something not up to your standards.

If you want, I can also work on your wiki, to add troubleshooting/info that I would've found useful. Easiest way is if you grant me editor access to them since they're not cloned with the rest.

dorel14 commented 13 hours ago

I sent you an invite to collaborate to repo and wiki

I will have a look AT you pr on weekend