Jul-06-2020, 10:12 AM
I made an application with Python's flask module. I used the pexpect module in some functions but I get the SIGWINCH ignored error. The function does not work, it enters pexpect.EOF error directly. If anyone knows the solution, I would be glad if it helps.In the bottom line of the gunicorn error file, the / botbaslatma function, in other words, the function I use the pexpect module. SIGWINCH ignored. error and goes directly into pexpect.EOF.
def botbaslatma(): child = pexpect.spawn('screen -S idle python3 bot_dosyalari/{}'.format(session["username"]+".py")) i=child.expect(['Enter 2FA code: ',"Invalid password for '{}'. Enter password: ".format(session["username"]),pexpect.EOF]) if i==0: child.sendline(Guard) k=child.expect(['Logged on as:','Incorrect code. Enter 2FA code: ',pexpect.EOF]) if k==0: cursor=Mysql.connection.cursor() sorgu='UPDATE sxxxxeri SET status="Aktif" WHERE stxxxxci="{}" '.format(session["username"]) cursor.execute(sorgu) Mysql.connection.commit() cursor.close() child.close() flash("Done","success") return redirect(url_for("xontrolxxxx",_external=True)) elif k==1: cursor=Mysql.connection.cursor() sorgu='UPDATE sxxxleri SET status="Bexxxyor" WHERE steaxxxici="{}" '.format(session["username"]) cursor.execute(sorgu) Mysql.connection.commit() cursor.close() child.close() flash("Wrong passwd","danger") return redirect(url_for("xontrolxxxx",_external=True)) elif i==2:#timeout flash("Timeout","danger") child.close() durdurma() return redirect(url_for("xontrolxxxx",_external=True)) elif i==1: child.close() durdurma() flash("Wrong passwd","danger") return redirect(url_for("xontrolxxxx",_external=True)) elif i==2: child.close() flash("Timeout","danger") return redirect(url_for("xontrolxxxx",_external=True)) return render_template("botxxxx.html",form=form) #Always enters pexpect.EOF control i==2######Gunicorn3 file
[Unit] Description=Gunicorn service After=network.target [Service] User=root Group=www-data WorkingDirectory=/root/flaskapp ExecStart=/usr/bin/gunicorn3 --workers 3 --bind unix:flaskapp.sock -m 007 app:app --timeout 300 --config /root/flaskapp/gunicorn.conf.py#Gunicorn3 Error log *************
[2020-07-03 15:38:55 +0200] [14261] [DEBUG] Current configuration: config: /root/flaskapp/gunicorn.conf.py bind: ['unix:flaskapp.sock'] backlog: 2048 workers: 3 worker_class: sync threads: 1 worker_connections: 1000 max_requests: 0 max_requests_jitter: 0 timeout: 300 graceful_timeout: 30 keepalive: 2 limit_request_line: 4094 limit_request_fields: 100 limit_request_field_size: 8190 reload: False reload_engine: auto spew: False check_config: False preload_app: False sendfile: None chdir: /root/flaskapp daemon: False raw_env: [] pidfile: None worker_tmp_dir: None user: 0 group: 33 umask: 7 initgroups: False tmp_upload_dir: None secure_scheme_headers: {'X-FORWARDED-PROTOCOL': 'ssl', 'X-FORWARDED-PROTO': 'https', 'X-FORWARDED-SSL': 'on'} forwarded_allow_ips: ['127.0.0.1'] accesslog: /root/flaskapp/flaskapp.gunicorn.access access_log_format: %(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" errorlog: /root/flaskapp/flaskapp.gunicorn.error loglevel: debug capture_output: False logger_class: gunicorn.glogging.Logger logconfig: None syslog_addr: udp://localhost:xxx syslog: False syslog_prefix: None syslog_facility: user enable_stdio_inheritance: False statsd_host: None statsd_prefix: proc_name: None default_proc_name: app:app pythonpath: None paste: None on_starting: <function OnStarting.on_starting at 0x7f66cff9c048> on_reload: <function OnReload.on_reload at 0x7f66cff9c1e0> when_ready: <function WhenReady.when_ready at 0x7f66cff9c378> pre_fork: <function Prefork.pre_fork at 0x7f66cff9c510> post_fork: <function Postfork.post_fork at 0x7f66cff9c6a8> post_worker_init: <function PostWorkerInit.post_worker_init at 0x7f66cff9c840> worker_int: <function WorkerInt.worker_int at 0x7f66cff9c9d8> worker_abort: <function WorkerAbort.worker_abort at 0x7f66cff9cb70> pre_exec: <function PreExec.pre_exec at 0x7f66cff9cd08> pre_request: <function PreRequest.pre_request at 0x7f66cff9cea0> post_request: <function PostRequest.post_request at 0x7f66cff9f048> child_exit: <function ChildExit.child_exit at 0x7f66cff9f1e0> worker_exit: <function WorkerExit.worker_exit at 0x7f66cff9f378> nworkers_changed: <function NumWorkersChanged.nworkers_changed at 0x7f66cff9f510> on_exit: <function OnExit.on_exit at 0x7f66cff9f6a8> proxy_protocol: False proxy_allow_ips: ['127.0.0.1'] keyfile: None certfile: None ssl_version: 2 cert_reqs: 0 ca_certs: None suppress_ragged_eofs: True do_handshake_on_connect: False ciphers: TLSv1 raw_paste_global_conf: [] [2020-07-03 15:38:55 +0200] [14261] [INFO] Starting gunicorn 19.7.1 [2020-07-03 15:38:55 +0200] [14261] [DEBUG] Arbiter booted [2020-07-03 15:38:55 +0200] [14261] [INFO] Listening at: unix:flaskapp.sock (14261) [2020-07-03 15:38:55 +0200] [14261] [INFO] Using worker: sync [2020-07-03 15:38:55 +0200] [14282] [INFO] Booting worker with pid: 14282 [2020-07-03 15:38:55 +0200] [14285] [INFO] Booting worker with pid: 14285 [2020-07-03 15:38:55 +0200] [14286] [INFO] Booting worker with pid: 14286 [2020-07-03 15:38:55 +0200] [14261] [DEBUG] 3 workers [2020-07-03 15:39:03 +0200] [14285] [DEBUG] GET /kontrolpaneli [2020-07-03 15:39:03 +0200] [14285] [DEBUG] GET /login [2020-07-03 15:39:13 +0200] [14282] [DEBUG] POST /login [2020-07-03 15:39:13 +0200] [14285] [DEBUG] GET / [2020-07-03 15:39:17 +0200] [14286] [DEBUG] GET /kontrolpaneli [2020-07-03 15:39:19 +0200] [14285] [DEBUG] GET /botbaslatma [2020-07-03 15:39:43 +0200] [14285] [DEBUG] POST /botbaslatma [2020-07-03 15:39:43 +0200] [14412] [DEBUG] worker: SIGWINCH ignored. **here it is** [2020-07-03 15:39:43 +0200] [14285] [DEBUG] GET /kontrolpaneli