predragnikolic
predragnikolic
Explore posts from servers
DDokploy
Created by predragnikolic on 9/12/2024 in #help
Restarting a server causes deployment to run again
Yes, building the app is CPU intensive, I need to scale the server instance up in order to build the app when I want to deploy a new version.
9 replies
DDokploy
Created by predragnikolic on 9/12/2024 in #help
Restarting a server causes deployment to run again
https://docs.bullmq.io/bull/important-notes Maybe I hit this:
It's important to understand how locking works to prevent your jobs from losing their lock - becoming stalled - and being restarted as a result. ... Your job processor was too CPU-intensive and stalled the Node event loop, and as a result, Bull couldn't renew the job lock (see #488 for how we might better detect this). You can fix this by breaking your job processor into smaller parts so that no single part can block the Node event loop. Alternatively, you can pass a larger value for the lockDuration setting (with the tradeoff being that it will take longer to recognize a real stalled job).
9 replies
DDokploy
Created by predragnikolic on 9/12/2024 in #help
Restarting a server causes deployment to run again
I am not sure if it is better to be explicitly tell BullMQ that a job finished successfully by doing:
const worker = new Worker('my-queue', async job => {
try {
// Process the job...
await someProcessingFunction(job);

// Manually mark the job as completed
await job.moveToCompleted('done', true); // 'done' is the result,
const worker = new Worker('my-queue', async job => {
try {
// Process the job...
await someProcessingFunction(job);

// Manually mark the job as completed
await job.moveToCompleted('done', true); // 'done' is the result,
or by putting a check like this(but I would rather fix the bug in the root, rather that putting a check like this)
if (job.data.type === "deploy" || job.data.type === "redeploy") {
const currentDeployment = await findDeploymentById(job.data.deploymentId);
if (currentDeployment.status === "done") {
console.log("Deployment already completed, skipping...");
return;
}
// Continue with deployment or redeployment
}
if (job.data.type === "deploy" || job.data.type === "redeploy") {
const currentDeployment = await findDeploymentById(job.data.deploymentId);
if (currentDeployment.status === "done") {
console.log("Deployment already completed, skipping...");
return;
}
// Continue with deployment or redeployment
}
9 replies
DDokploy
Created by predragnikolic on 9/12/2024 in #help
Restarting a server causes deployment to run again
// server.ts
app.prepare().then(async () => {
try {
// ... other code
server.listen(PORT);
console.log("Server Started:", PORT);
deploymentWorker.run(); // here the worker is run at startup
} catch (e) {
console.error("Main Server Error", e);
}
});
// server.ts
app.prepare().then(async () => {
try {
// ... other code
server.listen(PORT);
console.log("Server Started:", PORT);
deploymentWorker.run(); // here the worker is run at startup
} catch (e) {
console.error("Main Server Error", e);
}
});
9 replies
DDokploy
Created by predragnikolic on 9/12/2024 in #help
Restarting a server causes deployment to run again
This code here looks like it might cause this:
export const deploymentWorker = new Worker(
"deployments",
async (job: Job<DeploymentJob>) => {
try {
if (job.data.applicationType === "application") {
await updateApplicationStatus(job.data.applicationId, "running");
if (job.data.type === "redeploy") {
await rebuildApplication({
applicationId: job.data.applicationId,
titleLog: job.data.titleLog,
descriptionLog: job.data.descriptionLog,
});
} else if (job.data.type === "deploy") {
await deployApplication({
applicationId: job.data.applicationId,
titleLog: job.data.titleLog,
descriptionLog: job.data.descriptionLog,
});
}
} else if (job.data.applicationType === "compose") {
await updateCompose(job.data.composeId, {
composeStatus: "running",
});
export const deploymentWorker = new Worker(
"deployments",
async (job: Job<DeploymentJob>) => {
try {
if (job.data.applicationType === "application") {
await updateApplicationStatus(job.data.applicationId, "running");
if (job.data.type === "redeploy") {
await rebuildApplication({
applicationId: job.data.applicationId,
titleLog: job.data.titleLog,
descriptionLog: job.data.descriptionLog,
});
} else if (job.data.type === "deploy") {
await deployApplication({
applicationId: job.data.applicationId,
titleLog: job.data.titleLog,
descriptionLog: job.data.descriptionLog,
});
}
} else if (job.data.applicationType === "compose") {
await updateCompose(job.data.composeId, {
composeStatus: "running",
});
9 replies
DDokploy
Created by predragnikolic on 9/12/2024 in #help
Restarting a server causes deployment to run again
[
// .. other data
{
"result": {
"data": {
"json": [
{ // <-- notice this new deployment being created automatically on Dokploy startup
"deploymentId": "14d4DwUlQhyPn3jIqTEZx",
"title": "remove newline",
"description": "Hash: f3a3fdb16bad9ed72081c4c416bd997078b82805",
"status": "running",
"logPath": "/etc/dokploy/logs/xyz-4468ea/xyz-4468ea-2024-09-12:18:05:46.log",
"applicationId": "KorYNyEwh0g2j4zWETFsf",
"composeId": null,
"createdAt": "2024-09-12T18:05:46.069Z"
},
{
"deploymentId": "m9vhDhIEJsx3WuUJAjdpP",
"title": "remove newline",
"description": "Hash: f3a3fdb16bad9ed72081c4c416bd997078b82805",
"status": "done",
"logPath": "/etc/dokploy/logs/xyz-4468ea/xyz-4468ea-2024-09-12:17:57:35.log",
"applicationId": "KorYNyEwh0g2j4zWETFsf",
"composeId": null,
"createdAt": "2024-09-12T17:57:35.347Z"
},
[
// .. other data
{
"result": {
"data": {
"json": [
{ // <-- notice this new deployment being created automatically on Dokploy startup
"deploymentId": "14d4DwUlQhyPn3jIqTEZx",
"title": "remove newline",
"description": "Hash: f3a3fdb16bad9ed72081c4c416bd997078b82805",
"status": "running",
"logPath": "/etc/dokploy/logs/xyz-4468ea/xyz-4468ea-2024-09-12:18:05:46.log",
"applicationId": "KorYNyEwh0g2j4zWETFsf",
"composeId": null,
"createdAt": "2024-09-12T18:05:46.069Z"
},
{
"deploymentId": "m9vhDhIEJsx3WuUJAjdpP",
"title": "remove newline",
"description": "Hash: f3a3fdb16bad9ed72081c4c416bd997078b82805",
"status": "done",
"logPath": "/etc/dokploy/logs/xyz-4468ea/xyz-4468ea-2024-09-12:17:57:35.log",
"applicationId": "KorYNyEwh0g2j4zWETFsf",
"composeId": null,
"createdAt": "2024-09-12T17:57:35.347Z"
},
I do not understand why that happens.
9 replies
DDokploy
Created by predragnikolic on 9/12/2024 in #help
Restarting a server causes deployment to run again
While having dokploy dashboard open, and the network tab open. When I turn off the server on Hetzner and turn it on, I will that Dokply sends the following request at some interval, https://dokploy.xyz.com/api/trpc/auth.get,application.one,deployment.all I will see a few responses with status 527 from CloudFlare in the network panel than a few 502, than I can see the response:
[
// .. other data
{
"result": {
"data": {
"json": [
{
"deploymentId": "m9vhDhIEJsx3WuUJAjdpP",
"title": "remove newline",
"description": "Hash: f3a3fdb16bad9ed72081c4c416bd997078b82805",
"status": "done",
"logPath": "/etc/dokploy/logs/xyz-4468ea/xyz-4468ea-2024-09-12:17:57:35.log",
"applicationId": "KorYNyEwh0g2j4zWETFsf",
"composeId": null,
"createdAt": "2024-09-12T17:57:35.347Z"
},

[
// .. other data
{
"result": {
"data": {
"json": [
{
"deploymentId": "m9vhDhIEJsx3WuUJAjdpP",
"title": "remove newline",
"description": "Hash: f3a3fdb16bad9ed72081c4c416bd997078b82805",
"status": "done",
"logPath": "/etc/dokploy/logs/xyz-4468ea/xyz-4468ea-2024-09-12:17:57:35.log",
"applicationId": "KorYNyEwh0g2j4zWETFsf",
"composeId": null,
"createdAt": "2024-09-12T17:57:35.347Z"
},

then when the app calls https://dokploy.xyz.com/api/trpc/auth.get,application.one,deployment.all again it will create a new deployment: https://dokploy.xyz.com/api/trpc/auth.get,application.one,deployment.all
9 replies
DDokploy
Created by predragnikolic on 8/28/2024 in #help
Cannot access Dokploy dashboard on domain. How can I debug CloudFlare bad gateway error?
I think I will just reinstall Dokploy
12 replies
DDokploy
Created by predragnikolic on 8/28/2024 in #help
Cannot access Dokploy dashboard on domain. How can I debug CloudFlare bad gateway error?
Well I f*** up
12 replies
DDokploy
Created by predragnikolic on 8/28/2024 in #help
Cannot access Dokploy dashboard on domain. How can I debug CloudFlare bad gateway error?
12 replies
DDokploy
Created by predragnikolic on 8/28/2024 in #help
Cannot access Dokploy dashboard on domain. How can I debug CloudFlare bad gateway error?
Here is how the /etc/traefik/traefik.yml looks like
providers:
docker:
exposedByDefault: false
file:
directory: /etc/dokploy/traefik/dynamic
watch: true
entryPoints:
web:
address: ':80'
websecure:
address: ':443'
http:
tls:
certResolver: letsencrypt
api:
insecure: true
certificatesResolvers:
letsencrypt:
acme:
storage: /etc/dokploy/traefik/dynamic/acme.json
httpChallenge:
entryPoint: web
providers:
docker:
exposedByDefault: false
file:
directory: /etc/dokploy/traefik/dynamic
watch: true
entryPoints:
web:
address: ':80'
websecure:
address: ':443'
http:
tls:
certResolver: letsencrypt
api:
insecure: true
certificatesResolvers:
letsencrypt:
acme:
storage: /etc/dokploy/traefik/dynamic/acme.json
httpChallenge:
entryPoint: web
12 replies
DDokploy
Created by predragnikolic on 8/28/2024 in #help
Cannot access Dokploy dashboard on domain. How can I debug CloudFlare bad gateway error?
Here are the things running on port 80, 443, 8080:
root@knjizara-server:~# sudo lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
docker-pr 1727 root 4u IPv4 10037 0t0 TCP *:http (LISTEN)
docker-pr 1739 root 4u IPv6 10042 0t0 TCP *:http (LISTEN)
root@knjizara-server:~# sudo lsof -i :443
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
docker-pr 1603 root 4u IPv4 10532 0t0 TCP *:https (LISTEN)
docker-pr 1613 root 4u IPv6 9911 0t0 TCP *:https (LISTEN)
root@knjizara-server:~# sudo lsof -i :8080
root@knjizara-server:~#
root@knjizara-server:~# sudo lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
docker-pr 1727 root 4u IPv4 10037 0t0 TCP *:http (LISTEN)
docker-pr 1739 root 4u IPv6 10042 0t0 TCP *:http (LISTEN)
root@knjizara-server:~# sudo lsof -i :443
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
docker-pr 1603 root 4u IPv4 10532 0t0 TCP *:https (LISTEN)
docker-pr 1613 root 4u IPv6 9911 0t0 TCP *:https (LISTEN)
root@knjizara-server:~# sudo lsof -i :8080
root@knjizara-server:~#
12 replies
DDokploy
Created by predragnikolic on 8/28/2024 in #help
Cannot access Dokploy dashboard on domain. How can I debug CloudFlare bad gateway error?
Here is a prettified version of the logs:
"Error while starting server: accept tcp [::]:80: use of closed network connection" entryPointName=web
"accept tcp [::]:8080: use of closed network connection" entryPointName=traefik
"accept tcp [::]:443: use of closed network connection" entryPointName=websecure
"Error while starting server: accept tcp [::]:443: use of closed network connection" entryPointName=websecure
"close tcp [::]:8080: use of closed network connection" entryPointName=traefik
Configuration loaded from file: /etc/traefik/traefik.yml
"Error while starting server: accept tcp [::]:80: use of closed network connection" entryPointName=web
"accept tcp [::]:8080: use of closed network connection" entryPointName=traefik
"accept tcp [::]:443: use of closed network connection" entryPointName=websecure
"Error while starting server: accept tcp [::]:443: use of closed network connection" entryPointName=websecure
"close tcp [::]:8080: use of closed network connection" entryPointName=traefik
Configuration loaded from file: /etc/traefik/traefik.yml
12 replies
DDokploy
Created by predragnikolic on 8/28/2024 in #help
Cannot access Dokploy dashboard on domain. How can I debug CloudFlare bad gateway error?
Here is the output of docker service logs dokploy-traefik
dokploy-traefik.1.ux806yn2ff9q@knjizara-server | time="2024-08-28T13:41:35Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
dokploy-traefik.1.1v6jrrzzjljy@knjizara-server | time="2024-08-28T13:58:56Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
dokploy-traefik.1.rm9x102xksek@knjizara-server | time="2024-08-28T13:47:47Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:35:48Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="accept tcp [::]:80: use of closed network connection" entryPointName=web
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="Error while starting server: accept tcp [::]:80: use of closed network connection" entryPointName=web
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="accept tcp [::]:8080: use of closed network connection" entryPointName=traefik
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="accept tcp [::]:443: use of closed network connection" entryPointName=websecure
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="Error while starting server: accept tcp [::]:443: use of closed network connection" entryPointName=websecure
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="close tcp [::]:8080: use of closed network connection" entryPointName=traefik
dokploy-traefik.1.l9bc0joduama@knjizara-server | time="2024-08-28T12:46:55Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
dokploy-traefik.1.ux806yn2ff9q@knjizara-server | time="2024-08-28T13:41:35Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
dokploy-traefik.1.1v6jrrzzjljy@knjizara-server | time="2024-08-28T13:58:56Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
dokploy-traefik.1.rm9x102xksek@knjizara-server | time="2024-08-28T13:47:47Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:35:48Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="accept tcp [::]:80: use of closed network connection" entryPointName=web
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="Error while starting server: accept tcp [::]:80: use of closed network connection" entryPointName=web
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="accept tcp [::]:8080: use of closed network connection" entryPointName=traefik
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="accept tcp [::]:443: use of closed network connection" entryPointName=websecure
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="Error while starting server: accept tcp [::]:443: use of closed network connection" entryPointName=websecure
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="close tcp [::]:8080: use of closed network connection" entryPointName=traefik
dokploy-traefik.1.l9bc0joduama@knjizara-server | time="2024-08-28T12:46:55Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
12 replies
DDokploy
Created by predragnikolic on 8/28/2024 in #help
Cannot access Dokploy dashboard on domain. How can I debug CloudFlare bad gateway error?
Thank you @Bunny @Siumauricio unfortunately in turn of events, I won't be able to try you suggestion until next week.
12 replies
DDokploy
Created by Spein on 8/9/2024 in #help
idn domains
This PR should fix this
4 replies
DDokploy
Created by Spein on 8/9/2024 in #help
idn domains
4 replies
DDokploy
Created by Pascal on 7/31/2024 in #help
No-WWW to WWW Rederict
The link that i pasted doesn't lead to the thing i wanted to link. Please, just search for /$%7B1%7D in traefik issues, and you should see 3 related issues.
5 replies
DDokploy
Created by Pascal on 7/31/2024 in #help
No-WWW to WWW Rederict
It may not be related to cloudflare, it might be related to traefik, see related issues https://github.com/traefik/traefik/issues?q=is%3Aissue+%2F%24%257B1%257D+is%3Aclosed
5 replies
DDokploy
Created by predragnikolic on 8/6/2024 in #help
How to run npm commands in the container
16 replies