[{"data":1,"prerenderedAt":2253},["ShallowReactive",2],{"navigation":3,"/docs/server-access/troubleshooting-your-application":285,"/docs/server-access/troubleshooting-your-application-surround":2248},[4],{"title":5,"path":6,"stem":7,"children":8},"Introduction","/docs","docs/1.index",[9,10,36,53,70,83,100,121,138,155,176],{"title":5,"path":6,"stem":7},{"title":11,"path":12,"stem":13,"children":14,"page":35},"Installation","/docs/installation","docs/1.installation",[15,19,23,27,31],{"title":16,"path":17,"stem":18},"Install to macOS","/docs/installation/install-macos","docs/1.installation/1.install-macos",{"title":20,"path":21,"stem":22},"Install to Windows","/docs/installation/install-windows","docs/1.installation/2.install-windows",{"title":24,"path":25,"stem":26},"Install to Linux","/docs/installation/install-linux","docs/1.installation/3.install-linux",{"title":28,"path":29,"stem":30},"Install via Composer","/docs/installation/install-composer","docs/1.installation/4.install-composer",{"title":32,"path":33,"stem":34},"Install via NPM/Yarn","/docs/installation/install-npm-yarn","docs/1.installation/5.install-npm-yarn",false,{"title":37,"path":38,"stem":39,"children":40,"page":35},"Community","/docs/community","docs/11.community",[41,45,49],{"title":42,"path":43,"stem":44},"Get Help","/docs/community/get-help","docs/11.community/1.get-help",{"title":46,"path":47,"stem":48},"Testing New Releases","/docs/community/testing","docs/11.community/2.testing",{"title":50,"path":51,"stem":52},"Contributing","/docs/community/contributing","docs/11.community/3.contributing",{"title":54,"path":55,"stem":56,"children":57,"page":35},"Getting Started","/docs/getting-started","docs/2.getting-started",[58,62,66],{"title":59,"path":60,"stem":61},"How Spin Works","/docs/getting-started/how-spin-works","docs/2.getting-started/1.how-spin-works",{"title":63,"path":64,"stem":65},"Create a New Project with Spin","/docs/getting-started/create-a-new-project-with-spin","docs/2.getting-started/2.create-a-new-project-with-spin",{"title":67,"path":68,"stem":69},"Add Spin to an Existing Project","/docs/getting-started/add-spin-to-an-existing-project","docs/2.getting-started/3.add-spin-to-an-existing-project",{"title":71,"path":72,"stem":73,"children":74,"page":35},"Development Environment","/docs/development-environment","docs/3.development-environment",[75,79],{"title":76,"path":77,"stem":78},"Starting Up Your Development Environment","/docs/development-environment/starting-up-your-development-environment","docs/3.development-environment/1.starting-up-your-development-environment",{"title":80,"path":81,"stem":82},"Running Commands in Development","/docs/development-environment/running-commands-in-development","docs/3.development-environment/2.running-commands-in-development",{"title":84,"path":85,"stem":86,"children":87,"page":35},"Server Configuration","/docs/server-configuration","docs/4.server-configuration",[88,92,96],{"title":89,"path":90,"stem":91},"Server Requirements","/docs/server-configuration/server-requirements","docs/4.server-configuration/1.server-requirements",{"title":93,"path":94,"stem":95},"Server Configuration Basics","/docs/server-configuration/server-configuration-basics","docs/4.server-configuration/2.server-configuration-basics",{"title":97,"path":98,"stem":99},".spin.yml Usage","/docs/server-configuration/spin-yml-usage","docs/4.server-configuration/3.spin-yml-usage",{"title":101,"path":102,"stem":103,"children":104,"page":35},"Providers","/docs/providers","docs/5.providers",[105,109,113,117],{"title":106,"path":107,"stem":108},"DigitalOcean","/docs/providers/digitalocean","docs/5.providers/0.digitalocean",{"title":110,"path":111,"stem":112},"Hetzner","/docs/providers/hetzner","docs/5.providers/0.hetzner",{"title":114,"path":115,"stem":116},"Vultr","/docs/providers/vultr","docs/5.providers/0.vultr",{"title":118,"path":119,"stem":120},"Use Any Host","/docs/providers/use-any-host","docs/5.providers/99.use-any-host",{"title":122,"path":123,"stem":124,"children":125,"page":35},"Deployment","/docs/deployment","docs/6.deployment",[126,130,134],{"title":127,"path":128,"stem":129},"Choosing a Deployment Strategy","/docs/deployment/choosing-a-deployment-strategy","docs/6.deployment/1.choosing-a-deployment-strategy",{"title":131,"path":132,"stem":133},"Automated Deployments with GitHub Actions","/docs/deployment/automated-deployments-with-github-actions","docs/6.deployment/2.automated-deployments-with-github-actions",{"title":135,"path":136,"stem":137},"Using \"spin deploy\"","/docs/deployment/using-spin-deploy","docs/6.deployment/3.using-spin-deploy",{"title":139,"path":140,"stem":141,"children":142,"page":35},"Server Access","/docs/server-access","docs/7.server-access",[143,147,151],{"title":144,"path":145,"stem":146},"Connecting to Your Server","/docs/server-access/connecting-to-your-server","docs/7.server-access/1.connecting-to-your-server",{"title":148,"path":149,"stem":150},"Troubleshooting Your Application","/docs/server-access/troubleshooting-your-application","docs/7.server-access/2.troubleshooting-your-application",{"title":152,"path":153,"stem":154},"Updating Your Server","/docs/server-access/updating-your-server","docs/7.server-access/3.updating-your-server",{"title":156,"path":157,"stem":158,"children":159,"page":35},"Advanced","/docs/advanced","docs/8.advanced",[160,164,168,172],{"title":161,"path":162,"stem":163},"Generating a Secure SSH Key","/docs/advanced/generating-a-secure-ssh-key","docs/8.advanced/2.generating-a-secure-ssh-key",{"title":165,"path":166,"stem":167},"Adding Other Services","/docs/advanced/adding-other-services","docs/8.advanced/3.adding-other-services",{"title":169,"path":170,"stem":171},"Create your own Spin Template","/docs/advanced/create-your-own-template","docs/8.advanced/99.create-your-own-template",{"title":173,"path":174,"stem":175},"Migrating from Spin v2 to v3","/docs/advanced/migrating-from-spin-v2-to-v3","docs/8.advanced/migrating-from-spin-v2-to-v3",{"title":177,"path":178,"stem":179,"children":180,"page":35},"Command Reference","/docs/command-reference","docs/9.command-reference",[181,185,189,193,197,201,205,209,213,217,221,225,229,233,237,241,245,249,253,257,261,265,269,273,277,281],{"title":182,"path":183,"stem":184},"base64","/docs/command-reference/base64","docs/9.command-reference/base64",{"title":186,"path":187,"stem":188},"build","/docs/command-reference/build","docs/9.command-reference/build",{"title":190,"path":191,"stem":192},"configure","/docs/command-reference/configure","docs/9.command-reference/configure",{"title":194,"path":195,"stem":196},"debug","/docs/command-reference/debug","docs/9.command-reference/debug",{"title":198,"path":199,"stem":200},"deploy","/docs/command-reference/deploy","docs/9.command-reference/deploy",{"title":202,"path":203,"stem":204},"down","/docs/command-reference/down","docs/9.command-reference/down",{"title":206,"path":207,"stem":208},"exec","/docs/command-reference/exec","docs/9.command-reference/exec",{"title":210,"path":211,"stem":212},"gh","/docs/command-reference/gh","docs/9.command-reference/gh",{"title":214,"path":215,"stem":216},"help","/docs/command-reference/help","docs/9.command-reference/help",{"title":218,"path":219,"stem":220},"init","/docs/command-reference/init","docs/9.command-reference/init",{"title":222,"path":223,"stem":224},"kill","/docs/command-reference/kill","docs/9.command-reference/kill",{"title":226,"path":227,"stem":228},"latest","/docs/command-reference/latest","docs/9.command-reference/latest",{"title":230,"path":231,"stem":232},"logs","/docs/command-reference/logs","docs/9.command-reference/logs",{"title":234,"path":235,"stem":236},"maintain","/docs/command-reference/maintain","docs/9.command-reference/maintain",{"title":238,"path":239,"stem":240},"mkpasswd","/docs/command-reference/mkpasswd","docs/9.command-reference/mkpasswd",{"title":242,"path":243,"stem":244},"new","/docs/command-reference/new","docs/9.command-reference/new",{"title":246,"path":247,"stem":248},"provision","/docs/command-reference/provision","docs/9.command-reference/provision",{"title":250,"path":251,"stem":252},"prune","/docs/command-reference/prune","docs/9.command-reference/prune",{"title":254,"path":255,"stem":256},"ps","/docs/command-reference/ps","docs/9.command-reference/ps",{"title":258,"path":259,"stem":260},"pull","/docs/command-reference/pull","docs/9.command-reference/pull",{"title":262,"path":263,"stem":264},"run","/docs/command-reference/run","docs/9.command-reference/run",{"title":266,"path":267,"stem":268},"stop","/docs/command-reference/stop","docs/9.command-reference/stop",{"title":270,"path":271,"stem":272},"up","/docs/command-reference/up","docs/9.command-reference/up",{"title":274,"path":275,"stem":276},"update","/docs/command-reference/update","docs/9.command-reference/update",{"title":278,"path":279,"stem":280},"vault","/docs/command-reference/vault","docs/9.command-reference/vault",{"title":282,"path":283,"stem":284},"version","/docs/command-reference/version","docs/9.command-reference/version",{"id":286,"title":148,"body":287,"canonical":2239,"description":2240,"extension":2241,"layout":2242,"meta":2243,"navigation":505,"path":149,"seo":2246,"stem":150,"__hash__":2247},"docs/docs/7.server-access/2.troubleshooting-your-application.md",{"type":288,"value":289,"toc":2211},"minimark",[290,297,308,313,316,346,355,359,362,371,402,409,413,416,435,453,546,549,619,625,639,643,646,667,671,678,793,796,800,803,819,822,827,879,883,886,894,899,906,914,918,933,944,959,986,997,1025,1032,1052,1055,1058,1066,1082,1086,1095,1104,1300,1305,1315,1330,1336,1340,1354,1357,1414,1417,1420,1445,1456,1460,1463,1494,1505,1524,1527,1531,1537,1585,1589,1600,1620,1626,1630,1640,1660,1668,1672,1682,1702,1710,1714,1724,1744,1748,1755,1773,1780,1783,1787,1793,1800,1805,1959,1962,1966,1969,1980,1983,1990,2000,2060,2098,2102,2105,2108,2125,2131,2146,2151,2177,2181,2187,2201,2207],[291,292,293],"lead-p",{},[294,295,296],"p",{},"If you're reading this document, it probably means you're quite frustrated and looking for answers. In this guide, we'll give you some common troubleshooting tips and help you get back on track.",[298,299,300],"note",{},[294,301,302,303,307],{},"Before running any of these commands, you'll need to ",[304,305,306],"a",{"href":145},"connect to your server",".",[309,310,312],"h2",{"id":311},"view-docker-services","View Docker Services",[294,314,315],{},"Whenever you deploy a container with Docker, they are grouped into units called \"services\". Services could be things like databases, web servers, queues, etc.",[317,318,324],"pre",{"className":319,"code":320,"filename":321,"language":322,"meta":323,"style":323},"language-bash shiki shiki-themes material-theme-lighter github-dark github-dark","sudo docker service ls\n","View Docker services","bash","",[325,326,327],"code",{"__ignoreMap":323},[328,329,332,336,340,343],"span",{"class":330,"line":331},"line",1,[328,333,335],{"class":334},"soiBB","sudo",[328,337,339],{"class":338},"s0vBq"," docker",[328,341,342],{"class":338}," service",[328,344,345],{"class":338}," ls\n",[294,347,348],{},[304,349,354],{"href":350,"rel":351,"target":353},"https://docs.docker.com/reference/cli/docker/service/ls/",[352],"nofollow","_blank","Learn more about \"docker service ls\" →",[309,356,358],{"id":357},"view-docker-service-logs","View Docker Service Logs",[294,360,361],{},"When you list out your services, you can now view the logs of that service.",[298,363,364],{},[294,365,366,367,370],{},"If you want to view the logs in real-time, you can use the ",[325,368,369],{},"-f"," flag.",[317,372,375],{"className":319,"code":373,"filename":374,"language":322,"meta":323,"style":323},"sudo docker service logs \u003Cservice_name>\n","View Docker service logs",[325,376,377],{"__ignoreMap":323},[328,378,379,381,383,385,388,392,395,399],{"class":330,"line":331},[328,380,335],{"class":334},[328,382,339],{"class":338},[328,384,342],{"class":338},[328,386,387],{"class":338}," logs",[328,389,391],{"class":390},"sFfmW"," \u003C",[328,393,394],{"class":338},"service_nam",[328,396,398],{"class":397},"sMo7A","e",[328,400,401],{"class":390},">\n",[294,403,404],{},[304,405,408],{"href":406,"rel":407,"target":353},"https://docs.docker.com/reference/cli/docker/service/logs/",[352],"Learn more about \"docker service logs\" →",[309,410,412],{"id":411},"running-commands-in-a-running-container","Running commands in a running container",[294,414,415],{},"Sometimes you might need to do some troubleshooting in a running container. To do this, we need to follow this process:",[417,418,419,428],"ol",{},[420,421,422,423,427],"li",{},"Determine the ",[424,425,426],"em",{},"running"," container ID for the service.",[420,429,430,431,434],{},"Use ",[325,432,433],{},"docker exec"," (with a TTY and interactive mode) attach to the shell of the running container.",[294,436,437,438,445,446,452],{},"We will use ",[304,439,442],{"href":440,"rel":441,"target":353},"https://docs.docker.com/reference/cli/docker/ps/",[352],[325,443,444],{},"docker ps"," to get the container ID, then use ",[304,447,450],{"href":448,"rel":449,"target":353},"https://docs.docker.com/reference/cli/docker/exec/",[352],[325,451,433],{}," to open a shell to the container.",[317,454,457],{"className":319,"code":455,"filename":456,"language":322,"meta":323,"style":323},"# Get the container ID of the running service\nsudo docker ps --filter \"name=\u003Cservice_name>\" --format \"{{.ID}}\"\n\n# Run a command in the running container (you can replace \"sh\" with any command)\n# but by default, this will open a shell to the container (type \"exit\" to close)\nsudo docker exec -it \u003Ccontainer_id> sh\n","Open a shell to a running container",[325,458,459,465,500,507,513,519],{"__ignoreMap":323},[328,460,461],{"class":330,"line":331},[328,462,464],{"class":463},"sutJx","# Get the container ID of the running service\n",[328,466,468,470,472,475,479,483,486,489,492,494,497],{"class":330,"line":467},2,[328,469,335],{"class":334},[328,471,339],{"class":338},[328,473,474],{"class":338}," ps",[328,476,478],{"class":477},"sSJ72"," --filter",[328,480,482],{"class":481},"sF_wb"," \"",[328,484,485],{"class":338},"name=\u003Cservice_name>",[328,487,488],{"class":481},"\"",[328,490,491],{"class":477}," --format",[328,493,482],{"class":481},[328,495,496],{"class":338},"{{.ID}}",[328,498,499],{"class":481},"\"\n",[328,501,503],{"class":330,"line":502},3,[328,504,506],{"emptyLinePlaceholder":505},true,"\n",[328,508,510],{"class":330,"line":509},4,[328,511,512],{"class":463},"# Run a command in the running container (you can replace \"sh\" with any command)\n",[328,514,516],{"class":330,"line":515},5,[328,517,518],{"class":463},"# but by default, this will open a shell to the container (type \"exit\" to close)\n",[328,520,522,524,526,529,532,534,537,540,543],{"class":330,"line":521},6,[328,523,335],{"class":334},[328,525,339],{"class":338},[328,527,528],{"class":338}," exec",[328,530,531],{"class":477}," -it",[328,533,391],{"class":390},[328,535,536],{"class":338},"container_i",[328,538,539],{"class":397},"d",[328,541,542],{"class":390},">",[328,544,545],{"class":338}," sh\n",[294,547,548],{},"This is a two step process, but if you want to do this in a single command, we can use this trick below:",[317,550,553],{"className":319,"code":551,"filename":552,"language":322,"meta":323,"style":323},"# Replace \u003Cservice-name> with the name of your service. This will run `sh` in the first container ID it finds.\n# You can change `sh` to `bash` if your container. Bash will give you a better experience.\nsudo docker exec -it $(sudo docker ps --filter \"name=\u003Cservice_name>\" --format \"{{.ID}}\" | head -n 1) sh\n","Open a shell to a running container (single command)",[325,554,555,560,565],{"__ignoreMap":323},[328,556,557],{"class":330,"line":331},[328,558,559],{"class":463},"# Replace \u003Cservice-name> with the name of your service. This will run `sh` in the first container ID it finds.\n",[328,561,562],{"class":330,"line":467},[328,563,564],{"class":463},"# You can change `sh` to `bash` if your container. Bash will give you a better experience.\n",[328,566,567,569,571,573,575,579,581,583,585,587,589,591,593,595,597,599,601,604,607,610,614,617],{"class":330,"line":502},[328,568,335],{"class":334},[328,570,339],{"class":338},[328,572,528],{"class":338},[328,574,531],{"class":477},[328,576,578],{"class":577},"sG-J9"," $(",[328,580,335],{"class":334},[328,582,339],{"class":338},[328,584,474],{"class":338},[328,586,478],{"class":477},[328,588,482],{"class":481},[328,590,485],{"class":338},[328,592,488],{"class":481},[328,594,491],{"class":477},[328,596,482],{"class":481},[328,598,496],{"class":338},[328,600,488],{"class":481},[328,602,603],{"class":390}," |",[328,605,606],{"class":334}," head",[328,608,609],{"class":477}," -n",[328,611,613],{"class":612},"s_k96"," 1",[328,615,616],{"class":577},")",[328,618,545],{"class":338},[294,620,621,622,624],{},"We're able to run this in a single command because we're using a subshell to get the container ID and then passing that to the ",[325,623,433],{}," command.",[294,626,627,628,631,632,635,636,638],{},"If you don't need a shell and you want to run something like ",[325,629,630],{},"php artisan migrate",", you would just replace ",[325,633,634],{},"sh"," with ",[325,637,630],{},". Just make sure your container is running commands relative to the directory you want to run the command in. Sometimes it's best to just open a shell and navigate to the directory you want to run the command in.",[309,640,642],{"id":641},"viewing-application-logs","Viewing application logs",[294,644,645],{},"When you're viewing application logs, you might have multiple places to look depending on the configuration of your application and what output you're trying to look for.",[417,647,648,655,661],{},[420,649,650,654],{},[651,652,653],"strong",{},"Docker Swarm Service Logs"," - The output here will be more server centric. Meaning you'll see deeper services logs such as PHP, FPM, Nginx, etc.",[420,656,657,660],{},[651,658,659],{},"Application Logs"," - The output here will be more application centric. Meaning you'll see logs from your application itself.",[420,662,663,666],{},[651,664,665],{},"Error Tracking Services"," - If you're using a logging service like Sentry or GlitchTip (which we highly recommend), you'll want to check those logs as well. These services will also alert you if there are any critical errors happening in your application.",[309,668,670],{"id":669},"viewing-laravel-logs","Viewing Laravel Logs",[294,672,673,674,677],{},"If you don't use an error tracking service like Sentry or GlitchTip, Laravel 11 by default will log to the ",[325,675,676],{},"storage/logs/laravel.log"," file. You can access that by running a command like this:",[317,679,682],{"className":319,"code":680,"filename":681,"language":322,"meta":323,"style":323},"# Find the service name of your application\nsudo docker service ls\n\n# Open a shell to the first container ID returned from your service\nsudo docker exec -it $(sudo docker ps --filter \"name=\u003Cservice_name>\" --format \"{{.ID}}\" | head -n 1) sh\n\n# View the available log files\nls storage/logs/\n\n# View the laravel.log file\ncat storage/logs/laravel.log\n","View Laravel logs",[325,683,684,689,699,703,708,754,758,764,773,778,784],{"__ignoreMap":323},[328,685,686],{"class":330,"line":331},[328,687,688],{"class":463},"# Find the service name of your application\n",[328,690,691,693,695,697],{"class":330,"line":467},[328,692,335],{"class":334},[328,694,339],{"class":338},[328,696,342],{"class":338},[328,698,345],{"class":338},[328,700,701],{"class":330,"line":502},[328,702,506],{"emptyLinePlaceholder":505},[328,704,705],{"class":330,"line":509},[328,706,707],{"class":463},"# Open a shell to the first container ID returned from your service\n",[328,709,710,712,714,716,718,720,722,724,726,728,730,732,734,736,738,740,742,744,746,748,750,752],{"class":330,"line":515},[328,711,335],{"class":334},[328,713,339],{"class":338},[328,715,528],{"class":338},[328,717,531],{"class":477},[328,719,578],{"class":577},[328,721,335],{"class":334},[328,723,339],{"class":338},[328,725,474],{"class":338},[328,727,478],{"class":477},[328,729,482],{"class":481},[328,731,485],{"class":338},[328,733,488],{"class":481},[328,735,491],{"class":477},[328,737,482],{"class":481},[328,739,496],{"class":338},[328,741,488],{"class":481},[328,743,603],{"class":390},[328,745,606],{"class":334},[328,747,609],{"class":477},[328,749,613],{"class":612},[328,751,616],{"class":577},[328,753,545],{"class":338},[328,755,756],{"class":330,"line":521},[328,757,506],{"emptyLinePlaceholder":505},[328,759,761],{"class":330,"line":760},7,[328,762,763],{"class":463},"# View the available log files\n",[328,765,767,770],{"class":330,"line":766},8,[328,768,769],{"class":334},"ls",[328,771,772],{"class":338}," storage/logs/\n",[328,774,776],{"class":330,"line":775},9,[328,777,506],{"emptyLinePlaceholder":505},[328,779,781],{"class":330,"line":780},10,[328,782,783],{"class":463},"# View the laravel.log file\n",[328,785,787,790],{"class":330,"line":786},11,[328,788,789],{"class":334},"cat",[328,791,792],{"class":338}," storage/logs/laravel.log\n",[294,794,795],{},"You can see it's a bit of a process to get to the log file, so that's why we recommend using an error tracking service like Sentry or GlitchTip which you can self-host for no cost if you wanted.",[309,797,799],{"id":798},"enabling-debug-mode","Enabling Debug Mode",[294,801,802],{},"Depending on the service you're troubleshooting, the official documentation for the Docker image you're using may have instructions on how to enable debug mode.",[294,804,805,806,809,810,815,816,307],{},"For example, if you're running ",[325,807,808],{},"serversideup/php:8.4-fpm-nginx",", ",[304,811,814],{"href":812,"rel":813,"target":353},"https://serversideup.net/open-source/docker-php/docs/reference/environment-variable-specification",[352],"the official documentation"," talks about setting ",[325,817,818],{},"LOG_OUTPUT_LEVEL=debug",[294,820,821],{},"In this example, we would just send up a commit with the environment variable set.",[298,823,824],{},[294,825,826],{},"Only use debug modes if you're actively troubleshooting an issue. Debug mode will log a lot of information to your logs which can slow down your application and use a lot of disk space.",[317,828,833],{"className":829,"code":830,"filename":831,"language":832,"meta":323,"style":323},"language-yml shiki shiki-themes material-theme-lighter github-dark github-dark","services:\n  php:\n    image: ${SPIN_IMAGE_DOCKERFILE_PHP}\n    environment:\n      LOG_OUTPUT_LEVEL: debug\n","Set the LOG_OUTPUT_LEVEL docker-compose.prod.yml file","yml",[325,834,835,844,851,862,869],{"__ignoreMap":323},[328,836,837,841],{"class":330,"line":331},[328,838,840],{"class":839},"sqIbZ","services",[328,842,843],{"class":577},":\n",[328,845,846,849],{"class":330,"line":467},[328,847,848],{"class":839},"  php",[328,850,843],{"class":577},[328,852,853,856,859],{"class":330,"line":502},[328,854,855],{"class":839},"    image",[328,857,858],{"class":577},":",[328,860,861],{"class":338}," ${SPIN_IMAGE_DOCKERFILE_PHP}\n",[328,863,864,867],{"class":330,"line":509},[328,865,866],{"class":839},"    environment",[328,868,843],{"class":577},[328,870,871,874,876],{"class":330,"line":515},[328,872,873],{"class":839},"      LOG_OUTPUT_LEVEL",[328,875,858],{"class":577},[328,877,878],{"class":338}," debug\n",[309,880,882],{"id":881},"services-wont-start-or-are-not-accessible","Services won't start or are not accessible",[294,884,885],{},"When services won't start or they are not accessible, they are usually broken down into two categories:",[417,887,888,891],{},[420,889,890],{},"The container or service fail to start",[420,892,893],{},"The container or service is running, but you can't access it through HTTP/HTTPS",[895,896,898],"h3",{"id":897},"types-of-health-checks","Types of Health Checks",[294,900,901,902,905],{},"When you're running applications with zero-downtime deployments, everything depends on health checks. There are ",[651,903,904],{},"multiple levels"," of health checks, so make sure you reference above to determine where your issue might be:",[417,907,908,911],{},[420,909,910],{},"The Docker Swarm health check (the container or service fails to start)",[420,912,913],{},"The reverse proxy health check (the container or service is running, but you can't access it through HTTP/HTTPS)",[895,915,917],{"id":916},"docker-health-check","Docker Health Check",[294,919,920,921,928,929,932],{},"The Docker health check is a health check that is more native to the container itself. Container authors can set ",[304,922,925],{"href":923,"rel":924,"target":353},"https://docs.docker.com/reference/dockerfile/#healthcheck",[352],[325,926,927],{},"HEALTHCHECK"," instructions in their ",[325,930,931],{},"Dockerfile"," to control the health of the container.",[294,934,935,936,943],{},"Health checks can also be overridden by the Docker Swarm service configuration at with the ",[304,937,940],{"href":938,"rel":939,"target":353},"https://docs.docker.com/reference/compose-file/services/#healthcheck",[352],[325,941,942],{},"healthcheck"," option.",[294,945,946,947,950,951,958],{},"One of the most frustrating things might be you try using the ",[325,948,949],{},"docker service logs"," command, but the service doesn't have any logs because the service doesn't exist yet. To get around this, we can use the ",[304,952,955],{"href":953,"rel":954,"target":353},"https://docs.docker.com/reference/cli/docker/service/ps/",[352],[325,956,957],{},"docker service ps"," command to get more information on why a container won't start.",[317,960,963],{"className":319,"code":961,"filename":962,"language":322,"meta":323,"style":323},"sudo docker service ps --no-trunc \u003Cservice_name>\n","Get more information on why a container won't start",[325,964,965],{"__ignoreMap":323},[328,966,967,969,971,973,975,978,980,982,984],{"class":330,"line":331},[328,968,335],{"class":334},[328,970,339],{"class":338},[328,972,342],{"class":338},[328,974,474],{"class":338},[328,976,977],{"class":477}," --no-trunc",[328,979,391],{"class":390},[328,981,394],{"class":338},[328,983,398],{"class":397},[328,985,401],{"class":390},[294,987,988,989,996],{},"The above command will show a glimpse of why a container won't start. If everything looks normal there, you might want to inspect the service with ",[304,990,993],{"href":991,"rel":992,"target":353},"https://docs.docker.com/reference/cli/docker/service/inspect/",[352],[325,994,995],{},"docker service inspect"," to see if there are any other issues.",[317,998,1001],{"className":319,"code":999,"filename":1000,"language":322,"meta":323,"style":323},"sudo docker service inspect \u003Cservice_name> --pretty\n","Inspect a Docker service",[325,1002,1003],{"__ignoreMap":323},[328,1004,1005,1007,1009,1011,1014,1016,1018,1020,1022],{"class":330,"line":331},[328,1006,335],{"class":334},[328,1008,339],{"class":338},[328,1010,342],{"class":338},[328,1012,1013],{"class":338}," inspect",[328,1015,391],{"class":390},[328,1017,394],{"class":338},[328,1019,398],{"class":397},[328,1021,542],{"class":390},[328,1023,1024],{"class":477}," --pretty\n",[294,1026,1027,1028,1031],{},"Adding the ",[325,1029,1030],{},"--pretty"," flag will show nice output of the service configuration and you can look for clues to see why the service might not be starting.",[317,1033,1036],{"className":319,"code":1034,"filename":1035,"language":322,"meta":323,"style":323},"task: non-zero exit (137): dockerexec: unhealthy container\n","Example of a Docker health check failure",[325,1037,1038],{"__ignoreMap":323},[328,1039,1040,1043,1046,1049],{"class":330,"line":331},[328,1041,1042],{"class":334},"task:",[328,1044,1045],{"class":338}," non-zero",[328,1047,1048],{"class":338}," exit",[328,1050,1051],{"class":397}," (137): dockerexec: unhealthy container\n",[294,1053,1054],{},"If you see an error message like the one above, this means something in the container is causing the Docker health check to fail. This could be caused by a start up script failing, a configuration issue, or something else.",[294,1056,1057],{},"Start up scripts can be tricky to debug because if any of the scripts send a \"non-zero exit\" code, the Docker health check could fail. Make sure you're properly handling exit codes and testing your scripts in all scenarios.",[294,1059,1060,1061,1063,1064,307],{},"To get more information, put your container image in debug mode or add verbose logging and try again. You may get more information from ",[325,1062,949],{}," or ",[325,1065,995],{},[298,1067,1068],{},[294,1069,1070,1071,1074,1075,1078,1079,1081],{},"If the container you're debugging is ",[651,1072,1073],{},"serversideup/php",", you can set container image to debug mode by setting the ",[325,1076,1077],{},"LOG_OUTPUT_LEVEL"," environment variable to ",[325,1080,194],{}," to get more information.",[895,1083,1085],{"id":1084},"reverse-proxy-health-check","Reverse Proxy Health Check",[294,1087,1088,1089,1094],{},"If you're trying to access your application through HTTP/HTTPS, but you're getting a 503 or 404 error, it's likely something is wrong with the reverse proxy health check. For our default configurations, we use ",[304,1090,1093],{"href":1091,"rel":1092,"target":353},"https://doc.traefik.io/traefik/",[352],"Traefik"," as the reverse proxy, so we'll give you a few tips on how to proceed with troubleshooting.",[298,1096,1097],{},[294,1098,1099,1100,1103],{},"The example below shows a ",[651,1101,1102],{},"broken configuration",". Don't copy from it. Let's learn from it instead. 😃",[317,1105,1108],{"className":829,"code":1106,"filename":1107,"language":832,"meta":323,"style":323},"services:\n  php:\n    image: ${SPIN_IMAGE_DOCKERFILE}\n    environment:\n      SSL_MODE: \"full\"\n    deploy:\n      labels:\n        - \"traefik.enable=true\"\n        - \"traefik.http.routers.my-php-app.rule=Host(`${SPIN_APP_DOMA1N}`)\"\n        - \"traefik.http.routers.my-php-app.entrypoints=websecure\"\n        - \"traefik.http.routers.my-php-app.tls=true\"\n        - \"traefik.http.routers.my-php-app.tls.certresolver=letsencryptresolver\"\n        - \"traefik.http.services.my-php-app.loadbalancer.server.port=8080\"\n        - \"traefik.http.services.my-php-app.loadbalancer.server.scheme=http\"\n        # Health check\n        - \"traefik.http.services.my-php-app.loadbalancer.healthcheck.path=/invalid\"\n        - \"traefik.http.services.my-php-app.loadbalancer.healthcheck.interval=30s\"\n        - \"traefik.http.services.my-php-app.loadbalancer.healthcheck.timeout=1s\"\n        - \"traefik.http.services.my-php-app.loadbalancer.healthcheck.scheme=http\"\n","Example of a broken configuration",[325,1109,1110,1116,1122,1131,1137,1151,1158,1165,1177,1188,1199,1210,1222,1234,1246,1252,1264,1276,1288],{"__ignoreMap":323},[328,1111,1112,1114],{"class":330,"line":331},[328,1113,840],{"class":839},[328,1115,843],{"class":577},[328,1117,1118,1120],{"class":330,"line":467},[328,1119,848],{"class":839},[328,1121,843],{"class":577},[328,1123,1124,1126,1128],{"class":330,"line":502},[328,1125,855],{"class":839},[328,1127,858],{"class":577},[328,1129,1130],{"class":338}," ${SPIN_IMAGE_DOCKERFILE}\n",[328,1132,1133,1135],{"class":330,"line":509},[328,1134,866],{"class":839},[328,1136,843],{"class":577},[328,1138,1139,1142,1144,1146,1149],{"class":330,"line":515},[328,1140,1141],{"class":839},"      SSL_MODE",[328,1143,858],{"class":577},[328,1145,482],{"class":481},[328,1147,1148],{"class":338},"full",[328,1150,499],{"class":481},[328,1152,1153,1156],{"class":330,"line":521},[328,1154,1155],{"class":839},"    deploy",[328,1157,843],{"class":577},[328,1159,1160,1163],{"class":330,"line":760},[328,1161,1162],{"class":839},"      labels",[328,1164,843],{"class":577},[328,1166,1167,1170,1172,1175],{"class":330,"line":766},[328,1168,1169],{"class":577},"        -",[328,1171,482],{"class":481},[328,1173,1174],{"class":338},"traefik.enable=true",[328,1176,499],{"class":481},[328,1178,1179,1181,1183,1186],{"class":330,"line":775},[328,1180,1169],{"class":577},[328,1182,482],{"class":481},[328,1184,1185],{"class":338},"traefik.http.routers.my-php-app.rule=Host(`${SPIN_APP_DOMA1N}`)",[328,1187,499],{"class":481},[328,1189,1190,1192,1194,1197],{"class":330,"line":780},[328,1191,1169],{"class":577},[328,1193,482],{"class":481},[328,1195,1196],{"class":338},"traefik.http.routers.my-php-app.entrypoints=websecure",[328,1198,499],{"class":481},[328,1200,1201,1203,1205,1208],{"class":330,"line":786},[328,1202,1169],{"class":577},[328,1204,482],{"class":481},[328,1206,1207],{"class":338},"traefik.http.routers.my-php-app.tls=true",[328,1209,499],{"class":481},[328,1211,1213,1215,1217,1220],{"class":330,"line":1212},12,[328,1214,1169],{"class":577},[328,1216,482],{"class":481},[328,1218,1219],{"class":338},"traefik.http.routers.my-php-app.tls.certresolver=letsencryptresolver",[328,1221,499],{"class":481},[328,1223,1225,1227,1229,1232],{"class":330,"line":1224},13,[328,1226,1169],{"class":577},[328,1228,482],{"class":481},[328,1230,1231],{"class":338},"traefik.http.services.my-php-app.loadbalancer.server.port=8080",[328,1233,499],{"class":481},[328,1235,1237,1239,1241,1244],{"class":330,"line":1236},14,[328,1238,1169],{"class":577},[328,1240,482],{"class":481},[328,1242,1243],{"class":338},"traefik.http.services.my-php-app.loadbalancer.server.scheme=http",[328,1245,499],{"class":481},[328,1247,1249],{"class":330,"line":1248},15,[328,1250,1251],{"class":463},"        # Health check\n",[328,1253,1255,1257,1259,1262],{"class":330,"line":1254},16,[328,1256,1169],{"class":577},[328,1258,482],{"class":481},[328,1260,1261],{"class":338},"traefik.http.services.my-php-app.loadbalancer.healthcheck.path=/invalid",[328,1263,499],{"class":481},[328,1265,1267,1269,1271,1274],{"class":330,"line":1266},17,[328,1268,1169],{"class":577},[328,1270,482],{"class":481},[328,1272,1273],{"class":338},"traefik.http.services.my-php-app.loadbalancer.healthcheck.interval=30s",[328,1275,499],{"class":481},[328,1277,1279,1281,1283,1286],{"class":330,"line":1278},18,[328,1280,1169],{"class":577},[328,1282,482],{"class":481},[328,1284,1285],{"class":338},"traefik.http.services.my-php-app.loadbalancer.healthcheck.timeout=1s",[328,1287,499],{"class":481},[328,1289,1291,1293,1295,1298],{"class":330,"line":1290},19,[328,1292,1169],{"class":577},[328,1294,482],{"class":481},[328,1296,1297],{"class":338},"traefik.http.services.my-php-app.loadbalancer.healthcheck.scheme=http",[328,1299,499],{"class":481},[1301,1302,1304],"h4",{"id":1303},"invalid-host","Invalid Host",[294,1306,1307,1308,1311,1312],{},"I have a typo in my Host rule: ",[325,1309,1310],{},"Host(","${SPIN_APP_DOMA1N}",[325,1313,1314],{},")\"",[294,1316,1317,1318,1321,1322,1325,1326,1329],{},"Since the variable is ",[325,1319,1320],{},"SPIN_APP_DOMAIN",", I have a typo and used ",[325,1323,1324],{},"SPIN_APP_DOMA1N"," instead. This would cause a ",[325,1327,1328],{},"404"," error because the host is invalid and the variable is undefined.",[294,1331,1332,1333,1335],{},"To fix this I would need to fix my typo and ensure ",[325,1334,1320],{}," is properly defined.",[1301,1337,1339],{"id":1338},"invalid-port-scheme","Invalid Port + Scheme",[294,1341,1342,1343,1349,1350,1353],{},"If I look at the documentation of ",[304,1344,1347],{"href":1345,"rel":1346,"target":353},"https://serversideup.net/open-source/docker-php/docs/customizing-the-image/configuring-ssl",[352],[325,1348,1073],{},", you can see I have ",[325,1351,1352],{},"SSL_MODE: \"full\""," set in the service configuration. This tells the application to use HTTPS.",[294,1355,1356],{},"However, there are 4 issues with the configuration because of this change:",[1358,1359,1360,1373,1382,1388,1396],"ul",{},[420,1361,1362,1365,1366,1369,1370,1372],{},[325,1363,1364],{},"server.port=8080",": The docs say this should be changed to ",[325,1367,1368],{},"8443"," when ",[325,1371,1352],{}," is set.",[420,1374,1375,1378,1379,307],{},[325,1376,1377],{},"server.scheme=http",": Since we're using HTTPS, this should be set to ",[325,1380,1381],{},"https",[420,1383,1384,1387],{},[325,1385,1386],{},"healthcheck.timeout=1s",": This health check timeout is quite low. This could cause a health check failure if the application takes longer than 1 second to start.",[420,1389,1390,1393,1394,307],{},[325,1391,1392],{},"healthcheck.scheme=http",": The health check definition is different from the server definition. The health check should use ",[325,1395,1381],{},[420,1397,1398,1401,1402,1405,1406,1409,1410,1413],{},[325,1399,1400],{},"healthcheck.path=/invalid",": If I don't have a page at ",[325,1403,1404],{},"/invalid",", this will cause a health check failure. I can read the serversideup/php docs to set this to ",[325,1407,1408],{},"/healthcheck"," to use the native container health check endpoint or ",[325,1411,1412],{},"/up"," if I am running Laravel.",[294,1415,1416],{},"Wow, you can see how many moving parts it takes to get zero-downtime deployments working. This process is true regardless of any service that you're running, so it's important to understand how each piece works together.",[294,1418,1419],{},"Always remember:",[1358,1421,1422,1425,1428,1442],{},[420,1423,1424],{},"Start with the service, check to make sure your application is actually getting deployed",[420,1426,1427],{},"Then check the reverse proxy configuration.",[420,1429,1430,1431,1434,1435,1063,1438,1441],{},"The health check MUST return a ",[325,1432,1433],{},"200"," status code to pass. Things like ",[325,1436,1437],{},"301",[325,1439,1440],{},"302"," redirects can cause the health check to fail.",[420,1443,1444],{},"Always refer to the official documentation of the Docker image you're using for looking for proper health check definitions.",[298,1446,1447],{},[294,1448,1449,1450,1455],{},"If you want the \"easy button\" and you want a turn-key solution, look into ",[304,1451,1454],{"href":1452,"rel":1453,"target":353},"https://getspin.pro",[352],"Spin Pro",". We include everything you need to deploy Laravel quickly, reliably, and easily. Everything we talk about above is configured for you automatically.",[309,1457,1459],{"id":1458},"database-connection-issues","Database connection issues",[294,1461,1462],{},"A common thing we also see are people who have connection issues. This is usually caused by:",[417,1464,1465,1474,1487],{},[420,1466,1467,1468,1473],{},"The database service isn't ready by the time a script in your other container tries to access it (controlled by container ",[304,1469,1472],{"href":1470,"rel":1471,"target":353},"https://docs.docker.com/compose/how-tos/startup-order/",[352],"start orders",").",[420,1475,1476,1477,1063,1480,1483,1484,1473],{},"The host is invalid, like ",[325,1478,1479],{},"localhost",[325,1481,1482],{},"127.0.0.1",", instead of using the name of the database service in their Docker Compose file (like ",[325,1485,1486],{},"postgres",[420,1488,1489,1490,1493],{},"The credentials in the ",[325,1491,1492],{},".env"," file get changed and the application can't connect to the database.",[294,1495,1496,1497,1500,1501,1504],{},"If you're provisioning a database like Postgres, MariaDB, or MySQL, they make an environment variable available called ",[325,1498,1499],{},"POSTGRES_USER"," and",[325,1502,1503],{},"POSTGRES_PASSWORD"," (or similar) that you can use to connect to the database.",[298,1506,1507],{},[294,1508,1509,1510,1063,1513,1516,1517,1520,1521,1523],{},"Any of these ",[325,1511,1512],{},"*_USER",[325,1514,1515],{},"*_PASSWORD"," variables will provision ",[651,1518,1519],{},"on initialization only",". If you change your ",[325,1522,1492],{}," to use a new password, the database will not automatically update the password.",[294,1525,1526],{},"To fix this, you'll need to reference the documentation of your database engine to manually change the password.",[895,1528,1530],{"id":1529},"diagnosing-connection-issues-between-services","Diagnosing connection issues between services",[294,1532,1533,1534,1536],{},"If you notice connection errors between services, make sure your ",[325,1535,1492],{}," file has the correct values. Special things to double check:",[1358,1538,1539,1561,1564,1577],{},[420,1540,1541,1542,1545,1546,1549,1550,809,1553,1556,1557,1063,1559,616],{},"Ensure your ",[325,1543,1544],{},"DB_HOST"," (or comparable like ",[325,1547,1548],{},"REDIS_HOST",") is set to the service name (ie. ",[325,1551,1552],{},"mariadb",[325,1554,1555],{},"redis",", and NOT ",[325,1558,1482],{},[325,1560,1479],{},[420,1562,1563],{},"Ensure your environment variable values don't have any weird special characters in them.",[420,1565,1541,1566,1569,1570,1573,1574,1473],{},[325,1567,1568],{},"APP_URL"," in ",[325,1571,1572],{},".env.\u003Cenvironment>"," is set correctly (ie. ",[325,1575,1576],{},"https://app.example.com",[420,1578,1579,1580,307],{},"Ensure any services have strong passwords set. Sometimes default passwords are rejected for security reasons. You can use a number of online tools to ",[304,1581,1584],{"href":1582,"rel":1583,"target":353},"https://www.random.org/strings/?num=100&len=26&digits=on&upperalpha=on&loweralpha=on&unique=on&format=html&rnd=new",[352],"generate a strong password for your service",[309,1586,1588],{"id":1587},"stopping-a-service","Stopping a service",[294,1590,1591,1592,1595,1596,1599],{},"If you need to stop a service, you can use the ",[325,1593,1594],{},"docker service rm"," command. For example, to stop a service named ",[325,1597,1598],{},"my-service",", you can run:",[317,1601,1604],{"className":319,"code":1602,"filename":1603,"language":322,"meta":323,"style":323},"sudo docker service rm my-service\n","\"Stop a service\"",[325,1605,1606],{"__ignoreMap":323},[328,1607,1608,1610,1612,1614,1617],{"class":330,"line":331},[328,1609,335],{"class":334},[328,1611,339],{"class":338},[328,1613,342],{"class":338},[328,1615,1616],{"class":338}," rm",[328,1618,1619],{"class":338}," my-service\n",[294,1621,1622,1623,1625],{},"Replace ",[325,1624,1598],{}," with the name of the service you want to stop.",[309,1627,1629],{"id":1628},"removing-volumes","Removing volumes",[294,1631,1632,1633,1636,1637,1599],{},"Volumes are used to persist data in your containers. If you need to remove a volume, you can use the ",[325,1634,1635],{},"docker volume rm"," command. For example, to remove a volume named ",[325,1638,1639],{},"my-volume",[317,1641,1644],{"className":319,"code":1642,"filename":1643,"language":322,"meta":323,"style":323},"sudo docker volume rm my-volume\n","\"Remove a volume\"",[325,1645,1646],{"__ignoreMap":323},[328,1647,1648,1650,1652,1655,1657],{"class":330,"line":331},[328,1649,335],{"class":334},[328,1651,339],{"class":338},[328,1653,1654],{"class":338}," volume",[328,1656,1616],{"class":338},[328,1658,1659],{"class":338}," my-volume\n",[294,1661,1622,1662,1664,1665,307],{},[325,1663,1639],{}," with the name of the volume you want to remove. You can find the volume name by running ",[325,1666,1667],{},"sudo docker volume ls",[309,1669,1671],{"id":1670},"removing-swarm-configurations","Removing Swarm configurations",[294,1673,1674,1675,1678,1679,1599],{},"If you need to remove a Swarm configuration, you can use the ",[325,1676,1677],{},"docker config rm"," command. For example, to remove a configuration named ",[325,1680,1681],{},"my-config",[317,1683,1686],{"className":319,"code":1684,"filename":1685,"language":322,"meta":323,"style":323},"sudo docker config rm my-config\n","\"Remove a configuration\"",[325,1687,1688],{"__ignoreMap":323},[328,1689,1690,1692,1694,1697,1699],{"class":330,"line":331},[328,1691,335],{"class":334},[328,1693,339],{"class":338},[328,1695,1696],{"class":338}," config",[328,1698,1616],{"class":338},[328,1700,1701],{"class":338}," my-config\n",[294,1703,1622,1704,1706,1707,307],{},[325,1705,1681],{}," with the name of the configuration you want to remove. You can find the configuration name by running ",[325,1708,1709],{},"sudo docker config ls",[309,1711,1713],{"id":1712},"removing-networks","Removing networks",[294,1715,1716,1717,1720,1721,1599],{},"If you need to remove a network, you can use the ",[325,1718,1719],{},"docker network rm"," command. For example, to remove a network named ",[325,1722,1723],{},"my-network",[317,1725,1728],{"className":319,"code":1726,"filename":1727,"language":322,"meta":323,"style":323},"sudo docker network rm my-network\n","\"Remove a network\"",[325,1729,1730],{"__ignoreMap":323},[328,1731,1732,1734,1736,1739,1741],{"class":330,"line":331},[328,1733,335],{"class":334},[328,1735,339],{"class":338},[328,1737,1738],{"class":338}," network",[328,1740,1616],{"class":338},[328,1742,1743],{"class":338}," my-network\n",[309,1745,1747],{"id":1746},"pruning-unused-resources","Pruning unused resources",[294,1749,1750,1751,1754],{},"If you need to remove unused resources, you can use the ",[325,1752,1753],{},"docker system prune"," command. For example, to remove all stopped containers, unused networks, and dangling images, you can run:",[317,1756,1759],{"className":319,"code":1757,"filename":1758,"language":322,"meta":323,"style":323},"sudo docker system prune\n","\"Prune unused resources\"",[325,1760,1761],{"__ignoreMap":323},[328,1762,1763,1765,1767,1770],{"class":330,"line":331},[328,1764,335],{"class":334},[328,1766,339],{"class":338},[328,1768,1769],{"class":338}," system",[328,1771,1772],{"class":338}," prune\n",[294,1774,1775,1776,1779],{},"This command removes all stopped containers, unused networks, and dangling images. You can add the ",[325,1777,1778],{},"--all"," flag to remove all unused images as well.",[294,1781,1782],{},"This will free up disk space on your server.",[309,1784,1786],{"id":1785},"starting-over","Starting over",[294,1788,1789,1790,307],{},"We've all been there. The process of learning sometimes can start with a \"redo\". The good news is since everything is containerized, everything is designed to be ",[651,1791,1792],{},"disposable and repeatable",[294,1794,1795,1796,1799],{},"Since we're running Docker, we ",[424,1797,1798],{},"do not"," need to rebuild the server. We can simply remove the Docker data and start over with a fresh deployment.",[298,1801,1802],{},[294,1803,1804],{},"The commands below will destroy all data. This means things like databases, logs, etc will all be deleted and you'll have a fresh Docker environment to deploy to.",[317,1806,1809],{"className":319,"code":1807,"filename":1808,"language":322,"meta":323,"style":323},"sudo docker service rm $(sudo docker service ls -q) # Remove all services\nsudo docker stop $(sudo docker ps -aq) # Stop all containers\nsudo docker rm $(sudo docker ps -aq) # Remove all containers\nsudo docker system prune --all # Remove all unused images and networks\nsudo docker volume rm $(sudo docker volume ls -q) # Remove all volumes\nsudo docker config rm $(sudo docker config ls -q) # Remove all configurations\n","Delete all docker data and start over",[325,1810,1811,1840,1865,1888,1905,1932],{"__ignoreMap":323},[328,1812,1813,1815,1817,1819,1821,1823,1825,1827,1829,1832,1835,1837],{"class":330,"line":331},[328,1814,335],{"class":334},[328,1816,339],{"class":338},[328,1818,342],{"class":338},[328,1820,1616],{"class":338},[328,1822,578],{"class":577},[328,1824,335],{"class":334},[328,1826,339],{"class":338},[328,1828,342],{"class":338},[328,1830,1831],{"class":338}," ls",[328,1833,1834],{"class":477}," -q",[328,1836,616],{"class":577},[328,1838,1839],{"class":463}," # Remove all services\n",[328,1841,1842,1844,1846,1849,1851,1853,1855,1857,1860,1862],{"class":330,"line":467},[328,1843,335],{"class":334},[328,1845,339],{"class":338},[328,1847,1848],{"class":338}," stop",[328,1850,578],{"class":577},[328,1852,335],{"class":334},[328,1854,339],{"class":338},[328,1856,474],{"class":338},[328,1858,1859],{"class":477}," -aq",[328,1861,616],{"class":577},[328,1863,1864],{"class":463}," # Stop all containers\n",[328,1866,1867,1869,1871,1873,1875,1877,1879,1881,1883,1885],{"class":330,"line":502},[328,1868,335],{"class":334},[328,1870,339],{"class":338},[328,1872,1616],{"class":338},[328,1874,578],{"class":577},[328,1876,335],{"class":334},[328,1878,339],{"class":338},[328,1880,474],{"class":338},[328,1882,1859],{"class":477},[328,1884,616],{"class":577},[328,1886,1887],{"class":463}," # Remove all containers\n",[328,1889,1890,1892,1894,1896,1899,1902],{"class":330,"line":509},[328,1891,335],{"class":334},[328,1893,339],{"class":338},[328,1895,1769],{"class":338},[328,1897,1898],{"class":338}," prune",[328,1900,1901],{"class":477}," --all",[328,1903,1904],{"class":463}," # Remove all unused images and networks\n",[328,1906,1907,1909,1911,1913,1915,1917,1919,1921,1923,1925,1927,1929],{"class":330,"line":515},[328,1908,335],{"class":334},[328,1910,339],{"class":338},[328,1912,1654],{"class":338},[328,1914,1616],{"class":338},[328,1916,578],{"class":577},[328,1918,335],{"class":334},[328,1920,339],{"class":338},[328,1922,1654],{"class":338},[328,1924,1831],{"class":338},[328,1926,1834],{"class":477},[328,1928,616],{"class":577},[328,1930,1931],{"class":463}," # Remove all volumes\n",[328,1933,1934,1936,1938,1940,1942,1944,1946,1948,1950,1952,1954,1956],{"class":330,"line":521},[328,1935,335],{"class":334},[328,1937,339],{"class":338},[328,1939,1696],{"class":338},[328,1941,1616],{"class":338},[328,1943,578],{"class":577},[328,1945,335],{"class":334},[328,1947,339],{"class":338},[328,1949,1696],{"class":338},[328,1951,1831],{"class":338},[328,1953,1834],{"class":477},[328,1955,616],{"class":577},[328,1957,1958],{"class":463}," # Remove all configurations\n",[294,1960,1961],{},"Run the commands above individually to ensure everything is removed properly. Once you've verified everything is removed, you can deploy a fresh copy of your application.",[309,1963,1965],{"id":1964},"re-provisioning-servers-from-scratch","Re-provisioning servers from scratch",[294,1967,1968],{},"Sometimes you may want to completely delete a server from your cloud provider and start fresh with a new one. This is common when:",[1358,1970,1971,1974,1977],{},[420,1972,1973],{},"You ran into issues during initial provisioning and want to start over",[420,1975,1976],{},"You're testing your infrastructure setup",[420,1978,1979],{},"You want to move to a different server type or location",[294,1981,1982],{},"When you delete a server from your cloud provider (like Hetzner, DigitalOcean, or Vultr) and want to re-provision, you'll need to clean up a few things first.",[895,1984,1986,1987],{"id":1985},"step-1-remove-the-ip-address-from-spinyml","Step 1: Remove the IP address from ",[325,1988,1989],{},".spin.yml",[294,1991,1992,1993,1995,1996,1999],{},"When Spin provisions a server through a provider, it automatically updates your ",[325,1994,1989],{}," file with the server's IP address. If you delete the server and want Spin to create a new one, you need to remove this ",[325,1997,1998],{},"address"," property.",[317,2001,2006],{"className":2002,"code":2003,"filename":2004,"language":2005,"meta":323,"style":323},"language-yaml shiki shiki-themes material-theme-lighter github-dark github-dark","servers:\n  - server_name: ubuntu-2gb-ash-1\n    environment: production\n    hardware_profile: hetzner_2c_2gb_ubuntu2404\n    address: 123.45.67.89  # Remove this line\n","Before - Server with IP address assigned","yaml",[325,2007,2008,2015,2028,2037,2047],{"__ignoreMap":323},[328,2009,2010,2013],{"class":330,"line":331},[328,2011,2012],{"class":839},"servers",[328,2014,843],{"class":577},[328,2016,2017,2020,2023,2025],{"class":330,"line":467},[328,2018,2019],{"class":577},"  -",[328,2021,2022],{"class":839}," server_name",[328,2024,858],{"class":577},[328,2026,2027],{"class":338}," ubuntu-2gb-ash-1\n",[328,2029,2030,2032,2034],{"class":330,"line":502},[328,2031,866],{"class":839},[328,2033,858],{"class":577},[328,2035,2036],{"class":338}," production\n",[328,2038,2039,2042,2044],{"class":330,"line":509},[328,2040,2041],{"class":839},"    hardware_profile",[328,2043,858],{"class":577},[328,2045,2046],{"class":338}," hetzner_2c_2gb_ubuntu2404\n",[328,2048,2049,2052,2054,2057],{"class":330,"line":515},[328,2050,2051],{"class":839},"    address",[328,2053,858],{"class":577},[328,2055,2056],{"class":612}," 123.45.67.89",[328,2058,2059],{"class":463},"  # Remove this line\n",[317,2061,2064],{"className":2002,"code":2062,"filename":2063,"language":2005,"meta":323,"style":323},"servers:\n  - server_name: ubuntu-2gb-ash-1\n    environment: production\n    hardware_profile: hetzner_2c_2gb_ubuntu2404\n","After - Server ready for re-provisioning",[325,2065,2066,2072,2082,2090],{"__ignoreMap":323},[328,2067,2068,2070],{"class":330,"line":331},[328,2069,2012],{"class":839},[328,2071,843],{"class":577},[328,2073,2074,2076,2078,2080],{"class":330,"line":467},[328,2075,2019],{"class":577},[328,2077,2022],{"class":839},[328,2079,858],{"class":577},[328,2081,2027],{"class":338},[328,2083,2084,2086,2088],{"class":330,"line":502},[328,2085,866],{"class":839},[328,2087,858],{"class":577},[328,2089,2036],{"class":338},[328,2091,2092,2094,2096],{"class":330,"line":509},[328,2093,2041],{"class":839},[328,2095,858],{"class":577},[328,2097,2046],{"class":338},[895,2099,2101],{"id":2100},"step-2-remove-the-server-from-ssh-known_hosts","Step 2: Remove the server from SSH known_hosts",[294,2103,2104],{},"Your local machine stores SSH host keys for servers you've connected to. When you create a new server, it will have a different host key, which causes SSH to show a warning about a potential security issue.",[294,2106,2107],{},"To remove the old host key entry, run:",[317,2109,2112],{"className":319,"code":2110,"filename":2111,"language":322,"meta":323,"style":323},"ssh-keygen -R your.server.ip.address\n","Remove server from known_hosts",[325,2113,2114],{"__ignoreMap":323},[328,2115,2116,2119,2122],{"class":330,"line":331},[328,2117,2118],{"class":334},"ssh-keygen",[328,2120,2121],{"class":477}," -R",[328,2123,2124],{"class":338}," your.server.ip.address\n",[294,2126,1622,2127,2130],{},[325,2128,2129],{},"your.server.ip.address"," with the IP address or hostname of the server you deleted. For example:",[317,2132,2135],{"className":319,"code":2133,"filename":2134,"language":322,"meta":323,"style":323},"ssh-keygen -R 123.45.67.89\n","Example removing a specific IP",[325,2136,2137],{"__ignoreMap":323},[328,2138,2139,2141,2143],{"class":330,"line":331},[328,2140,2118],{"class":334},[328,2142,2121],{"class":477},[328,2144,2145],{"class":612}," 123.45.67.89\n",[298,2147,2148],{},[294,2149,2150],{},"If you used a hostname to connect to your server, you may need to remove both the hostname and IP address entries.",[317,2152,2155],{"className":319,"code":2153,"filename":2154,"language":322,"meta":323,"style":323},"ssh-keygen -R myserver.example.com\nssh-keygen -R 123.45.67.89 # Remove the IP address entry\n","Example removing a hostname and IP address",[325,2156,2157,2166],{"__ignoreMap":323},[328,2158,2159,2161,2163],{"class":330,"line":331},[328,2160,2118],{"class":334},[328,2162,2121],{"class":477},[328,2164,2165],{"class":338}," myserver.example.com\n",[328,2167,2168,2170,2172,2174],{"class":330,"line":467},[328,2169,2118],{"class":334},[328,2171,2121],{"class":477},[328,2173,2056],{"class":612},[328,2175,2176],{"class":463}," # Remove the IP address entry\n",[895,2178,2180],{"id":2179},"step-3-re-provision-your-server","Step 3: Re-provision your server",[294,2182,2183,2184,2186],{},"Once you've cleaned up the ",[325,2185,1989],{}," file and SSH known_hosts, you can provision a fresh server:",[317,2188,2191],{"className":319,"code":2189,"filename":2190,"language":322,"meta":323,"style":323},"spin provision\n","Provision a new server",[325,2192,2193],{"__ignoreMap":323},[328,2194,2195,2198],{"class":330,"line":331},[328,2196,2197],{"class":334},"spin",[328,2199,2200],{"class":338}," provision\n",[294,2202,2203,2204,2206],{},"Spin will create a new server with your cloud provider and update your ",[325,2205,1989],{}," file with the new IP address.",[2208,2209,2210],"style",{},"html pre.shiki code .soiBB, html code.shiki .soiBB{--shiki-light:#E2931D;--shiki-default:#B392F0;--shiki-dark:#B392F0}html pre.shiki code .s0vBq, html code.shiki .s0vBq{--shiki-light:#91B859;--shiki-default:#9ECBFF;--shiki-dark:#9ECBFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sFfmW, html code.shiki .sFfmW{--shiki-light:#39ADB5;--shiki-default:#F97583;--shiki-dark:#F97583}html pre.shiki code .sMo7A, html code.shiki .sMo7A{--shiki-light:#90A4AE;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}html pre.shiki code .sutJx, html code.shiki .sutJx{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#6A737D;--shiki-dark-font-style:inherit}html pre.shiki code .sSJ72, html code.shiki .sSJ72{--shiki-light:#91B859;--shiki-default:#79B8FF;--shiki-dark:#79B8FF}html pre.shiki code .sF_wb, html code.shiki .sF_wb{--shiki-light:#39ADB5;--shiki-default:#9ECBFF;--shiki-dark:#9ECBFF}html pre.shiki code .sG-J9, html code.shiki .sG-J9{--shiki-light:#39ADB5;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}html pre.shiki code .s_k96, html code.shiki .s_k96{--shiki-light:#F76D47;--shiki-default:#79B8FF;--shiki-dark:#79B8FF}html pre.shiki code .sqIbZ, html code.shiki .sqIbZ{--shiki-light:#E53935;--shiki-default:#85E89D;--shiki-dark:#85E89D}",{"title":323,"searchDepth":467,"depth":467,"links":2212},[2213,2214,2215,2216,2217,2218,2219,2224,2227,2228,2229,2230,2231,2232,2233],{"id":311,"depth":467,"text":312},{"id":357,"depth":467,"text":358},{"id":411,"depth":467,"text":412},{"id":641,"depth":467,"text":642},{"id":669,"depth":467,"text":670},{"id":798,"depth":467,"text":799},{"id":881,"depth":467,"text":882,"children":2220},[2221,2222,2223],{"id":897,"depth":502,"text":898},{"id":916,"depth":502,"text":917},{"id":1084,"depth":502,"text":1085},{"id":1458,"depth":467,"text":1459,"children":2225},[2226],{"id":1529,"depth":502,"text":1530},{"id":1587,"depth":467,"text":1588},{"id":1628,"depth":467,"text":1629},{"id":1670,"depth":467,"text":1671},{"id":1712,"depth":467,"text":1713},{"id":1746,"depth":467,"text":1747},{"id":1785,"depth":467,"text":1786},{"id":1964,"depth":467,"text":1965,"children":2234},[2235,2237,2238],{"id":1985,"depth":502,"text":2236},"Step 1: Remove the IP address from .spin.yml",{"id":2100,"depth":502,"text":2101},{"id":2179,"depth":502,"text":2180},"https://serversideup.net/open-source/spin/docs/server-access/troubleshooting-your-application","Learn how to troubleshoot your application.","md","docs",{"head":2244},{"title":2245},"Troubleshooting Your Application - Spin by Server Side Up",{"title":148,"description":2240},"sxhNRUmKeSUn_PebK7CpTu_JmBcEg2tYOd50zrSBpHM",[2249,2251],{"title":144,"path":145,"stem":146,"description":2250,"children":-1},"Learn how to connect to your server.",{"title":152,"path":153,"stem":154,"description":2252,"children":-1},"Learn how to update your server.",1769465039521]