rr- / szurubooru

Image board engine, Danbooru-style.
GNU General Public License v3.0
704 stars 178 forks source link

Could not fetch basic configuration from server #391

Closed sanityy55 closed 3 years ago

sanityy55 commented 3 years ago

I just downloaded szuru and after configuring it I startedit at localhost:1111 it loads for a moment and then pops up a massage : <Could not fetch basic configuration from server > any idea to fix it?

neobooru commented 3 years ago

Are you using the docker image/setup, the install.sh script, or a manual installation?

sanityy55 commented 3 years ago

Are you using the docker image/setup, the install.sh script, or a manual installation?

I just followed the INSTALL.md

neobooru commented 3 years ago

Did you make any changes to the .env file? I'll try to reproduce the issue on my end, that should make it easier to identify the issue.

sanityy55 commented 3 years ago

Did you make any changes to the .env file? I'll try to reproduce the issue on my end, that should make it easier to identify the issue.

yes I changed the data and sql directories

neobooru commented 3 years ago

I assume you also changed the PORT parameter, because you show yours running on :1111? Either way, I can't immediately reproduce the issue. Could you post the output of docker-compose logs?

Also, is this on Windows, Linux or macOS?

sanityy55 commented 3 years ago

I assume you also changed the PORT parameter, because you show yours running on :1111? Either way, I can't immediately reproduce the issue. Could you post the output of docker-compose logs?

Also, is this on Windows, Linux or macOS?

I was able to truble shoot the config problem but now I get permission errors I'll work on them I'm on Arch Linux

sanityy55 commented 3 years ago

