|
| 1 | +--- |
| 2 | +title: Week 3 |
| 3 | +author: Muhammad Salman |
| 4 | +author_url: https://github.com/SalmanDeveloperz |
| 5 | +tags: [gsoc25, microservices, infrastructure, devops] |
| 6 | + |
| 7 | +--- |
| 8 | +<!-- |
| 9 | +SPDX-License-Identifier: CC-BY-SA-4.0 |
| 10 | +
|
| 11 | +SPDX-FileCopyright Text: 2025 Muhammad Salman <chsalmanramzan422@gmail.com> |
| 12 | +--> |
| 13 | + |
| 14 | +# Week 3 |
| 15 | + |
| 16 | +*(June 17, 2025 - June 23, 2025)* |
| 17 | + |
| 18 | +## Challenges I Faced |
| 19 | + |
| 20 | +**Database Connection Trouble:** The web pod was starting before the database is ready, showing "Could not connect to FOSSology database. |
| 21 | + |
| 22 | +**Reboot Glitch:** After a reboot, the UI sometimes reverted to the default Debian Apache screen. |
| 23 | + |
| 24 | +**Image Pull Issues:** Kubernetes couldn’t grab the <code>fossology/scheduler:3.11.0 </code> image from Docker Hub, causing <code>ImagePullBackOff</code> errors. |
| 25 | + |
| 26 | +**Fixed Scheduler Build Error:** I ran into a <code>no curl.h file</code> error while building the scheduler. I added <code>libcurl4-openssl-dev</code> to **Dockerfile** and **Dockerfile.pkg** to fix it, so the scheduler could build properly. |
| 27 | + |
| 28 | +**Scheduler Pod Keeps Crashing:** The **scheduler** pod wass stucked in a <code>CrashLoopBackOff</code> loop because of a PostgreSQL error: <code>tables can have at most 1600 columns</code> when adding a new column to the license_candidate table. This happens during database updates and makes the pod crash every time it restarts. |
| 29 | + |
| 30 | +## What I Got Done |
| 31 | + |
| 32 | +**Checked Database Connection:** I made sure the database was working: |
| 33 | + |
| 34 | +- Ran <code>kubectl get svc</code> to see the database service on port <code>5432:30543/TCP</code>. |
| 35 | + |
| 36 | +- Used a debug pod with <code>kubectl run -it --rm debug-pod --image=postgres --restart=Never -- bash</code> and connected with <code>psql -h db -U fossy -d fossology</code> to confirm the database was up. |
| 37 | + |
| 38 | +- Tested with <code>kubectl port-forward svc/db 5432:5432</code> and checked web pod settings with <code>kubectl exec -it web-pod -- env | grep -i db</code>. Everything checked out locally! |
| 39 | + |
| 40 | +**Debugged Kubernetes Pods:** I dug into the scheduler issues with: |
| 41 | + |
| 42 | +- <code>kubectl get pods</code> to spot <code>CrashLoopBackOff</code> and <code>ImagePullBackOff</code>. |
| 43 | + |
| 44 | +- <code>kubectl logs scheduler-cf985bd75-tbf22</code> to check the error details. |
| 45 | + |
| 46 | +- <code>kubectl rollout restart deployment scheduler</code> and <code>kubectl delete pod scheduler-cf985bd75-tbf22</code> to restart the pod. |
| 47 | + |
| 48 | +- Built a custom scheduler Dockerfile and loaded it into Minikube to work around the image pull issue, though it’s a temporary fix. |
| 49 | + |
| 50 | +**Fixed Web Pod Startup:** To stop the web pod from starting too early, I updated <code>k8s/20-web-deployment.yaml</code> with a <code>wait-for-db</code> section using BusyBox. It checks if the database is ready with <code>nc -z $(FOSSOLOGY_DB_HOST) 5432</code>. |
| 51 | + |
| 52 | +After running <code>kubectl apply -f k8s/20-web-deployment.yaml</code>, the logs showed **“Fossology initialisation complete; Starting up...”**. |
| 53 | + |
| 54 | +**Cleared Database Issues:** To fix the PostgreSQL column error, I reset the database by running <code>kubectl delete pod db-0, kubectl delete pvc database</code>, and <code>kubectl apply -f k8s/</code> to start fresh. |
| 55 | + |
| 56 | +**Got the FOSSology UI Working:** I built the web pod with <code>docker build -t fossology/web:3.11.0-fixed .</code> and the FOSSology UI popped up at http://192.168.49.2:30745. Below are the ss of FOSSology UI. |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +## Meeting 1 |
| 65 | + |
| 66 | +*(June 18, 2025)* |
| 67 | + |
| 68 | +I was supposed to meet with my mentor [Avinal](https://github.com/avinal), but he was out of the country and couldn’t make it. I shared a Google Docs link with my progress to keep him updated and we planned to catch up around June 22. |
| 69 | + |
| 70 | +## Meeting 2 ## |
| 71 | + |
| 72 | +*(June 19, 2025)* |
| 73 | + |
| 74 | +I shared all my progress with the FOSSology team in community meeting, from getting the database connection working and the scheduler’s <code>ImagePullBackOff</code> error and building my own Dockerfile for temporary testing. I also talked about the web pod starting too early and the <code>CrashLoopBackOff</code> issue. The mentors suggested trying **Helm Charts** to make deployments easier. |
| 75 | + |
| 76 | +## Meeting 3 ## |
| 77 | + |
| 78 | +*(June 23, 2025)* |
| 79 | + |
| 80 | +I had an awesome call with my mentor [Avinal](https://github.com/avinal). We went over everything: the FOSSology UI is up and running, most pods (like <code>db-0</code> and <code>web</code>) are working great, but the scheduler pod’s <code>CrashLoopBackOff</code> is messing with the upload and copyright features. We used **K9s** to check the pod logs and figure out what’s causing the crashes. Together, we cleaned up some unnecessary changes and got a better understanding of how everything connects. We didn’t fully fix the scheduler, but we end the call with a clear plan and tons of motivation! |
| 81 | + |
| 82 | +This week gave me a deeper understanding of Microservice deployments, container orchestration and Kubernetes troubleshooting. The UI loading successfully is the big win, but the scheduler pod still needs Running status. |
| 83 | + |
| 84 | +## Planning Next Week |
| 85 | + |
| 86 | +For Week 4, I’m ready to dive into: |
| 87 | + |
| 88 | +- Fix the scheduler pod’s <code>CrashLoopBackOff</code> issue and make sure the database updates work smoothly. |
| 89 | + |
| 90 | +- Work on getting all pods up and running properly and test the overall functionality on the FOSSology UI. |
| 91 | + |
| 92 | +- Once everything is stable, I’ll test the upload and copyright features to confirm that all parts of FOSSology are working correctly. |
| 93 | + |
| 94 | +- I also plan to clean up and finalize all proposed changes in the code. |
| 95 | + |
| 96 | +- After resolving any conflicts and verifying the changes, I will commit and push the updates to get feedback from my mentors. |
| 97 | + |
0 commit comments