linuxserver / docker-snipe-it

Alpine/Nginx container for the Asset Management software Snipe-IT
GNU General Public License v3.0
122 stars 26 forks source link

Snipe-IT Pre-Flight FAILED (APP_URL error) #69

Closed caburmij closed 1 month ago

caburmij commented 4 months ago

Is there an existing issue for this?

Current Behavior

I am getting the following error when I navigate to http://localhost:8080/setup

" Uh oh! Snipe-IT thinks your URL is http://localhost:8080/setup, but your real URL is http://localhost/setup Please update your APP_URL settings in your .env file"

image

I am using the same ports and environmental variables in the linuxserver.io documentation:

ports:
  - 8080:80
 environment
  - APP_URL=http://localhost:8080

This is for testing purposes and will be changed later however I cannot get past this warning. If I make the changes to the following (which I assume are wrong) in the compose file:

APP_URL=http://localhost:8080/setup

I get routed to this URL:

http://localhost:8080/setup/setup

and when I go back to dashboard this is what it looks like:

image

I have seen multiple other issues with this same or similar problem opened up in the past and the solution has either been "please just wait" or to just mark the issue "resolved" without any resolution.

I am curious if this is just user error, if maybe there is something wrong in the documentation or if this is a real bug and needs to be fixed.

If there is a workaround, there is nothing clearly stated in the documentation that I am aware of.

If I do go ahead and click on "Next: Create Database Tables" then I am greeted with a 500 error

image

Expected Behavior

IM not entirely sure what the expected behavior is since I have never used snipe-it before nor hae I gotten this to work successfully in the past as of yet however I assume it would give me a pass instead of an error

Steps To Reproduce

I used the config provided below, with docker compose, and I get the error as I described.

Environment

- OS: Rocky Linux 9
- How docker service was installed: 

sudo dnf update -y
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf install docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
sudo systemctl enable docker

CPU architecture

x86-64

Docker creation

---
services:
  snipe-it:
    image: lscr.io/linuxserver/snipe-it:latest
    container_name: snipe-it
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - APP_URL=http://localhost:8080
      - MYSQL_PORT_3306_TCP_ADDR=${DB_ADDR}
      - MYSQL_PORT_3306_TCP_PORT=${DB_PORT}
      - MYSQL_DATABASE=${DB_DATABASE}
      - MYSQL_USER=${DB_USER}
      - MYSQL_PASSWORD=${DB_PASSWD}
    volumes:
      - ${DIR_CONFIG}:/config
    ports:
      - 8080:80
    restart: unless-stopped
    depends_on:
      - mariadb

  mariadb:
    image: lscr.io/linuxserver/mariadb:latest
    container_name: snipe-it_db
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWD}
      - MYSQL_DATABASE=${DB_DATABASE}
      - MYSQL_USER=${DB_USER}
      - MYSQL_PASSWORD=${DB_PASSWD}
    volumes:
      - ${DIR_DB}:/config
    ports:
      - ${PORT_3306}:3306
    restart: unless-stopped

Container logs

───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support the app dev(s) visit:
Snipe-IT: https://snipeitapp.com/donate

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────

using keys found in /config/keys
[custom-init] No custom files found, skipping...
[ls.io-init] done.

[migrations] started
[migrations] no migrations found
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────

Setting Up Initial Databases
Installing MariaDB/MySQL system tables in '/config/databases' ...
2024-05-23  5:13:50 1 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1017: Can't find file: './mysql/' (errno: 2 "No such file or directory")
OK

To start mariadbd at boot time you have to copy
support-files/mariadb.service to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following command:

'/usr/bin/mariadb-secure-installation'

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at https://mariadb.com/kb

You can start the MariaDB daemon with:
cd '/usr' ; /usr/bin/mariadb-safe --datadir='/config/databases'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/mysql-test' ; perl mariadb-test-run.pl

Please report any problems at https://mariadb.org/jira

The latest information about MariaDB is available at https://mariadb.org/.

Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

2024-05-23  5:15:16 0 [Note] Starting MariaDB 10.11.6-MariaDB-log source revision fecd78b83785d5ae96f2c6ff340375be803cd299 as process 194
2024-05-23  5:15:16 0 [Note] InnoDB: Compressed tables use zlib 1.3.1
2024-05-23  5:15:16 0 [Note] InnoDB: Number of transaction pools: 1
2024-05-23  5:15:16 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2024-05-23  5:15:16 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
2024-05-23  5:15:16 0 [Note] InnoDB: Using Linux native AIO
2024-05-23  5:15:16 0 [Note] InnoDB: Initializing buffer pool, total size = 256.000MiB, chunk size = 4.000MiB
2024-05-23  5:15:16 0 [Note] InnoDB: Completed initialization of buffer pool
2024-05-23  5:15:16 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
2024-05-23  5:15:16 0 [Note] InnoDB: End of log at LSN=46878
2024-05-23  5:15:16 0 [Note] InnoDB: 128 rollback segments are active.
2024-05-23  5:15:16 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2024-05-23  5:15:16 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2024-05-23  5:15:16 0 [Note] InnoDB: log sequence number 46878; transaction id 14
2024-05-23  5:15:16 0 [Note] InnoDB: Loading buffer pool(s) from /config/databases/ib_buffer_pool
2024-05-23  5:15:16 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-05-23  5:15:16 0 [Note] InnoDB: Buffer pool(s) load completed at 240523  5:15:16
2024-05-23  5:15:16 0 [Note] Server socket created on IP: '0.0.0.0'.
2024-05-23  5:15:16 0 [Note] Server socket created on IP: '::'.
2024-05-23  5:15:16 0 [Note] mariadbd: ready for connections.
Version: '10.11.6-MariaDB-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Alpine Linux
2024-05-23  5:15:18 0 [Note] mariadbd (initiated by: root[root] @ localhost []): Normal shutdown
2024-05-23  5:15:18 0 [Note] InnoDB: FTS optimize thread exiting.
2024-05-23  5:15:18 0 [Note] InnoDB: Starting shutdown...
2024-05-23  5:15:18 0 [Note] InnoDB: Dumping buffer pool(s) to /config/databases/ib_buffer_pool
2024-05-23  5:15:18 0 [Note] InnoDB: Buffer pool(s) dump completed at 240523  5:15:18
2024-05-23  5:15:18 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
2024-05-23  5:15:18 0 [Note] InnoDB: Shutdown completed; log sequence number 46878; transaction id 16
2024-05-23  5:15:18 0 [Note] mariadbd: Shutdown complete

Database Setup Completed
[custom-init] No custom files found, skipping...
240523 05:15:19 mysqld_safe Logging to '/config/databases/cb08fae56b5c.err'.
240523 05:15:19 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Connection to localhost (::1) 3306 port [tcp/mysql] succeeded!
[ls.io-init] done.
github-actions[bot] commented 4 months ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

LinuxServer-CI commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 2 weeks ago

This issue is locked due to inactivity