coollabsio / coolify

An open-source & self-hostable Heroku / Netlify / Vercel alternative.
https://coolify.io
Apache License 2.0
34.29k stars 1.86k forks source link

[Bug]: Nextjs App Auto deploying not working #2559

Open imaxisXD opened 4 months ago

imaxisXD commented 4 months ago

Description

I have recently switched to coolify and hosted my nextjs app but its not auto-deploying based on git commits

image image

As you can see both the commit-msg are different

Also, I have installed the git webhook still the issue is there

Minimal Reproduction (if possible, example repository)

Same step as ususall If want can provide the access to repousual

Exception or Error

No response

Version

v4.0.0-beta.297

sunipan commented 4 months ago

I'm having the same problem, I commit to my main branch (which the resource is set up on) and nothing happens to my deployments. Same version.

Manually redeploying does create an updated version

jonas-johansson commented 4 months ago

Where are you hosting?

Double-check that your server allows inbound traffic on port 8000 that GitHub uses to invoke the webhook.

mbeaudru commented 4 months ago

Maybe related to https://github.com/coollabsio/coolify/issues/2614

andrasbacsai commented 4 months ago

@imaxisXD Can you please show me this view? image

andrasbacsai commented 4 months ago

Where are you hosting?

Double-check that your server allows inbound traffic on port 8000 that GitHub uses to invoke the webhook.

Thanks @jonas-johansson.

To @sunipan: Just to make it clear, if you are using a domain, then port 8000 is not required. It depends on how you configured your GitHub App (to send webhooks on ip:port or domain).

Also, please open your GitHub App (you can navigate to it on the same view in my previous comment), and show me the failed webhooks.

ivanpajon commented 4 months ago

I'm facing the same issue. I have a private repo with a GitHub App configured. I'm using Cloudflare Tunnels. And whenever I push a commit it does not trigger any deployment.

In my coolify project I have this config: coolify-project-config

And in my Github App I have this webhook URL: github-app-config

I also tried to change the webhook URL to http://coolify.mydomain.com/api/v1/ and http://coolify.mydomain.com/ and neither works... I receive a 301 error in the events my github app send: image

kualta commented 3 months ago

was facing the same issue, had to remove resource with a public git repo and install a new private one with githup app and then it started working. getting webhook deployments now automatically, the repo is still public tho. port 8000 was open, too. not sure what was the issue with the default approach

amr3k commented 2 months ago

I'm facing the same issue. I have a private repo with a GitHub App configured. I'm using Cloudflare Tunnels. And whenever I push a commit it does not trigger any deployment.

In my coolify project I have this config: coolify-project-config

And in my Github App I have this webhook URL: github-app-config

I also tried to change the webhook URL to http://coolify.mydomain.com/api/v1/ and http://coolify.mydomain.com/ and neither works... I receive a 301 error in the events my github app send: image

I have the same setup and have the same issue. I have to manually click "redeploy" after each time I push to main branch.

ivanpajon commented 2 months ago

I finally found the solution (at least for the bug with Cloudflare configuration). Error 301 is caused due to webhooks not supporting redirections. By default, Github App created through Coolify sets all URLs with http, but Cloudflare redirects them to https and this is causing the 301 error. So the solution is going to Github App configuration and change all URLs pointing to our Coolify domain to https. I apply this and now it works perfect.

I hope this helps!

VipinGoyal commented 2 months ago

Im not getting any 301 error, but Im getting this message in github deliveries.

Nothing to do. No applications found with branch 'stage'.

Do, I need to change anything in source section for commit SHA, currently its set as HEAD.

image

My setup is also same i.e. using cloudflare tunnels to connect to my local server. Im also getting the same issue, i..e auto deploy not working. But manual deployment is working fine also Im able to fetch repository.

One thing I noticed is that, coolify is connected with github organization. I'm not able to open few github links from coolify, Im getting 404 for those links, its not mapping to proper github organisation. Not sure if this is related to this issue.

@andrasbacsai can you please help me into this, as auto deployment is the feature we really need, thanks :) Happy to debug along with you on this, if needed.

VipinGoyal commented 2 months ago

Im not getting any 301 error, but Im getting this message in github deliveries.

Nothing to do. No applications found with branch 'stage'.

Do, I need to change anything in source section for commit SHA, currently its set as HEAD.

image

My setup is also same i.e. using cloudflare tunnels to connect to my local server. Im also getting the same issue, i..e auto deploy not working. But manual deployment is working fine also Im able to fetch repository.

One thing I noticed is that, coolify is connected with github organization. I'm not able to open few github links from coolify, Im getting 404 for those links, its not mapping to proper github organisation. Not sure if this is related to this issue.

@andrasbacsai can you please help me into this, as auto deployment is the feature we really need, thanks :) Happy to debug along with you on this, if needed.

This one is fixed, what I did, I created project again with stage branch, earlier I created project with main branch and changed the branch in settings probably thats why this issue occurred.

andrasbacsai commented 2 months ago

occurred.

Oh! I need to test this!