unstract icon indicating copy to clipboard operation
unstract copied to clipboard

Unable to Login to unstarct, Backend Image isn't working as expected

Open shobhitag11 opened this issue 1 year ago • 2 comments

Hi Team,

I am trying to set up the unstract in my local:

System Configuration: Apple MacOS M1 chipset. OS Version: MacOS 15.0 beta Docker Desktop Version: 4.25.2 (129061) Docker Engine Version: 24.0.6 Docker Compose Version: v2.23.0-desktop.1 Python Version: 3.9

While running the ./run-platform.sh file I first got the error: In Docker image: unstract/backend:latest (size:2.06 GB)

I was facing the following issue:

1.) 2024-07-26 10:05:17 File "/app/.venv/lib/python3.9/site-packages/google/protobuf/descriptor.py", line 789, in new 2024-07-26 10:05:17 _message.Message._CheckCalledFromGeneratedFile() 2024-07-26 10:05:17 TypeError: Descriptors cannot be created directly. 2024-07-26 10:05:17 If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0. 2024-07-26 10:05:17 If you cannot immediately regenerate your protos, some other possible workarounds are: 2024-07-26 10:05:17 1. Downgrade the protobuf package to 3.20.x or lower. 2024-07-26 10:05:17 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower). 2024-07-26 10:05:17

So, I set the ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python, but now I am stuck at the following issue and need help here:

2024-07-26 09:58:46 [2024-07-26 04:28:46 +0000] [7] [DEBUG] Current configuration: 2024-07-26 09:58:46 config: ./gunicorn.conf.py 2024-07-26 09:58:46 wsgi_app: None 2024-07-26 09:58:46 bind: ['0.0.0.0:8000'] 2024-07-26 09:58:46 backlog: 2048 2024-07-26 09:58:46 workers: 2 2024-07-26 09:58:46 worker_class: sync 2024-07-26 09:58:46 threads: 2 2024-07-26 09:58:46 worker_connections: 1000 2024-07-26 09:58:46 max_requests: 0 2024-07-26 09:58:46 max_requests_jitter: 0 2024-07-26 09:58:46 timeout: 600 2024-07-26 09:58:46 graceful_timeout: 30 2024-07-26 09:58:46 keepalive: 2 2024-07-26 09:58:46 limit_request_line: 4094 2024-07-26 09:58:46 limit_request_fields: 100 2024-07-26 09:58:46 limit_request_field_size: 8190 2024-07-26 09:58:46 reload: True 2024-07-26 09:58:46 reload_engine: auto 2024-07-26 09:58:46 reload_extra_files: [] 2024-07-26 09:58:46 spew: False 2024-07-26 09:58:46 check_config: False 2024-07-26 09:58:46 print_config: False 2024-07-26 09:58:46 preload_app: False 2024-07-26 09:58:46 sendfile: None 2024-07-26 09:58:46 reuse_port: False 2024-07-26 09:58:46 chdir: /app 2024-07-26 09:58:46 daemon: False 2024-07-26 09:58:46 raw_env: [] 2024-07-26 09:58:46 pidfile: None 2024-07-26 09:58:46 worker_tmp_dir: None 2024-07-26 09:58:46 user: 0 2024-07-26 09:58:46 group: 0 2024-07-26 09:58:46 umask: 0 2024-07-26 09:58:46 initgroups: False 2024-07-26 09:58:46 tmp_upload_dir: None 2024-07-26 09:58:46 secure_scheme_headers: {'X-FORWARDED-PROTOCOL': 'ssl', 'X-FORWARDED-PROTO': 'https', 'X-FORWARDED-SSL': 'on'} 2024-07-26 09:58:46 forwarded_allow_ips: ['127.0.0.1'] 2024-07-26 09:58:46 accesslog: - 2024-07-26 09:58:46 disable_redirect_access_to_syslog: False 2024-07-26 09:58:46 access_log_format: %(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" 2024-07-26 09:58:46 errorlog: - 2024-07-26 09:58:46 loglevel: debug 2024-07-26 09:58:46 capture_output: False 2024-07-26 09:58:46 logger_class: gunicorn.glogging.Logger 2024-07-26 09:58:46 logconfig: None 2024-07-26 09:58:46 logconfig_dict: {} 2024-07-26 09:58:46 logconfig_json: None 2024-07-26 09:58:46 syslog_addr: udp://localhost:514 2024-07-26 09:58:46 syslog: False 2024-07-26 09:58:46 syslog_prefix: None 2024-07-26 09:58:46 syslog_facility: user 2024-07-26 09:58:46 enable_stdio_inheritance: False 2024-07-26 09:58:46 statsd_host: None 2024-07-26 09:58:46 dogstatsd_tags: 2024-07-26 09:58:46 statsd_prefix: 2024-07-26 09:58:46 proc_name: None 2024-07-26 09:58:46 default_proc_name: backend.wsgi:application 2024-07-26 09:58:46 pythonpath: None 2024-07-26 09:58:46 paste: None 2024-07-26 09:58:46 on_starting: <function OnStarting.on_starting at 0x7ffffe448c10> 2024-07-26 09:58:46 on_reload: <function OnReload.on_reload at 0x7ffffe448d30> 2024-07-26 09:58:46 when_ready: <function WhenReady.when_ready at 0x7ffffe448e50> 2024-07-26 09:58:46 pre_fork: <function Prefork.pre_fork at 0x7ffffe448f70> 2024-07-26 09:58:46 post_fork: <function Postfork.post_fork at 0x7ffffe4990d0> 2024-07-26 09:58:46 post_worker_init: <function PostWorkerInit.post_worker_init at 0x7ffffe4991f0> 2024-07-26 09:58:46 worker_int: <function WorkerInt.worker_int at 0x7ffffe499310> 2024-07-26 09:58:46 worker_abort: <function WorkerAbort.worker_abort at 0x7ffffe499430> 2024-07-26 09:58:46 pre_exec: <function PreExec.pre_exec at 0x7ffffe499550> 2024-07-26 09:58:46 pre_request: <function PreRequest.pre_request at 0x7ffffe499670> 2024-07-26 09:58:46 post_request: <function PostRequest.post_request at 0x7ffffe499700> 2024-07-26 09:58:46 child_exit: <function ChildExit.child_exit at 0x7ffffe499820> 2024-07-26 09:58:46 worker_exit: <function WorkerExit.worker_exit at 0x7ffffe499940> 2024-07-26 09:58:46 nworkers_changed: <function NumWorkersChanged.nworkers_changed at 0x7ffffe499a60> 2024-07-26 09:58:46 on_exit: <function OnExit.on_exit at 0x7ffffe499b80> 2024-07-26 09:58:46 ssl_context: <function NewSSLContext.ssl_context at 0x7ffffe499ca0> 2024-07-26 09:58:46 proxy_protocol: False 2024-07-26 09:58:46 proxy_allow_ips: ['127.0.0.1'] 2024-07-26 09:58:46 keyfile: None 2024-07-26 09:58:46 certfile: None 2024-07-26 09:58:46 ssl_version: 2 2024-07-26 09:58:46 cert_reqs: 0 2024-07-26 09:58:46 ca_certs: None 2024-07-26 09:58:46 suppress_ragged_eofs: True 2024-07-26 09:58:46 do_handshake_on_connect: False 2024-07-26 09:58:46 ciphers: None 2024-07-26 09:58:46 raw_paste_global_conf: [] 2024-07-26 09:58:46 strip_header_spaces: False 2024-07-26 09:58:46 permit_unconventional_http_method: False 2024-07-26 09:58:46 permit_unconventional_http_version: False 2024-07-26 09:58:46 casefold_http_method: False 2024-07-26 09:58:46 header_map: drop 2024-07-26 09:58:46 tolerate_dangerous_framing: False 2024-07-26 09:58:46 [2024-07-26 04:28:46 +0000] [7] [INFO] Starting gunicorn 22.0.0 2024-07-26 09:58:46 [2024-07-26 04:28:46 +0000] [7] [DEBUG] Arbiter booted 2024-07-26 09:58:46 [2024-07-26 04:28:46 +0000] [7] [INFO] Listening at: http://0.0.0.0:8000 (7) 2024-07-26 09:58:46 [2024-07-26 04:28:46 +0000] [7] [INFO] Using worker: gthread 2024-07-26 09:58:46 [2024-07-26 04:28:46 +0000] [8] [INFO] Booting worker with pid: 8 2024-07-26 09:58:46 [2024-07-26 04:28:46 +0000] [9] [INFO] Booting worker with pid: 9 2024-07-26 09:58:46 [2024-07-26 04:28:46 +0000] [7] [DEBUG] 2 workers 2024-07-26 09:58:52 [2024-07-26 04:28:52 +0000] [9] [ERROR] Exception in worker process 2024-07-26 09:58:52 Traceback (most recent call last): 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker 2024-07-26 09:58:52 worker.init_process() 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/gunicorn/workers/gthread.py", line 95, in init_process 2024-07-26 09:58:52 super().init_process() 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process 2024-07-26 09:58:52 self.load_wsgi() 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi 2024-07-26 09:58:52 self.wsgi = self.app.wsgi() 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi 2024-07-26 09:58:52 self.callable = self.load() 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load 2024-07-26 09:58:52 return self.load_wsgiapp() 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp 2024-07-26 09:58:52 return util.import_app(self.app_uri) 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/gunicorn/util.py", line 371, in import_app 2024-07-26 09:58:52 mod = importlib.import_module(module) 2024-07-26 09:58:52 File "/usr/local/lib/python3.9/importlib/init.py", line 127, in import_module 2024-07-26 09:58:52 return _bootstrap._gcd_import(name[level:], package, level) 2024-07-26 09:58:52 File "", line 1030, in _gcd_import 2024-07-26 09:58:52 File "", line 1007, in _find_and_load 2024-07-26 09:58:52 File "", line 972, in _find_and_load_unlocked 2024-07-26 09:58:52 File "", line 228, in _call_with_frames_removed 2024-07-26 09:58:52 File "", line 1030, in _gcd_import 2024-07-26 09:58:52 File "", line 1007, in _find_and_load 2024-07-26 09:58:52 File "", line 986, in _find_and_load_unlocked 2024-07-26 09:58:52 File "", line 680, in _load_unlocked 2024-07-26 09:58:52 File "", line 850, in exec_module 2024-07-26 09:58:52 File "", line 228, in _call_with_frames_removed 2024-07-26 09:58:52 File "/app/backend/init.py", line 1, in 2024-07-26 09:58:52 from .celery_service import app as celery_app 2024-07-26 09:58:52 File "/app/backend/celery_service.py", line 7, in 2024-07-26 09:58:52 from utils.constants import ExecutionLogConstants 2024-07-26 09:58:52 File "/app/utils/constants.py", line 45, in 2024-07-26 09:58:52 class ExecutionLogConstants: 2024-07-26 09:58:52 File "/app/utils/constants.py", line 61, in ExecutionLogConstants 2024-07-26 09:58:52 IS_ENABLED: bool = CommonUtils.str_to_bool(settings.ENABLE_LOG_HISTORY) 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/django/conf/init.py", line 102, in getattr 2024-07-26 09:58:52 self._setup(name) 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/django/conf/init.py", line 89, in _setup 2024-07-26 09:58:52 self._wrapped = Settings(settings_module) 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/django/conf/init.py", line 217, in init 2024-07-26 09:58:52 mod = importlib.import_module(self.SETTINGS_MODULE) 2024-07-26 09:58:52 File "/usr/local/lib/python3.9/importlib/init.py", line 127, in import_module 2024-07-26 09:58:52 return _bootstrap._gcd_import(name[level:], package, level) 2024-07-26 09:58:52 File "/app/backend/settings/dev.py", line 1, in 2024-07-26 09:58:52 from backend.settings.base import * # noqa: F401, F403 2024-07-26 09:58:52 File "/app/backend/settings/base.py", line 170, in 2024-07-26 09:58:52 INDEXING_FLAG_TTL = int(get_required_setting("INDEXING_FLAG_TTL")) 2024-07-26 09:58:52 TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' 2024-07-26 09:58:52 [2024-07-26 04:28:52 +0000] [8] [ERROR] Exception in worker process 2024-07-26 09:58:52 Traceback (most recent call last): 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker 2024-07-26 09:58:52 worker.init_process() 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/gunicorn/workers/gthread.py", line 95, in init_process 2024-07-26 09:58:52 super().init_process() 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process 2024-07-26 09:58:52 self.load_wsgi() 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi 2024-07-26 09:58:52 self.wsgi = self.app.wsgi() 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi 2024-07-26 09:58:52 self.callable = self.load() 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load 2024-07-26 09:58:52 return self.load_wsgiapp() 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp 2024-07-26 09:58:52 return util.import_app(self.app_uri) 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/gunicorn/util.py", line 371, in import_app 2024-07-26 09:58:52 mod = importlib.import_module(module) 2024-07-26 09:58:52 File "/usr/local/lib/python3.9/importlib/init.py", line 127, in import_module 2024-07-26 09:58:52 return _bootstrap._gcd_import(name[level:], package, level) 2024-07-26 09:58:52 File "", line 1030, in _gcd_import 2024-07-26 09:58:52 File "", line 1007, in _find_and_load 2024-07-26 09:58:52 File "", line 972, in _find_and_load_unlocked 2024-07-26 09:58:52 File "", line 228, in _call_with_frames_removed 2024-07-26 09:58:52 File "", line 1030, in _gcd_import 2024-07-26 09:58:52 File "", line 1007, in _find_and_load 2024-07-26 09:58:52 File "", line 986, in _find_and_load_unlocked 2024-07-26 09:58:52 File "", line 680, in _load_unlocked 2024-07-26 09:58:52 File "", line 850, in exec_module 2024-07-26 09:58:52 File "", line 228, in _call_with_frames_removed 2024-07-26 09:58:52 File "/app/backend/init.py", line 1, in 2024-07-26 09:58:52 from .celery_service import app as celery_app 2024-07-26 09:58:52 File "/app/backend/celery_service.py", line 7, in 2024-07-26 09:58:52 from utils.constants import ExecutionLogConstants 2024-07-26 09:58:52 File "/app/utils/constants.py", line 45, in 2024-07-26 09:58:52 class ExecutionLogConstants: 2024-07-26 09:58:52 File "/app/utils/constants.py", line 61, in ExecutionLogConstants 2024-07-26 09:58:52 IS_ENABLED: bool = CommonUtils.str_to_bool(settings.ENABLE_LOG_HISTORY) 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/django/conf/init.py", line 102, in getattr 2024-07-26 09:58:52 self._setup(name) 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/django/conf/init.py", line 89, in _setup 2024-07-26 09:58:52 self._wrapped = Settings(settings_module) 2024-07-26 09:58:52 File "/app/.venv/lib/python3.9/site-packages/django/conf/init.py", line 217, in init 2024-07-26 09:58:52 mod = importlib.import_module(self.SETTINGS_MODULE) 2024-07-26 09:58:52 File "/usr/local/lib/python3.9/importlib/init.py", line 127, in import_module 2024-07-26 09:58:52 return _bootstrap._gcd_import(name[level:], package, level) 2024-07-26 09:58:52 File "/app/backend/settings/dev.py", line 1, in 2024-07-26 09:58:52 from backend.settings.base import * # noqa: F401, F403 2024-07-26 09:58:52 File "/app/backend/settings/base.py", line 170, in 2024-07-26 09:58:52 INDEXING_FLAG_TTL = int(get_required_setting("INDEXING_FLAG_TTL")) 2024-07-26 09:58:52 TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' 2024-07-26 09:58:52 [2024-07-26 04:28:52 +0000] [9] [INFO] Worker exiting (pid: 9) 2024-07-26 09:58:52 [2024-07-26 04:28:52 +0000] [8] [INFO] Worker exiting (pid: 8) 2024-07-26 09:58:52 [2024-07-26 04:28:52 +0000] [7] [ERROR] Worker (pid:8) exited with code 3

Please Note: I am able to launch the landing page using: http://frontend.unstract.localhost/landing

Screenshot 2024-07-26 at 10 07 14 AM

But after clicking the Login Button, getting BAd Gateway error maessage.

Screenshot 2024-07-26 at 10 07 26 AM

Warm Regards, Shobhit

shobhitag11 avatar Jul 26 '24 04:07 shobhitag11

@shobhitag11 Thanks for raising this.

I just tried setting up the platform from the latest release and it ran successfully.

Assuming this is your first setup, could you please try the following:

  • docker compose -f docker/docker-compose.yaml down
  • docker rmi $(docker images | grep "unstract/backend" | awk '{print $3}')
  • ./run-platform.sh -u

This will remove all existing Unstract containers, remove Unstract backend image alone (in order to re-build the same and thus ensure sanity) and finally trigger an update of the platform version, which should setup everything correctly.

hari-kuriakose avatar Jul 26 '24 06:07 hari-kuriakose

@shobhitag11 Hi can you check now and confirm if the issue is resolved?

ritwik-g avatar Aug 02 '24 09:08 ritwik-g

Dear sir ! I'm encounter the same issue and the instruction didn't solve the problem, please reopen this issue !!!!

ThanhHung2112 avatar Aug 22 '24 09:08 ThanhHung2112

I experience the same...

oliverbj avatar Sep 21 '24 08:09 oliverbj

In my experience, the backend does take some time to be able to deal with requests.

Waiting some minutes (two or three) does the magic for me.

pvskp avatar Oct 01 '24 15:10 pvskp