Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Appwrite redirect loop #4332

Open
teknology opened this issue Nov 19, 2024 · 19 comments
Open

[Bug]: Appwrite redirect loop #4332

teknology opened this issue Nov 19, 2024 · 19 comments
Labels
🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization.

Comments

@teknology
Copy link

Error Message and Logs

There seems to be a redirect loop preventing Appwrite from loading from the generated url.

Steps to Reproduce

  1. Install Appwrite from the resource catalog
  2. Deploy
  3. Try to access the generated link from the link dropdown.

Example Repository URL

No response

Coolify Version

v4.0.0-beta.370

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

Debian 12

Additional Information

It doesn't matter of it's a generated url with a private domain or a sslip.io. Both results in a redirect loop.

@teknology teknology added 🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization. labels Nov 19, 2024
@djsisson
Copy link
Contributor

@teknology untick strip prefix in console and realtime settings

@teknology
Copy link
Author

@teknology untick strip prefix in console and realtime settings

That didn't solve the issue. It resulted in Realtime link reporting a 400 bad request and console still has a redirect loop.

@ChristophJeworutzki
Copy link

ChristophJeworutzki commented Nov 19, 2024

+1
I'm facing the exact same issue as described by @teknology

@teknology
Copy link
Author

+1 I'm facing the exact same issue as described by @teknology

I switched the proxy to Traefek. I was told Caddy has a bug waiting to merge.

@Shadowfita
Copy link

Also experiencing this issue using Caddy. Hopefully resolved soon.

@alexaka1
Copy link

Just as a sanity check, are you sure you are not hitting this issue: https://coolify.io/docs/knowledge-base/faq#too-many-redirections ?

@voglster
Copy link

TLDR Same issue, brand new setup clean vps and appwrite only app setup but other apps work fine (dashy)

If anyone wants to debug I am technical enough to help.

I am very new to coolify (came from caprover) so entirely possible that I missed something but the the first app i tried to deploy was Appwrite and hit a redirect loop. However doing the exact same setup with dashy everything works out of the box.

im guessing something awry with appwrites internal nginx vs traefic and passing path rewrites etc...

curl log of redirect loop (ip/domain changed for obvious reasons)

