Redis Error - Error 11001 connecting to redis:6379 - django

I have a Django project in Docker compose container.
So, when I'm trying to docker-compose up - it's all OK. All containers, including Redis is up.
Redis logs
2023-02-06 14:48:50 1:M 06 Feb 2023 11:48:50.519 * Ready to accept connections
But when I'm trying to send a POST request to my API from Postman - I'm getting this error.
File "c:\Users\django_env\Lib\site-packages\redis\connection.py", line 617, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 11001 connecting to redis:6379. getaddrinfo failed.
Anyone knows how to fix it? I'm working on Windows mashine. Thanks)
My docker-compose file
https://pastebin.com/n2buBpxH

Related

consumer: Cannot connect to redis://localhost:6379//: Error 61 connecting to 127.0.0.1:6379. Connection refused

I'm trying to get celery up and running on Heroku as per the woeful instructions here
whenever i try to run "heroku local"
it gives me the error:
consumer: Cannot connect to redis://localhost:6379//: Error 61 connecting to 127.0.0.1:6379.
Connection refused..
any help is much appreciated.
you have to run the server
$ redis-server
this work for me

WSO2 CLI tools Unable to connect to host

I'm just using WSO2 micro intregrator and having issue with CLI tools, mi: Unable to connect to host
i run the WSO2 Micro Integrator on a VM using command :
$micro-integrator.bat -DenableManagementApi
and i wanna Get information about one or more Carbon Apps using :
$mi show carbonapp --verbose
[INFO] Executed ManagementCLI (mi) on Thu, 25 Jul 2019 14:59:47 +07
[INFO] Show Carbon app called
[INFO] URL: https://localhost:9165/management/applications
$mi: Unable to connect to host
mi init --verbose
[INFO] Executed ManagementCLI (mi) on Thu, 25 Jul 2019 15:01:52 +07
[INFO] Init called
Enter following parameters to configure the cli
Host name(default localhost): localhost
Port number(default 9164): 9165
CLI configuration is successful
i expect Get information about one or more Carbon Apps
Can you check the port ManagementApi is running. By default it is 9164 since you have mentioned as 9165, is MI started with offset 11 ( default offset 10 )? Else you may find the offset in carbon.xml.
Following logs will be printed in console when MI is started with Management Api
[2019-07-28 21:05:05,318] [micro-integrator] INFO - PassThroughListeningIOReactorManager Pass-through EI_INTERNAL_HTTPS_INBOUND_ENDPOINT Listener started on 0.0.0.0:9164
Here "9164" is the port of it. Please make sure that it is started and the port it is started is same as what you define in init.

django website working, but django manage.py cannot connect to db

I'm trying to run a django migration to update my database, but "manage.py migrate" can't connect to my postgresql db. The odd thing is: my django website (which is exactly the same code) is working including connecting to the db.
Error messages:
psycopg2.OperationalError: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.xxxxxx"?
and
django.db.utils.OperationalError: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL
Workaround: Change HOST variable to either localhost or 127.0.0.1 .
see: https://community.webfaction.com/questions/21072/django-website-working-but-django-managepy-cannot-connect-to-db

uwsgi django at boot fail to start without postgresql

Debian server, uwsgi at boot started by a crontab #reboot.
return this in uwsgi.log:
ile
"/usr/local/lib/python2.7/dist-packages/django/db/backends/postgresql/base.py",
line 175, in get_new_connection
connection = Database.connect(**conn_params) File "/usr/lib/python2.7/dist-packages/psycopg2/init.py", line 164, in
connect
conn = _connect(dsn, connection_factory=connection_factory, async=async) django.db.utils.OperationalError: could not connect to
server: Connection refused Is the server running on host "127.0.0.1"
and accepting TCP/IP connections on port 5432?
Thu Mar 24 05:19:02 2016 - unable to load app 0 (mountpoint='')
(callable not found or import error) Thu Mar 24 05:19:02 2016 - * no
app loaded. going in full dynamic mode Thu Mar 24 05:19:02 2016 -
uWSGI is running in multiple interpreter mode *
if I wait that also postgresql start and restart uwsgi all is working.
Are there way to tell uwsgi to wait for postgresql?
Use systemd to start uWSGI instead of cron daily.
Create file /etc/systemd/system/uwsgi.service with content:
[Unit]
Description=uWSGI
After=syslog.target
After=postgresql#9.4-main.service
Wants=postgresql#9.4-main.service
[Service]
ExecStart=/usr/local/bin/uwsgi --ini /etc/uwsgi/uwsgi.ini
Restart=always
KillSignal=SIGTERM
Type=notify
StandardError=syslog
NotifyAccess=all
[Install]
WantedBy=multi-user.target
Change of course start command for anything you want.
If you want to start more than one uWSGI server (for more than one user perhaps), consider using uWSGI Emperor. You can even create some shared directory in which everyone can create and manage it's own files (by setting sticky bit on directory) and set emperor in tyrant mode, so every vassal will start only from user account that owns specified file, if you want to give anyone ability to create own uWSGI instances.

Deploying Django with Mezzanine on FastCGI

I'm in the middle of trying to deploy a Django project on Subsys.no, Who uses FastCGI. I have never deployed a project before and have been trying for 3 days straight.
I have made a virtualenv on the server and installed all the packages I need.
I have uploaded (FTP) the project I have onto the server (in the correct place)
I have tired using Fabrics "fab all" command on the server and locally. The server gave this response:
--
all
---
-------
install
-------
$ cat /etc/default/locale ->
Fatal error: Low level socket error connecting to host subsys.no on port 22: Connection refused (tried 1 time)
Underlying exception:
Connection refused
Aborting.
The local gave the same answer but with one twist:
Fatal error: Timed out trying to connect to subsys.no (tried 1 time)
Underlying exception:
timed out
I'm not sure if the error lie here or here on the site. It gives out alot that I dont understand.
All help is greatly appreciated and thanks in advance!