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

400 Bad request after running: docker run -p 0.0.0.0:8080:80 -v /home/mememe/www/flat/data:/data proycon/flat #189

Open
fishfree opened this issue Dec 4, 2023 · 1 comment
Assignees

Comments

@fishfree
Copy link

fishfree commented Dec 4, 2023

I followed the official doc here, however, when I access http://myhost:8080, http://myhost:8080/flat, http://myhost:8080/flat/pub all are 400 Bad request errors. Below are logs in the terminal:

docker run -p 0.0.0.0:8080:80 -v /home/mememe/www/flat/data:/data proycon/flat
Applying migrations...
Starting foliadocserve...
2023/12/04 04:14:53 [notice] 21#21: using the "epoll" event method
2023/12/04 04:14:53 [notice] 21#21: nginx/1.24.0
2023/12/04 04:14:53 [notice] 21#21: OS: Linux 5.15.0-89-generic
2023/12/04 04:14:53 [notice] 21#21: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2023/12/04 04:14:53 [notice] 21#21: start worker processes
2023/12/04 04:14:53 [notice] 21#21: start worker process 22
2023/12/04 04:14:53 [notice] 21#21: start worker process 23
2023/12/04 04:14:53 [notice] 21#21: start worker process 24
2023/12/04 04:14:53 [notice] 21#21: start worker process 25
2023-12-04 04:14:54 - foliadocserve 0.7.7
2023-12-04 04:14:54 - Initialising document store in /data/flat.docroot
[04/Dec/2023:04:14:54] ENGINE Listening for SIGTERM.
[04/Dec/2023:04:14:54] ENGINE Listening for SIGHUP.
[04/Dec/2023:04:14:54] ENGINE Listening for SIGUSR1.
[04/Dec/2023:04:14:54] ENGINE Bus STARTING
CherryPy Checker:
The Application mounted at '' has an empty config.

2023-12-04 04:14:54 - Documents loaded: 0
[04/Dec/2023:04:14:54] ENGINE Started monitor thread 'Autoreloader'.
[04/Dec/2023:04:14:54] ENGINE Serving on http://0.0.0.0:8080
[04/Dec/2023:04:14:54] ENGINE Bus STARTED
System check identified some issues:

WARNINGS:
metadata.MetadataIndex: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
	HINT: Configure the DEFAULT_AUTO_FIELD setting or the AppConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
users.ReadPermissions: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
	HINT: Configure the DEFAULT_AUTO_FIELD setting or the AppConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
users.WritePermissions: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
	HINT: Configure the DEFAULT_AUTO_FIELD setting or the AppConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
Operations to perform:
  Synchronize unmigrated apps: editor, messages, metadata, staticfiles, structureeditor, viewer
  Apply all migrations: admin, auth, contenttypes, sessions, users
Synchronizing apps without migrations:
  Creating tables...
    Creating table metadata_metadataindex
    Running deferred SQL...
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying admin.0003_logentry_add_action_flag_choices... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK
  Applying auth.0009_alter_user_last_name_max_length... OK
  Applying auth.0010_alter_group_name_max_length... OK
  Applying auth.0011_update_proxy_permissions... OK
  Applying auth.0012_alter_user_first_name_max_length... OK
  Applying sessions.0001_initial... OK
  Applying users.0001_initial... OK
Creating FLAT superuser and (re)setting password...
Superuser created.
Starting FLAT via uwsgi...
*** Starting uWSGI 2.0.21 (64bit) on [Mon Dec  4 04:14:56 2023] ***
compiled with version: 12.2.1 20220924 on 28 April 2023 21:13:09
os: Linux-5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023
nodename: 01bd18c3c4f6
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 4
current working directory: /etc/service/uwsgi
detected binary path: /usr/sbin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
setgid() to 100
set additional group 82 (www-data)
set additional group 101 (nginx)
setuid() to 100
your memory page size is 4096 bytes
detected max file descriptor number: 1048576
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address 127.0.0.1:8888 fd 3
Python version: 3.11.6 (main, Oct  4 2023, 06:22:18) [GCC 12.2.1 20220924]
Python main interpreter initialized at 0x7f87d1bd9f78
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 250128 bytes (244 KB) for 4 cores
*** Operational MODE: preforking+threaded ***
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x7f87d1bd9f78 pid: 46 (default app)
spawned uWSGI master process (pid: 46)
spawned uWSGI worker 1 (pid: 47, cores: 2)
spawned uWSGI worker 2 (pid: 48, cores: 2)
2023-12-04 04:15:54 - Documents loaded: 0
2023-12-04 07:04:55 - Documents loaded: 0
2023-12-04 07:05:55 - Documents loaded: 0
[pid: 48|app: 0|req: 1/1] 10.2.8.19 () {42 vars in 913 bytes} [Mon Dec  4 08:06:22 2023] GET / => generated 143 bytes in 252 msecs (HTTP/1.1 400) 1 headers in 68 bytes (1 switches on core 0)
10.2.8.19 - - [04/Dec/2023:07:06:22 +0000] "GET / HTTP/1.1" 400 154 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36" "-"
[pid: 48|app: 0|req: 2/2] 10.2.8.19 () {42 vars in 868 bytes} [Mon Dec  4 08:06:22 2023] GET /favicon.ico => generated 143 bytes in 16 msecs (HTTP/1.1 400) 1 headers in 68 bytes (1 switches on core 1)
10.2.8.19 - - [04/Dec/2023:07:06:22 +0000] "GET /favicon.ico HTTP/1.1" 400 154 "http://10.2.14.77:8080/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36" "-"
2023-12-04 07:06:55 - Documents loaded: 0
2023/12/04 07:07:22 [info] 23#23: *1 client timed out (110: Operation timed out) while waiting for request, client: 10.2.8.19, server: 0.0.0.0:80
2023-12-04 07:07:55 - Documents loaded: 0

BTW: where can I find the superadmin's username and password when running docker?

@proycon
Copy link
Owner

proycon commented Feb 7, 2024

Sorry, I hadn't noticed this issue before. I'm not actually sure what caused this. Can you set --env FLAT_DEBUG=1 and try if the problem still occurs with the latest version? (just released, docker image is updated too)

BTW: where can I find the superadmin's username and password when running docker?

It's documented in the installation guide (it's flat:flat)

@proycon proycon self-assigned this Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants