isis.lua:36: attempt to concatenate local 'username' (a nil value)

Open Beginner friendly
#186 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
lua, nginx

Research direction

The error is raised in lua/lib/isis.lua inside log_auth_outcome, around line 36, where username is concatenated into a log string. Read authenticate_user (around line 29) and its caller in authentication.lua near line 60 to see when username can be nil. Done means the log call no longer throws when username is nil and still writes a useful entry. Run the auth path with a request that has no user to confirm.

Written by the indexing model from the issue text.

Description

About

We just spotted a little hiccup in the server logs that can be improved.

Details

2026/11/03 00:34:23 [info] 19516#0: *2925124 [lua] access.lua:144: Require authentication to "/xmlrpc.php", client: 181.224.223.7, server: patent-archive.example.org, request: "POST /xmlrpc.php HTTP/1.1", host: "server.example.net"
2026/11/03 00:34:23 [error] 19516#0: *2925124 upstream prematurely closed connection while reading response header from upstream, client: 181.224.223.7, server: patent-archive.example.org, request: "POST /xmlrpc.php HTTP/1.1", subrequest: "/api/identity/auth", upstream: "uwsgi://unix:/run/uwsgi/app/patzilla/socket:", host: "server.example.net"
2026/11/03 00:34:23 [error] 19516#0: *2925124 lua entry thread aborted: runtime error: /opt/patentsearch/nginx-auth/lua/lib/isis.lua:36: attempt to concatenate local 'username' (a nil value)
stack traceback:
coroutine 0:
	/opt/patentsearch/nginx-auth/lua/lib/isis.lua: in function 'log_auth_outcome'
	/opt/patentsearch/nginx-auth/lua/lib/isis.lua:29: in function 'authenticate_user'
	/opt/patzilla/nginx-auth/lua/authentication.lua:60: in function </opt/patzilla/nginx-auth/lua/authentication.lua:1> while sending to client, client: 181.224.223.7, server: patent-archive.example.org, request: "POST /xmlrpc.php HTTP/1.1", host: "server.example.net"
Dominant language
Python
Stars
123
Forks
31
Avg merge
3h 7m
Merged PRs (30d)
71

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ip-tools/patzilla

All issues in ip-tools/patzilla

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.