Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

ICS205 - http panic - Empty filename is not allowed

20 views
Skip to first unread message

Mike Abbey

unread,
Jan 21, 2025, 12:58:16 PMJan 21
to pat-users
Hello,

I'm a new user to Pat and could use some assistance.  

OS: Ubuntu 24.04.1 LTS
Pat version: Pat v0.16.0 (823b991) linux/amd64 - go1.22.2

I am unable to send ICS205 form, below is my approach and the errors returned:
 
Template > ICS USA Forms > ICS205 Radio Plan

When clicking "submit", then "ok", a browser window launches to the URL below with error "The connection was reset"

http://localhost:8080/api/form?template=ICS+USA+Forms%2FICS205+Radio+Plan.txt

In the Pat shell, the following messages are generated:

2025/01/21 12:50:02 http: panic serving 127.0.0.1:50330: Empty filename is not allowed
goroutine 89 [running]:
net/http.(*conn).serve.func1()
/usr/local/go/src/net/http/server.go:1898 +0xbe
panic({0x8f3060?, 0xbfbc50?})
/usr/local/go/src/runtime/panic.go:770 +0x132
github.com/la5nta/wl2k-go/fbb.NewFile(...)
/go/pkg/mod/github.com/la5nta/wl2...@v0.11.8/fbb/message.go:538
github.com/la5nta/pat/internal/forms.messageBuilder.buildAttachments({0x0, 0x0, {{0xc0001c8037, 0x11}, {0xc0001c8000, 0x4c}, {0xc0001c7920, 0x55}, {0xc0001c79e0, 0x54}, ...}, ...})
/src/internal/forms/builder.go:152 +0x5c5
github.com/la5nta/pat/internal/forms.messageBuilder.build({0x0, 0x0, {{0xc0001c8037, 0x11}, {0xc0001c8000, 0x4c}, {0xc0001c7920, 0x55}, {0xc0001c79e0, 0x54}, ...}, ...})
/src/internal/forms/builder.go:47 +0x198
github.com/la5nta/pat/internal/forms.(*Manager).PostFormDataHandler(0xc000141200, {0xc02b28, 0xc0002b0620}, 0xc00056f440)
/src/internal/forms/forms.go:162 +0x858
net/http.HandlerFunc.ServeHTTP(0xc00056f320?, {0xc02b28?, 0xc0002b0620?}, 0x1?)
/usr/local/go/src/net/http/server.go:2166 +0x29
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0001560c0, {0xc02b28, 0xc0002b0620}, 0xc00056f200)
/go/pkg/mod/github.com/gorilla/m...@v1.8.0/mux.go:210 +0x1e2
net/http.serverHandler.ServeHTTP({0xc00ed0?}, {0xc02b28?, 0xc0002b0620?}, 0x6?)
/usr/local/go/src/net/http/server.go:3137 +0x8e
net/http.(*conn).serve(0xc0001da090, {0xc03128, 0xc00042e360})
/usr/local/go/src/net/http/server.go:2039 +0x5e8
created by net/http.(*Server).Serve in goroutine 28
/usr/local/go/src/net/http/server.go:3285 +0x4b4
2025/01/21 12:50:02 http: panic serving 127.0.0.1:35946: Empty filename is not allowed
goroutine 103 [running]:
net/http.(*conn).serve.func1()
/usr/local/go/src/net/http/server.go:1898 +0xbe
panic({0x8f3060?, 0xbfbc50?})
/usr/local/go/src/runtime/panic.go:770 +0x132
github.com/la5nta/wl2k-go/fbb.NewFile(...)
/go/pkg/mod/github.com/la5nta/wl2...@v0.11.8/fbb/message.go:538
github.com/la5nta/pat/internal/forms.messageBuilder.buildAttachments({0x0, 0x0, {{0xc00046fcf7, 0x11}, {0xc00046fcc0, 0x4c}, {0xc0001c7b60, 0x55}, {0xc0001c7c20, 0x54}, ...}, ...})
/src/internal/forms/builder.go:152 +0x5c5
github.com/la5nta/pat/internal/forms.messageBuilder.build({0x0, 0x0, {{0xc00046fcf7, 0x11}, {0xc00046fcc0, 0x4c}, {0xc0001c7b60, 0x55}, {0xc0001c7c20, 0x54}, ...}, ...})
/src/internal/forms/builder.go:47 +0x198
github.com/la5nta/pat/internal/forms.(*Manager).PostFormDataHandler(0xc000141200, {0xc02b28, 0xc0002b0000}, 0xc00056e5a0)
/src/internal/forms/forms.go:162 +0x858
net/http.HandlerFunc.ServeHTTP(0xc00056e480?, {0xc02b28?, 0xc0002b0000?}, 0x1?)
/usr/local/go/src/net/http/server.go:2166 +0x29
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0001560c0, {0xc02b28, 0xc0002b0000}, 0xc00056e000)
/go/pkg/mod/github.com/gorilla/m...@v1.8.0/mux.go:210 +0x1e2
net/http.serverHandler.ServeHTTP({0xc00ed0?}, {0xc02b28?, 0xc0002b0000?}, 0x6?)
/usr/local/go/src/net/http/server.go:3137 +0x8e
net/http.(*conn).serve(0xc0001da360, {0xc03128, 0xc00042e360})
/usr/local/go/src/net/http/server.go:2039 +0x5e8
created by net/http.(*Server).Serve in goroutine 28
/usr/local/go/src/net/http/server.go:3285 +0x4b4

Any advice is greatly appreciated.

73,
Mike - KC2NJ

Martin Hebnes Pedersen

unread,
Jan 21, 2025, 1:21:48 PMJan 21
to Mike Abbey, pat-users
Hi Mike,

I’ve opened an issue for this bug: https://github.com/la5nta/pat/issues/470.

It crashes because the form inserts a customer attachment without providing a filename. We have some logic to catch this and use a fallback attachment name, but this logic falls short causing a panic.

I’ll hopefully have a fix ready for the next release.

— 
73 de LA5NTA / Martin

--
You received this message because you are subscribed to the Google Groups "pat-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pat-users+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/pat-users/79a639bc-5595-479e-96dc-c0584d2d38e5n%40googlegroups.com.

Martin Hebnes Pedersen

unread,
Jan 21, 2025, 1:35:27 PMJan 21
to Mike Abbey, pat-users
Looking closer, I realize the bug is that the there is no real attachment here. The form includes attached_text set to an empty string.

I will harden the code to handle this better in future releases. As a temporary work-around you can set «Attach CSV data file to message?» to yes, to avoid the panic.

— 
73 de LA5NTA / Martin

Mike Abbey

unread,
Jan 21, 2025, 2:29:18 PMJan 21
to pat-users
Hi Martin,

That workaround was perfect - thank you for your assistance and thoughtful response.

73,
Mike - KC2NJ
Reply all
Reply to author
Forward
0 new messages