Attaching to szuru_client_1, szuru_server_1, szuru_sql_1 server_1 | INFO [alembic.runtime.migration] Context impl PostgresqlImpl. server_1 | INFO [alembic.runtime.migration] Will assume transactional DDL. server_1 | Starting szurubooru API on port 6666 server_1 | [2021-04-12 12:48:12] szurubooru.middleware.request_logger GET /info (user=None, queries=2) server_1 | [2021-04-12 12:48:12] szurubooru.middleware.request_logger GET /info (user=None, queries=2) server_1 | [2021-04-12 12:48:12] szurubooru.middleware.request_logger GET /pool-categories (user=None, queries=1) server_1 | [2021-04-12 12:48:12] szurubooru.middleware.request_logger GET /tag-categories (user=None, queries=1) server_1 | [2021-04-12 12:48:14] szurubooru.middleware.request_logger GET /posts/ (user=None, queries=2) server_1 | [2021-04-12 12:48:29] szurubooru.middleware.request_logger POST /users (user=None, queries=7) server_1 | [2021-04-12 12:48:30] szurubooru.middleware.request_logger GET /user/sandman (user=sandman, queries=6) server_1 | [2021-04-12 12:48:30] szurubooru.middleware.request_logger GET /info (user=sandman, queries=2) server_1 | [2021-04-12 12:48:30] szurubooru.middleware.request_logger POST /user-token/sandman (user=sandman, queries=4) server_1 | [2021-04-12 13:02:47] szurubooru.middleware.request_logger POST /uploads (user=sandman, queries=1) server_1 | [2021-04-12 13:02:47] waitress Exception while serving /uploads server_1 | Traceback (most recent call last): server_1 | File "/usr/lib/python3.8/site-packages/waitress/channel.py", line 349, in service server_1 | task.service() server_1 | File "/usr/lib/python3.8/site-packages/waitress/task.py", line 169, in service server_1 | self.execute() server_1 | File "/usr/lib/python3.8/site-packages/waitress/task.py", line 439, in execute server_1 | app_iter = self.channel.server.application(environ, start_response) server_1 | File "/opt/app/szurubooru/rest/app.py", line 104, in application server_1 | response = handler(ctx, match.groupdict()) server_1 | File "/opt/app/szurubooru/api/upload_api.py", line 19, in create_temporary_file server_1 | token = file_uploads.save(content) server_1 | File "/opt/app/szurubooru/func/file_uploads.py", line 29, in save server_1 | files.save(path, content) server_1 | File "/opt/app/szurubooru/func/files.py", line 41, in save server_1 | os.makedirs(os.path.dirname(full_path), exist_ok=True) server_1 | File "/usr/lib/python3.8/os.py", line 223, in makedirs client_1 | 172.28.0.1 -> GET / HTTP/1.1 [200] - referer: - - client_1 | 172.28.0.1 -> GET /api/info HTTP/1.1 [200] - referer: http://localhost:8080/ - client_1 | 172.28.0.1 -> GET /img/favicon.png HTTP/1.1 [200] - referer: http://localhost:8080/ - client_1 | 172.28.0.1 -> GET /api/info HTTP/1.1 [200] - referer: http://localhost:8080/ - client_1 | 172.28.0.1 -> GET /manifest.json HTTP/1.1 [200] - referer: http://localhost:8080/ - client_1 | 172.28.0.1 -> GET /api/pool-categories HTTP/1.1 [200] - referer: http://localhost:8080/ - client_1 | 172.28.0.1 -> GET /api/tag-categories HTTP/1.1 [200] - referer: http://localhost:8080/ - client_1 | 172.28.0.1 -> GET /api/posts/?query=-rating%3Aunsafe&limit=42&fields=id%2CthumbnailUrl%2Ctype%2Csafety%2Cscore%2CfavoriteCount%2CcommentCount%2Ctags%2Cversion HTTP/1.1 [200] - referer: http://localhost:8080/posts - client_1 | 172.28.0.1 -> POST /api/users HTTP/1.1 [200] - referer: http://localhost:8080/register - client_1 | 172.28.0.1 -> GET /api/user/sandman?bump-login=true HTTP/1.1 [200] - referer: http://localhost:8080/register - client_1 | 172.28.0.1 -> GET /api/info HTTP/1.1 [200] - referer: http://localhost:8080/ - client_1 | 172.28.0.1 -> POST /api/user-token/sandman HTTP/1.1 [200] - referer: http://localhost:8080/register - client_1 | 2021/04/12 13:02:45 [warn] 11#11: 15 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000001, client: 172.28.0.1, server: , request: "POST /api/uploads HTTP/1.1", host: "localhost:8080", referrer: "http://localhost:8080/upload" client_1 | 172.28.0.1 -> POST /api/uploads HTTP/1.1 [500] - referer: http://localhost:8080/upload - client_1 | 2021/04/12 13:03:04 [warn] 11#11: 15 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000002, client: 172.28.0.1, server: , request: "POST /api/uploads HTTP/1.1", host: "localhost:8080", referrer: "http://localhost:8080/upload" client_1 | 172.28.0.1 -> POST /api/uploads HTTP/1.1 [500] - referer: http://localhost:8080/upload - client_1 | 2021/04/12 13:03:14 [warn] 11#11: 15 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000003, client: 172.28.0.1, server: , request: "POST /api/uploads HTTP/1.1", host: "localhost:8080", referrer: "http://localhost:8080/upload" client_1 | 172.28.0.1 -> POST /api/uploads HTTP/1.1 [500] - referer: http://localhost:8080/upload - client_1 | 2021/04/12 13:03:19 [warn] 11#11: 15 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000004, client: 172.28.0.1, server: , request: "POST /api/uploads HTTP/1.1", host: "localhost:8080", referrer: "http://localhost:8080/upload" client_1 | 172.28.0.1 -> POST /api/uploads HTTP/1.1 [500] - referer: http://localhost:8080/upload - server_1 | mkdir(name, mode) server_1 | PermissionError: [Errno 13] Permission denied: '/data/temporary-uploads' server_1 | [2021-04-12 13:03:04] szurubooru.middleware.request_logger POST /uploads (user=sandman, queries=1) server_1 | [2021-04-12 13:03:04] waitress Exception while serving /uploads server_1 | Traceback (most recent call last): server_1 | File "/usr/lib/python3.8/site-packages/waitress/channel.py", line 349, in service server_1 | task.service() server_1 | File "/usr/lib/python3.8/site-packages/waitress/task.py", line 169, in service server_1 | self.execute() server_1 | File "/usr/lib/python3.8/site-packages/waitress/task.py", line 439, in execute server_1 | app_iter = self.channel.server.application(environ, start_response) server_1 | File "/opt/app/szurubooru/rest/app.py", line 104, in application server_1 | response = handler(ctx, match.groupdict()) server_1 | File "/opt/app/szurubooru/api/upload_api.py", line 19, in create_temporary_file server_1 | token = file_uploads.save(content) server_1 | File "/opt/app/szurubooru/func/file_uploads.py", line 29, in save server_1 | files.save(path, content) server_1 | File "/opt/app/szurubooru/func/files.py", line 41, in save server_1 | os.makedirs(os.path.dirname(full_path), exist_ok=True) server_1 | File "/usr/lib/python3.8/os.py", line 223, in makedirs server_1 | mkdir(name, mode) server_1 | PermissionError: [Errno 13] Permission denied: '/data/temporary-uploads' server_1 | [2021-04-12 13:03:14] szurubooru.middleware.request_logger POST /uploads (user=sandman, queries=1) server_1 | [2021-04-12 13:03:14] waitress Exception while serving /uploads server_1 | Traceback (most recent call last): server_1 | File "/usr/lib/python3.8/site-packages/waitress/channel.py", line 349, in service server_1 | task.service() server_1 | File "/usr/lib/python3.8/site-packages/waitress/task.py", line 169, in service server_1 | self.execute() server_1 | File "/usr/lib/python3.8/site-packages/waitress/task.py", line 439, in execute server_1 | app_iter = self.channel.server.application(environ, start_response) server_1 | File "/opt/app/szurubooru/rest/app.py", line 104, in application server_1 | response = handler(ctx, match.groupdict()) server_1 | File "/opt/app/szurubooru/api/upload_api.py", line 19, in create_temporary_file server_1 | token = file_uploads.save(content) server_1 | File "/opt/app/szurubooru/func/file_uploads.py", line 29, in save server_1 | files.save(path, content) server_1 | File "/opt/app/szurubooru/func/files.py", line 41, in save server_1 | os.makedirs(os.path.dirname(full_path), exist_ok=True) server_1 | File "/usr/lib/python3.8/os.py", line 223, in makedirs server_1 | mkdir(name, mode) server_1 | PermissionError: [Errno 13] Permission denied: '/data/temporary-uploads' server_1 | [2021-04-12 13:03:19] szurubooru.middleware.request_logger POST /uploads (user=sandman, queries=1) server_1 | [2021-04-12 13:03:19] waitress Exception while serving /uploads server_1 | Traceback (most recent call last): server_1 | File "/usr/lib/python3.8/site-packages/waitress/channel.py", line 349, in service server_1 | task.service() server_1 | File "/usr/lib/python3.8/site-packages/waitress/task.py", line 169, in service server_1 | self.execute() server_1 | File "/usr/lib/python3.8/site-packages/waitress/task.py", line 439, in execute server_1 | app_iter = self.channel.server.application(environ, start_response) server_1 | File "/opt/app/szurubooru/rest/app.py", line 104, in application server_1 | response = handler(ctx, match.groupdict()) server_1 | File "/opt/app/szurubooru/api/upload_api.py", line 19, in create_temporary_file server_1 | token = file_uploads.save(content) server_1 | File "/opt/app/szurubooru/func/file_uploads.py", line 29, in save server_1 | files.save(path, content) server_1 | File "/opt/app/szurubooru/func/files.py", line 41, in save server_1 | os.makedirs(os.path.dirname(full_path), exist_ok=True) server_1 | File "/usr/lib/python3.8/os.py", line 223, in makedirs server_1 | mkdir(name, mode) server_1 | PermissionError: [Errno 13] Permission denied: '/data/temporary-uploads' sql_1 | sql_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization sql_1 | sql_1 | 2021-04-12 12:48:04.085 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 sql_1 | 2021-04-12 12:48:04.086 UTC [1] LOG: listening on IPv6 address "::", port 5432 sql_1 | 2021-04-12 12:48:04.885 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" sql_1 | 2021-04-12 12:48:05.558 UTC [21] LOG: database system was shut down at 2021-04-12 12:44:33 UTC sql_1 | 2021-04-12 12:48:05.880 UTC [1] LOG: database system is ready to accept connections

sanityy55 commented 3 years ago

so in short nowI get internal server error when trying to upload

sanityy55 commented 3 years ago

I fixed it thank you @neobooru for your time and sorry if I annoyed you

mknepper commented 2 years ago

I fixed it thank you @neobooru for your time and sorry if I annoyed you

How did you fix it? The only way I could fix it was by chmod'ing the data directory with 777, but I know that's bad practice. I'm not sure how to add read/write permissions.

sgsunder commented 2 years ago

The data directory needs to be owned by user uid 1000 and group gid 1000. Then you can chmod the directory to 775 and prevent other users from accessing it.

(If you want to use a different user and group id, you would need to rebuild the server docker container and set the build args PUID and PGID)