$ curl -I -L --max-redirs 3 -v https://appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com/console                                                               
*   Trying xxx.xxx.xx.xxx:443...
* Connected to appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com (xxx.xxx.xxx.xxx) port 443 (#0)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com
*  start date: Nov 24 03:57:24 2024 GMT
*  expire date: Feb 22 03:57:23 2025 GMT
*  subjectAltName: host "appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com" matched cert's "appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com"
*  issuer: C=US; O=Let's Encrypt; CN=R11
*  SSL certificate verify ok.
* using HTTP/2
* h2h3 [:method: HEAD]
* h2h3 [:path: /console]
* h2h3 [:scheme: https]
* h2h3 [:authority: appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com]
* h2h3 [user-agent: curl/7.88.1]
* h2h3 [accept: */*]
* Using Stream ID: 1 (easy handle 0x5585e7a58ce0)
> HEAD /console HTTP/2
> Host: appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com
> user-agent: curl/7.88.1
> accept: */*
> 
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
< HTTP/2 301 
HTTP/2 301 
< alt-svc: h3=":443"; ma=2592000
alt-svc: h3=":443"; ma=2592000
< content-type: text/html
content-type: text/html
< date: Sun, 24 Nov 2024 05:00:03 GMT
date: Sun, 24 Nov 2024 05:00:03 GMT
< location: /console
location: /console
< server: nginx/1.25.5
server: nginx/1.25.5
< content-length: 169
content-length: 169

< 
* Connection #0 to host appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com left intact
* Issue another request to this URL: 'https://appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com/console'
* Found bundle for host: 0x5585e7a55160 [can multiplex]
* Re-using existing connection #0 with host appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com
* h2h3 [:method: HEAD]
* h2h3 [:path: /console]
* h2h3 [:scheme: https]
* h2h3 [:authority: appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com]
* h2h3 [user-agent: curl/7.88.1]
* h2h3 [accept: */*]
* Using Stream ID: 3 (easy handle 0x5585e7a58ce0)
> HEAD /console HTTP/2
> Host: appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com
> user-agent: curl/7.88.1
> accept: */*
> 
< HTTP/2 301 
HTTP/2 301 
< alt-svc: h3=":443"; ma=2592000
alt-svc: h3=":443"; ma=2592000
< content-type: text/html
content-type: text/html
< date: Sun, 24 Nov 2024 05:00:04 GMT
date: Sun, 24 Nov 2024 05:00:04 GMT
< location: /console
location: /console
< server: nginx/1.25.5
server: nginx/1.25.5
< content-length: 169
content-length: 169

< 
* Connection #0 to host appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com left intact
* Issue another request to this URL: 'https://appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com/console'
* Found bundle for host: 0x5585e7a55160 [can multiplex]
* Re-using existing connection #0 with host appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com
* h2h3 [:method: HEAD]
* h2h3 [:path: /console]
* h2h3 [:scheme: https]
* h2h3 [:authority: appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com]
* h2h3 [user-agent: curl/7.88.1]
* h2h3 [accept: */*]
* Using Stream ID: 5 (easy handle 0x5585e7a58ce0)
> HEAD /console HTTP/2
> Host: appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com
> user-agent: curl/7.88.1
> accept: */*
> 
< HTTP/2 301 
HTTP/2 301 
< alt-svc: h3=":443"; ma=2592000
alt-svc: h3=":443"; ma=2592000
< content-type: text/html
content-type: text/html
< date: Sun, 24 Nov 2024 05:00:04 GMT
date: Sun, 24 Nov 2024 05:00:04 GMT
< location: /console
location: /console
< server: nginx/1.25.5
server: nginx/1.25.5
< content-length: 169
content-length: 169

< 
* Connection #0 to host appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com left intact
* Issue another request to this URL: 'https://appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com/console'
* Found bundle for host: 0x5585e7a55160 [can multiplex]
* Re-using existing connection #0 with host appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com
* h2h3 [:method: HEAD]
* h2h3 [:path: /console]
* h2h3 [:scheme: https]
* h2h3 [:authority: appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com]
* h2h3 [user-agent: curl/7.88.1]
* h2h3 [accept: */*]
* Using Stream ID: 7 (easy handle 0x5585e7a58ce0)
> HEAD /console HTTP/2
> Host: appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com
> user-agent: curl/7.88.1
> accept: */*
> 
< HTTP/2 301 
HTTP/2 301 
< alt-svc: h3=":443"; ma=2592000
alt-svc: h3=":443"; ma=2592000
< content-type: text/html
content-type: text/html
< date: Sun, 24 Nov 2024 05:00:04 GMT
date: Sun, 24 Nov 2024 05:00:04 GMT
< location: /console
location: /console
< server: nginx/1.25.5
server: nginx/1.25.5
< content-length: 169
content-length: 169

< 
* Connection #0 to host appwrite-uk0w0w48sowsowgk0w4kowo0.cld3.example.com left intact
* Maximum (3) redirects followed
curl: (47) Maximum (3) redirects followed

@voglster
Copy link

voglster commented Nov 24, 2024

Unticking strip prefixes does indeed fix it (when unticked for all 3 web exposed services)

Image

@Shadowfita
Copy link

Unfortunately, I've not had any success with unticking "Strip Prefixes". The issue persists with too many redirects.

@bizrockman
Copy link

Waited for the update to 370 to see if that error persists. And it does. I set it up with the default template provided with coolify now. Getting the same error of to many redirects.

With a clean setup. Using defaults.

@djsisson
Copy link
Contributor

@bizrockman what proxy are you using?

p.s you still need to untick strip prefixes

@bizrockman
Copy link

@bizrockman what proxy are you using?

p.s you still need to untick strip prefixes

Hi, I am using Traefik.

The option strip prefixes is not available. I am using the template that got shipped with coolify.
Maybe I do not see it. Where should I search?

@djsisson
Copy link
Contributor

@bizrockman click settings on realtime and on console

@bizrockman
Copy link

@bizrockman click settings on realtime and on console

Ok thanks. Both a ticked by default.

@djsisson
Copy link
Contributor

@bizrockman it needs to be unticked

@bizrockman
Copy link

@bizrockman it needs to be unticked

I see. I have unticked the setting.
Restarted the service.
Cleared browser cache/cookies

Do not untick the main domain of service "Appwrite".

And now it is running.

Thanks!! @djsisson

@Shadowfita
Copy link

Unfortunately, the workarounds above don't seem to work with the caddy proxy.

@djsisson
Copy link
Contributor

@Shadowfita caddy proxy i believe has just been fixed, so it should work now in 372?

@VolenBE
Copy link

VolenBE commented Nov 27, 2024

Unticking worked for me, I don't know if it's possible for coolify devs to do it, but maybe make sure they are not ticked by default?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization.
Projects
None yet
Development

No branches or pull requests

8 participants