Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?] Errors when using paperless with https+own domain, no errors when using http+ip #167

Open
FHeilmann opened this issue Jan 30, 2025 · 1 comment

Comments

@FHeilmann
Copy link

FHeilmann commented Jan 30, 2025

Setup

  • paperless-ngx running in my home network, reachable under its own IP at port 80
  • paperless-gpt (commit 32cc3d2 running on my personal computer for testing)
  • traefik reverse proxy running in my home network
  • own domain with letsencrypt certificate, any requests to any subdomain are pointed at my traefik instance

Issue description

I'm currently trying to set up paperless-gpt in my homelab and have noticed the following issues:

When I run paperless-gpt while pointing it at the domain of my paperless installation like so:

docker run -d \
  -e PAPERLESS_BASE_URL='https://paperless.mydomain' \
  -e PAPERLESS_API_TOKEN='mytoken' \
  -e LLM_PROVIDER='ollama' \
  -e LLM_MODEL='llama2' \
  -e AUTO_TAG='PaperlessGPTTagAuto' \
  -e MANUAL_TAG='PaperlessGPTTagManual' \
  -e MANUAL_OCR_TAG='PaperlessGptOCR' \
  -e LLM_LANGUAGE='English' \
  -e LOG_LEVEL='debug' \
  -p 8080:8080 \
  paperless-gpt

paperless will not start up correctly and spam the log with the following error messages:

2025-01-30 11:27:59 time="2025-01-30T10:27:59Z" level=error msg="Error fetching documents: invalid character '<' looking for beginning of value"

2025-01-30 11:27:57 time="2025-01-30T10:27:57Z" level=error msg="Error in processAutoTagDocuments: error in processAutoTagDocuments: error fetching documents with autoTag: invalid character '<' looking for beginning of value"

If I instead run paperless-gpt with the following command, pointing it at the IP of my paperless-ngx instance and using http instead of the subdomain with https:

docker run -d \
  -e PAPERLESS_BASE_URL='http://<paperless_ip>' \
  -e PAPERLESS_API_TOKEN='mytoken' \
  -e LLM_PROVIDER='ollama' \
  -e LLM_MODEL='llama2' \
  -e AUTO_TAG='PaperlessGPTTagAuto' \
  -e MANUAL_TAG='PaperlessGPTTagManual' \
  -e MANUAL_OCR_TAG='PaperlessGptOCR' \
  -e LLM_LANGUAGE='English' \
  -e LOG_LEVEL='debug' \
  -p 8080:8080 \
  paperless-gpt

paperless-gpt will start up correctly without any errors. I assume the < error stems from something trying to parse <nil> and failing. Has anyone successfully managed to run paperless-gpt against a paperless-ngx server behind a custom domain with SSL certificate?

Thanks for your time and consideration!

Addendum: Full startup logs of paperless GPT for the two cases:

With https + domain

2025-01-30 11:37:42 Using PaperlessGPTTagManual as manual tag
2025-01-30 11:37:42 Using PaperlessGPTTagAuto as auto tag
2025-01-30 11:37:42 
2025-01-30 11:37:42     ╔═══════════════════════════════════════╗
2025-01-30 11:37:42     ║             Paperless GPT             ║
2025-01-30 11:37:42     ╚═══════════════════════════════════════╝
2025-01-30 11:37:42 
2025-01-30 11:37:42 Version: docker-dev
2025-01-30 11:37:42 Commit: unknown
2025-01-30 11:37:42 Build Date: unknown
2025-01-30 11:37:42 Platform: linux/amd64
2025-01-30 11:37:42 Go Version: go1.23.4
2025-01-30 11:37:42 Started: Thu, 30 Jan 2025 10:37:42 UTC
2025-01-30 11:37:42 
2025-01-30 11:37:42 time="2025-01-30T10:37:42Z" level=info msg="Worker 0 started"
2025-01-30 11:37:42 [GIN] 2025/01/30 - 10:37:42 | 500 |   91.251526ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:37:42 [GIN] 2025/01/30 - 10:37:42 | 500 |  123.753967ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:37:42 [GIN] 2025/01/30 - 10:37:42 | 500 |   43.059463ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:37:42 [GIN] 2025/01/30 - 10:37:42 | 500 |   42.112305ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:37:43 [GIN] 2025/01/30 - 10:37:43 | 500 |   46.089673ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:37:42 time="2025-01-30T10:37:42Z" level=error msg="Could not read prompts/title_prompt.tmpl, using default template: open prompts/title_prompt.tmpl: no such file or directory"
2025-01-30 11:37:42 time="2025-01-30T10:37:42Z" level=error msg="Could not read prompts/tag_prompt.tmpl, using default template: open prompts/tag_prompt.tmpl: no such file or directory"
2025-01-30 11:37:42 time="2025-01-30T10:37:42Z" level=error msg="Could not read prompts/correspondent_prompt.tmpl, using default template: open prompts/correspondent_prompt.tmpl: no such file or directory"
2025-01-30 11:37:42 time="2025-01-30T10:37:42Z" level=error msg="Could not read prompts/ocr_prompt.tmpl, using default template: open prompts/ocr_prompt.tmpl: no such file or directory"
2025-01-30 11:37:42 time="2025-01-30T10:37:42Z" level=info msg="Vision LLM not enabled"
2025-01-30 11:37:42 time="2025-01-30T10:37:42Z" level=info msg="Server started on interface :8080"
2025-01-30 11:37:42 time="2025-01-30T10:37:42Z" level=error msg="Error in processAutoTagDocuments: error in processAutoTagDocuments: error fetching documents with autoTag: invalid character '<' looking for beginning of value"
2025-01-30 11:37:42 time="2025-01-30T10:37:42Z" level=error msg="Error fetching documents: invalid character '<' looking for beginning of value"
2025-01-30 11:37:42 time="2025-01-30T10:37:42Z" level=error msg="Error fetching documents: invalid character '<' looking for beginning of value"
2025-01-30 11:37:42 time="2025-01-30T10:37:42Z" level=error msg="Error fetching documents: invalid character '<' looking for beginning of value"
2025-01-30 11:37:42 time="2025-01-30T10:37:42Z" level=error msg="Error fetching documents: invalid character '<' looking for beginning of value"
2025-01-30 11:37:43 time="2025-01-30T10:37:43Z" level=error msg="Error fetching documents: invalid character '<' looking for beginning of value"
2025-01-30 11:37:44 time="2025-01-30T10:37:44Z" level=error msg="Error fetching documents: invalid character '<' looking for beginning of value"
2025-01-30 11:37:44 [GIN] 2025/01/30 - 10:37:44 | 500 |   42.826563ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:37:45 time="2025-01-30T10:37:45Z" level=error msg="Error fetching documents: invalid character '<' looking for beginning of value"
2025-01-30 11:37:45 [GIN] 2025/01/30 - 10:37:45 | 500 |   49.084046ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:37:46 time="2025-01-30T10:37:46Z" level=error msg="Error fetching documents: invalid character '<' looking for beginning of value"
2025-01-30 11:37:46 [GIN] 2025/01/30 - 10:37:46 | 500 |   43.083048ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:37:47 [GIN] 2025/01/30 - 10:37:47 | 500 |     44.9398ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:37:47 time="2025-01-30T10:37:47Z" level=error msg="Error fetching documents: invalid character '<' looking for beginning of value"

With http + IP

2025-01-30 11:38:34 Using PaperlessGPTTagManual as manual tag
2025-01-30 11:38:34 Using PaperlessGPTTagAuto as auto tag
2025-01-30 11:38:34 
2025-01-30 11:38:34     ╔═══════════════════════════════════════╗
2025-01-30 11:38:34     ║             Paperless GPT             ║
2025-01-30 11:38:34     ╚═══════════════════════════════════════╝
2025-01-30 11:38:34 
2025-01-30 11:38:34 Version: docker-dev
2025-01-30 11:38:34 Commit: unknown
2025-01-30 11:38:34 Build Date: unknown
2025-01-30 11:38:34 Platform: linux/amd64
2025-01-30 11:38:34 Go Version: go1.23.4
2025-01-30 11:38:34 Started: Thu, 30 Jan 2025 10:38:34 UTC
2025-01-30 11:38:34 
2025-01-30 11:38:34 time="2025-01-30T10:38:34Z" level=info msg="Worker 0 started"
2025-01-30 11:38:34 [GIN] 2025/01/30 - 10:38:34 | 200 |  186.633423ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:38:34 [GIN] 2025/01/30 - 10:38:34 | 200 |  217.794115ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:38:34 [GIN] 2025/01/30 - 10:38:34 | 200 |  197.850198ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:38:34 [GIN] 2025/01/30 - 10:38:34 | 200 |  151.986734ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:38:34 [GIN] 2025/01/30 - 10:38:34 | 200 |  124.977313ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:38:35 [GIN] 2025/01/30 - 10:38:35 | 200 |  118.355398ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:38:36 [GIN] 2025/01/30 - 10:38:36 | 200 |  117.461745ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:38:34 time="2025-01-30T10:38:34Z" level=error msg="Could not read prompts/title_prompt.tmpl, using default template: open prompts/title_prompt.tmpl: no such file or directory"
2025-01-30 11:38:34 time="2025-01-30T10:38:34Z" level=error msg="Could not read prompts/tag_prompt.tmpl, using default template: open prompts/tag_prompt.tmpl: no such file or directory"
2025-01-30 11:38:34 time="2025-01-30T10:38:34Z" level=error msg="Could not read prompts/correspondent_prompt.tmpl, using default template: open prompts/correspondent_prompt.tmpl: no such file or directory"
2025-01-30 11:38:34 time="2025-01-30T10:38:34Z" level=error msg="Could not read prompts/ocr_prompt.tmpl, using default template: open prompts/ocr_prompt.tmpl: no such file or directory"
2025-01-30 11:38:37 [GIN] 2025/01/30 - 10:38:37 | 200 |   116.27501ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:38:38 [GIN] 2025/01/30 - 10:38:38 | 200 |   118.82812ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:38:39 [GIN] 2025/01/30 - 10:38:39 | 200 |  110.982298ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:38:40 [GIN] 2025/01/30 - 10:38:40 | 200 |  116.792172ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:38:42 [GIN] 2025/01/30 - 10:38:42 | 200 |   116.19173ms |      172.17.0.1 | GET      "/api/documents"
2025-01-30 11:38:43 [GIN] 2025/01/30 - 10:38:43 | 200 |  115.853105ms |      172.17.0.1 | GET      "/api/documents"
@mkrinke
Copy link
Contributor

mkrinke commented Feb 12, 2025

this fixed it for me: #230

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants