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

Docker install blank webpage #6972

Closed
1 of 7 tasks
minorDeveloper opened this issue Apr 7, 2024 · 9 comments
Closed
1 of 7 tasks

Docker install blank webpage #6972

minorDeveloper opened this issue Apr 7, 2024 · 9 comments
Labels
question This is a question setup Relates to the InvenTree setup / installation process

Comments

@minorDeveloper
Copy link

Deployment Method

  • Installer
  • Docker Development
  • Docker Production
  • Bare metal Development
  • Bare metal Production
  • Digital Ocean image
  • Other (please provide a link Steps to Reproduce

Describe the problem*

When I navigate to the web url described in my .env file I get an "unable to resolve error", and when I visit the port set for the webpage I get a blank page with no content.

Steps to Reproduce

I've installed inventree using the docker install on a raspberry pi as described in the install instructions.

I run various services on this raspberry pi and separate access via port, and so I have made two changes to my .env file:
INVENTREE_SITE_URL="http://inventree.homepi.local"
INVENTREE_WEB_PORT=8089

I am unable to resolve inventree.homepi.local, however when I go to homepi.local:8089 I do get a 200 code response, but it is a completely blank webpage with no content. This is generated by inventree as when I stop the containers I go back to being unable to resolve.

When I use curl I get the following:

  • Connected to homepi.local port 8089

GET / HTTP/1.1
Host: homepi.local:8089
User-Agent: curl/8.4.0
Accept: /

< HTTP/1.1 200 OK
< Server: Caddy
< Date: Sun, 07 Apr 2024 14:12:53 GMT
< Content-Length: 0
<

  • Connection #0 to host homepi.local left intact

Relevant log output

No response

@minorDeveloper minorDeveloper added question This is a question setup Relates to the InvenTree setup / installation process triage:not-checked Item was not checked by the core team labels Apr 7, 2024
@matmair
Copy link
Contributor

matmair commented Apr 7, 2024

If you use a custom port you will need to include that in the site_url

@matmair matmair removed setup Relates to the InvenTree setup / installation process triage:not-checked Item was not checked by the core team labels Apr 7, 2024
@minorDeveloper
Copy link
Author

Including the port in the site url results in being unable to resolve that url. I no longer get a status 200 response.

INVENTREE_SITE_URL="http://inventree.homepi.local:8089"
INVENTREE_WEB_PORT=8089

@SchrodingersGat
Copy link
Member

Do not set INVENTREE_WEB_PORT to a custom value - delete that from your .env file. That is not the external web port, it is the internal web port within the docker container and should not be changed.

@minorDeveloper
Copy link
Author

I have removed the web port customisation from the .evn file, and all that remains is:
INVENTREE_SITE_URL="http://inventree.homepi.local:8089/"

But I still get no response from that URL and the server seems to keep restarting in it's docker container.

@SchrodingersGat
Copy link
Member

and the server seems to keep restarting in it's docker container.

Ok, so what does the server container logs tell you? If it is restarting it should have an error message

@chille
Copy link

chille commented May 15, 2024

EDIT: I updated the information in this post. It turned out to be slightly different from what I first thought.

I was just about to open a new issue, and then I found this, so I post my findings here.

INVENTREE_SITE_URL is not validated correct

I just updated to version 0.15.1. After the update my inventree-server and inventree-worker containers could not be started anymore. The "invoke update" command would also fail. I got the following error message:

"ERROR No CSRF_TRUSTED_ORIGINS specified. Please provide a list of trusted origins, or specify INVENTREE_SITE_URL"

I then specified a INVENTREE_SITE_URL in my .env

INVENTREE_SITE_URL="http://pi-server:1337"

However, now I got a new error message. It does seems that InvenTree does not like the format of the "INVENTREE_SITE_URL".

  File "/home/inventree/src/backend/InvenTree/InvenTree/settings.py", line 1026, in <module>
    validator(SITE_URL)

I played around with a dozen different settings, all gave the same problem. But when I reverted back to the example in the documentation it turned out to work fine.

INVENTREE_SITE_URL="http://inventree.local"

After playing around a bit more I figured out the problem seems to be in the validation of the URL. It does seems that you need a TLD in the URL. I have set up my domain via /etc/hosts and do not use a TLD, so it fails.

@SchrodingersGat
Copy link
Member

@chille to clarify:

  • You are hosting InvenTree at http://pi-server:1337
  • You specify INVENTREE_SITE_URL = http://pi-server:1337
  • InvenTree fails to start because it considers the URL "invalid"?

Can you please share the full error log when you launch the server with the URL as above?

@matmair
Copy link
Contributor

matmair commented May 27, 2024

@chille @minorDeveloper could you respond to the latest message so we might resolve or close this?

@matmair matmair added the setup Relates to the InvenTree setup / installation process label May 27, 2024
@minorDeveloper
Copy link
Author

@matmair the error was related to a very niche docker networking issue caused by another container. Running inventree in isolation had no issues. This can be closed.

I will continue to explore why this happened and if I figure it out I will reply here to assist with anyone with the same issue in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is a question setup Relates to the InvenTree setup / installation process
Projects
None yet
Development

No branches or pull requests

4 participants