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

"/startup.sh: line 57: [: =: unary operator expected" when "SESSION_DRIVER" is not defined #9705

Closed
2 tasks
derdeagle opened this issue Jun 12, 2021 · 2 comments

Comments

@derdeagle
Copy link

Please confirm you have done the following before posting your bug report:

Describe the bug
I am running Snipe-IT version 5.1.6 in docker via the official images and I noticed the following message during startup of the container.

Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1 | /startup.sh: line 57: [: =: unary operator expected

Jun 12 11:36:17 SERVER_FQDN systemd[1]: Started Docker Compose snipeit Service.
Jun 12 11:36:17 SERVER_FQDN docker-compose[3318935]: Creating network "snipeit_default" with the default driver
Jun 12 11:36:18 SERVER_FQDN docker-compose[3318935]: Creating snipeit_database_1 ...
Jun 12 11:36:18 SERVER_FQDN docker-compose[3318935]: Creating snipeit_database_1 ... done
Jun 12 11:36:18 SERVER_FQDN docker-compose[3318935]: Creating snipeit_snipeit_1  ...
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: Creating snipeit_snipeit_1  ... done
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: Attaching to snipeit_database_1, snipeit_snipeit_1
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12 09:36:18+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.10+maria~focal started.
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12 09:36:18+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12 09:36:18+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.10+maria~focal started.
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] mysqld (mysqld 10.5.10-MariaDB-1:10.5.10+maria~focal) starting as process 1 ...
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] InnoDB: Uses event mutexes
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] InnoDB: Number of pools: 1
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] InnoDB: Using Linux native AIO
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] InnoDB: Completed initialization of buffer pool
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] InnoDB: 128 rollback segments are active.
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] InnoDB: Creating shared tablespace for temporary tables
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] InnoDB: 10.5.10 started; log sequence number 1880314; transaction id 4875
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] Plugin 'FEEDBACK' is disabled.
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] Server socket created on IP: '::'.
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Warning] 'proxies_priv' entry '@% root@69f5869088c0' ignored in --skip-name-resolve mode.
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] Reading of all Master_info entries succeeded
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] Added new Master_info '' to hash table
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] mysqld: ready for connections.
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | Version: '10.5.10-MariaDB-1:10.5.10+maria~focal'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: database_1  | 2021-06-12  9:36:18 0 [Note] InnoDB: Buffer pool(s) load completed at 210612  9:36:18
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Considering dependency setenvif for ssl:
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Module setenvif already enabled
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Considering dependency mime for ssl:
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Module mime already enabled
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Considering dependency socache_shmcb for ssl:
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Module socache_shmcb already enabled
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Module ssl already enabled
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | /startup.sh: line 57: [: =: unary operator expected
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Migrating: 2019_04_06_060145_add_user_skin_setting
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Migrated:  2019_04_06_060145_add_user_skin_setting (0.01 seconds)
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Migrating: 2019_04_06_205355_add_setting_allow_user_skin
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Migrated:  2019_04_06_205355_add_setting_allow_user_skin (0 seconds)
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Migrating: 2020_08_11_200712_add_saml_key_rollover
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Migrated:  2020_08_11_200712_add_saml_key_rollover (0 seconds)
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Migrating: 2021_02_05_172502_add_provider_to_oauth_table
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Migrated:  2021_02_05_172502_add_provider_to_oauth_table (0.02 seconds)
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Migrating: 2021_03_18_184102_adds_several_ldap_fields
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Migrated:  2021_03_18_184102_adds_several_ldap_fields (0 seconds)
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Migrating: 2021_04_07_001811_add_ldap_dept
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Migrated:  2021_04_07_001811_add_ldap_dept (0 seconds)
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Migrating: 2021_04_14_180125_add_ids_to_tables
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Migrated:  2021_04_14_180125_add_ids_to_tables (0.02 seconds)
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Migrating: 2021_06_07_155421_add_serial_number_indexes
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Migrated:  2021_06_07_155421_add_serial_number_indexes (0.01 seconds)
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Migrating: 2021_06_07_155436_add_company_id_indexes
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Migrated:  2021_06_07_155436_add_company_id_indexes (0.04 seconds)
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Configuration cache cleared!
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Configuration cache cleared!
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | Configuration cached successfully!
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | 2021-06-12 09:36:19,738 CRIT Supervisor running as root (no user in config file)
Jun 12 11:36:19 SERVER_FQDN docker-compose[3318935]: snipeit_1   | 2021-06-12 09:36:19,739 INFO supervisord started with pid 1
Jun 12 11:36:20 SERVER_FQDN docker-compose[3318935]: snipeit_1   | 2021-06-12 09:36:20,742 INFO spawned: 'exit_on_any_fatal' with pid 38
Jun 12 11:36:20 SERVER_FQDN docker-compose[3318935]: snipeit_1   | 2021-06-12 09:36:20,743 INFO spawned: 'apache' with pid 39
Jun 12 11:36:20 SERVER_FQDN docker-compose[3318935]: snipeit_1   | 2021-06-12 09:36:20,744 INFO spawned: 'run_schedule' with pid 40
Jun 12 11:36:20 SERVER_FQDN docker-compose[3318935]: snipeit_1   | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.0.3. Set the 'ServerName' directive globally to suppress this message
Jun 12 11:36:20 SERVER_FQDN docker-compose[3318935]: snipeit_1   | No scheduled commands are ready to run.
Jun 12 11:36:21 SERVER_FQDN docker-compose[3318935]: snipeit_1   | 2021-06-12 09:36:21,895 INFO success: exit_on_any_fatal entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Jun 12 11:36:21 SERVER_FQDN docker-compose[3318935]: snipeit_1   | 2021-06-12 09:36:21,896 INFO success: apache entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Jun 12 11:36:21 SERVER_FQDN docker-compose[3318935]: snipeit_1   | 2021-06-12 09:36:21,896 INFO success: run_schedule entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

To Reproduce
Steps to reproduce the behavior:

  1. Start Snipe-IT via Docker and have "SESSION_DRIVER" not defined.

Expected behavior
It should be cought.

Screenshots

Server (please complete the following information):

  • Snipe-IT Version: 5.1.6
  • Official Docker image

Desktop (please complete the following information):

  • OS: -
  • Browser: -
  • Version: -

Smartphone (please complete the following information):

  • Device: -
  • OS: -
  • Browser: -
  • Version: -

Error Messages
/startup.sh: line 57: [: =: unary operator expected

Additional context

  • Is this a fresh install or an upgrade?
  • What OS and web server you're running Snipe-IT on
  • What method you used to install Snipe-IT: Docker
  • Include what you've done so far in the installation, and if you got any error messages along the way.
  • Indicate whether or not you've manually edited any data directly in the database

Add any other context about the problem here.

Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.

@snipe
Copy link
Owner

snipe commented Jun 12, 2021

Why would SESSION_DRIVER not be defined tho?

@derdeagle
Copy link
Author

It has a fallback / default defined in session.php so there is technically no need to define it.

derdeagle added a commit to derdeagle/snipe-it that referenced this issue Jun 12, 2021
If SESSION_DRIVER is not defined it leads to a syntax error.
snipe added a commit that referenced this issue Jun 23, 2021
Fixes #9705: Prevent syntax error in startup.sh
@snipe snipe closed this as completed in 8f4b88a Jun 23, 2021
PetriAsi pushed a commit to PetriAsi/snipe-it that referenced this issue Jul 15, 2021
If SESSION_DRIVER is not defined it leads to a syntax error.
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