Practical .NET, software, and AI tutorials by Gerard Beckerleg, a developer in Sydney.
- Traefik + Cloudflare: Fix 526 SSL Error by Switching to DNS Challenge
Traefik uses HTTP-01 ACME challenge by default. The way it works is: Let’s Encrypt sends a request to http://yourdomain/.well-known/acme-challenge/<token> and checks that Traefik responds with the right token. If it does, cert issued. The problem is Cloudflare. When the orange cloud proxy is on, Let’s Encrypt’s request hits Cloudflare’s servers, not your origin. Traefik placed the challenge token on the origin. Cloudflare has no idea it’s there. It returns a 404. Let’s Encrypt fails the validation. No cert.
- Self-Hosted Hugo Blog: Forgejo + Forgejo Actions + nginx + Traefik
A walkthrough of migrating this blog off AWS (CodeCommit + CodeBuild + S3 + CloudFront) onto a self-hosted stack using Forgejo for git and CI/CD. Most of the config was written by Claude Code. The old AWS stack was four services doing what two containers now do. The migration was part of a consolidation onto Oracle Cloud free tier VMs. The target infrastructure was already there: a Forgejo instance on one VM and a Docker/Traefik apps server on another.
- Ubuntu on Windows Subsystem for Linux (WSL 2) can't open /var/run/atd.pid to signal atd. No atd running?
When trying to add a scheduled script using at on Ubuntu in Windows Subsystem for Linux (WSL 2) using the following command: at now + 1 minute -f testat.sh I recieved the following error: Can't open /var/run/atd.pid to signal atd. No atd running? This is due to the fact that the at daemon is not running, to start the daemon use:
- VS Code Interactive Notebook '*-*' is not a valid version string
When installing a NuGet Package in a VS Code Interactive Notebook with a C# (.NET Interactive) code block using the follwing command I copied from this Microsoft tutorial: #r "nuget:Microsoft.DotNet.Interactive.SqlServer, *-*" I recevied the following error: '*-*' is not a valid version string In order to fix this I went and found the latest version number from the NuGet Gallery page for the package and updated the command to include a specific package number instead of the *-*:
- LangChain Expression Language crashes on pydantic v2 inputs
LangChain Expression Language crashes on pydantic v2 inputs Hooked a simple chain into LEL: from langchain_experimental.expression_language import chain from pydantic import BaseModel class Input(BaseModel): q: str result = chain("{q}").run(Input(q="hi")) Traceback: AttributeError: 'str' object has no attribute 'model_dump' Python 3.12.1, langchain 0.3.0, expression-language 0.0.5, pydantic 2.8.2. Same code worked with pydantic 1.10.
- GPT-4o returns JSON with trailing comma in tool call
GPT-4o returns JSON with trailing comma in tool call While parsing function‑call output from GPT‑4o the JSON loader threw: json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 98 (char 97) The model emitted: { "name": "getStockPrice", "arguments": { "ticker": "AMD", }, "id": "abc" } Note the trailing comma after "AMD". Added a pre‑parse scrub: import re, json clean = re.sub(r",\s*([}\]])", r"\1", raw) data = json.loads(clean) Also set response_format={"type":"json_object"} in the request; 4o obeys the flag half the time.
- Cloudflare Pages /opt/build/bin/build: line 39: zola: command not found
While deploying a test Zola site to Cloudflare Pages I recieved the following error in the build logs: /opt/build/bin/build: line 39: zola: command not found The error is because in order to use Zola with Cloudflare Pages you need to specify the version of Zola that you are using in a Production Environment Variable like so:
- Anthropic Messages API truncates tools array
Anthropic Messages API truncates tools array Today a Claude 3 call with tool definitions started ignoring the last tool in the list. No errors, just missing. Payload contained eight tool specs. Each one about 5 k‑char JSON. The docs mention a 64 k request cap; combined tools plus prompt was ~66 k.
- Gemini 1.5 Flash API payload exceeds 32k window silently
Gemini 1.5 Flash API payload exceeds 32k window silently Pushed a long system prompt and history to the beta Flash model last night. Response came back with the choices array empty and no error. Curl payload size about 38 KB, token count around 34 k. Google’s docs cap at 32 k but the endpoint returns 200 OK even when the limit is breached.
- LangGraph raises TypeError on function node output
LangGraph raises TypeError on function node output This morning my LangGraph flow crashed after a new tool node. TypeError: cannot unpack non-iterable ToolInvocation object Python 3.12, langgraph 0.3.8, langchain 0.2.1. The node function returned a ToolInvocation instead of (ToolInvocation, kwargs); API changed in 0.3.7. Fix: