DEPLOY FIEF ON GCP #336
-
hello i am trying to deploy fief directly on gcp vm since my db is on a VPC. I need to deploy fief in the vpc so in one of our gcp vm. ---- French version ! Bonjour !
Si quelqu'un a une idée, faites le nous savoir ! Bonne journée. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 23 replies
-
Hail, @MathieuGrosso 👋 Welcome to Fief's kingdom! Our team will get back to you very soon to help. In the meantime, take a minute to star our repository ⭐️ Farewell! |
Beta Was this translation helpful? Give feedback.
-
Salut @MathieuGrosso 👋 If I understand correctly, you're running Redis on the same machine/VM than Fief itself, processes being managed by supervisord. From the logs, it seems that Fief tries to reach Redis using the hostname
If Redis does indeed run on the same machine/VM, then you probably should reach it directly on
(which is actually the default if you don't set it) |
Beta Was this translation helpful? Give feedback.
-
Salut François 🙋🙋🙋!
I just tried what you said, it seems to work locally but not on a compute engine vm.
I get this error:
```
2024-02-14 17:04:18,736 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.
2024-02-14 17:04:18,737 INFO supervisord started with pid 1
2024-02-14 17:04:19,739 INFO spawned: 'fief-server' with pid 7
2024-02-14 17:04:19,742 INFO spawned: 'fief-worker' with pid 8
2024-02-14 17:04:19,742 INFO spawnerr: can't find command '/usr/local/bin/redis-server'
2024-02-14 17:04:20,743 INFO success: fief-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-02-14 17:04:20,744 INFO success: fief-worker entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-02-14 17:04:20,744 INFO spawnerr: can't find command '/usr/local/bin/redis-server'
2024-02-14 17:04:22,745 INFO spawnerr: can't find command '/usr/local/bin/redis-server'
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
2024-02-14 17:04:25,894 INFO spawnerr: can't find command '/usr/local/bin/redis-server'
2024-02-14 17:04:25,895 INFO gave up: redis entered FATAL state, too many start retries too quickly
[2024-02-14 17:04:26,397] [PID 8] [MainThread] [dramatiq.MainProcess] [INFO] Dramatiq '1.14.2' is booting up.
2024-02-14 17:04:26.259 | INFO | fief.worker:<module>:19 - Fief Worker started - {"version": "0.27.0"}
2024-02-14 17:04:26.390 | INFO | dramatiq.cli:worker_process:412 - Worker process is ready for action. - {}
[2024-02-14 17:04:26,400] [PID 16] [MainThread] [dramatiq.ForkProcess(1)] [INFO] Fork process 'dramatiq.middleware.prometheus:_run_exposition_server' is ready for action.
2024-02-14 17:04:26.409 | CRITICAL | dramatiq.worker:run:276 - Consumer encountered a connection error: Error 111 connecting to localhost:6379. Connection refused. - {}
2024-02-14 17:04:26.409 | INFO | dramatiq.worker:run:288 - Restarting consumer in 3.00 seconds. - {}
2024-02-14 17:04:26.410 | CRITICAL | dramatiq.worker:run:276 - Consumer encountered a connection error: Error 111 connecting to localhost:6379. Connection refused. - {}
2024-02-14 17:04:26.410 | INFO | dramatiq.worker:run:288 - Restarting consumer in 3.00 seconds. - {}
Main Fief workspace already exists
Main Fief user already exists
Main Fief admin API key not provided in settings. Skipping its creation.
[2024-02-14 17:04:27,974] [PID 15] [MainThread] [dramatiq.ForkProcess(0)] [INFO] Fork process 'fief.scheduler:schedule' is ready for action.
[2024-02-14 17:04:27,978] [PID 15] [MainThread] [apscheduler.scheduler] [INFO] Adding job tentatively -- it will be properly scheduled when the scheduler starts
[2024-02-14 17:04:27,978] [PID 15] [MainThread] [apscheduler.scheduler] [INFO] Adding job tentatively -- it will be properly scheduled when the scheduler starts
[2024-02-14 17:04:27,979] [PID 15] [MainThread] [apscheduler.scheduler] [INFO] Added job "Actor.send" to job store "default"
[2024-02-14 17:04:27,980] [PID 15] [MainThread] [apscheduler.scheduler] [INFO] Added job "Actor.send" to job store "default"
[2024-02-14 17:04:27,980] [PID 15] [MainThread] [apscheduler.scheduler] [INFO] Scheduler started
2024-02-14 17:04:29.411 | CRITICAL | dramatiq.worker:run:276 - Consumer encountered a connection error: Error 111 connecting to localhost:6379. Connection refused. - {}
2024-02-14 17:04:29.412 | INFO | dramatiq.worker:run:288 - Restarting consumer in 3.00 seconds. - {}
2024-02-14 17:04:29.413 | CRITICAL | dramatiq.worker:run:276 - Consumer encountered a connection error: Error 111 connecting to localhost:6379. Connection refused. - {}
2024-02-14 17:04:29.413 | INFO | dramatiq.worker:run:288 - Restarting consumer in 3.00 seconds. - {}
INFO: Started server process [7]
INFO: Waiting for application startup.
2024-02-14 17:04:32.413 | CRITICAL | dramatiq.worker:run:276 - Consumer encountered a connection error: Error 111 connecting to localhost:6379. Connection refused. - {}
2024-02-14 17:04:32.413 | INFO | dramatiq.worker:run:288 - Restarting consumer in 3.00 seconds. - {}
2024-02-14 17:04:32.414 | CRITICAL | dramatiq.worker:run:276 - Consumer encountered a connection error: Error 111 connecting to localhost:6379. Connection refused. - {}
2024-02-14 17:04:32.414 | INFO | dramatiq.worker:run:288 - Restarting consumer in 3.00 seconds. - {}
2024-02-14 17:04:32.569 | INFO | fief.lifespan:lifespan:28 - Fief Server started - {"version": "0.27.0"}
2024-02-14 17:04:32.569 | WARNING | fief.lifespan:lifespan:31 - Telemetry is enabled.
We will collect data to better understand how Fief is used and improve the project.
You can opt-out by setting the environment variable `TELEMETRY_ENABLED=false`.
Read more about Fief's telemetry here: https://docs.fief.dev/telemetry - {}
2024-02-14 17:04:35.414 | CRITICAL | dramatiq.worker:run:276 - Consumer encountered a connection error: Error 111 connecting to localhost:6379. Connection refused. - {}
2024-02-14 17:04:35.414 | INFO | dramatiq.worker:run:288 - Restarting consumer in 3.00 seconds. - {}
2024-02-14 17:04:35.415 | CRITICAL | dramatiq.worker:run:276 - Consumer encountered a connection error: Error 111 connecting to localhost:6379. Connection refused. - {}
2024-02-14 17:04:35.415 | INFO | dramatiq.worker:run:288 - Restarting consumer in 3.00 seconds. - {}
```
|
Beta Was this translation helpful? Give feedback.
@louistransfer Nothing wrong with what you show me here. When accessing the root path
/
without a valid user session, Fief returns a redirection to/login
(hence the 307 status code). By default, cURL doesn't follow redirections. You can add the-L
flag to tell it to automatically follow redirections: https://everything.curl.dev/http/redirects#tell-curl-to-follow-redirects@MathieuGrosso Yes, normally that's something proxy are doing by default, this is quite standard. GCP docs even claim it's the case: https://cloud.google.com/load-balancing/docs/https
...
I just had another look at your Dockerfile. I see that you are copying a
.env
file. Are you settingFORWARDED_ALLOW_IPS
inside that f…