From 61a5c9dcdb59f8f404454a1a6cd10c995b8b27c7 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sat, 7 Oct 2023 12:03:51 -0300 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=90=9B=20fix(utils.py):=20improve=20e?= =?UTF-8?q?rror=20handling=20in=20initialize=5Fdatabase()=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `initialize_database()` function now handles two specific exceptions: "overlaps with other requested revisions" and "Can't locate revision identified by". If either of these exceptions occur, they will not be raised and instead the `alembic_version` table will be deleted. This change improves the error handling and ensures that the database is properly initialized. --- src/backend/langflow/services/database/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backend/langflow/services/database/utils.py b/src/backend/langflow/services/database/utils.py index 968cfef59..b457b70e2 100644 --- a/src/backend/langflow/services/database/utils.py +++ b/src/backend/langflow/services/database/utils.py @@ -32,7 +32,11 @@ def initialize_database(): try: database_service.run_migrations() except CommandError as exc: - if "Can't locate revision identified by" not in str(exc): + # if "overlaps with other requested revisions" or "Can't locate revision identified by" + # are not in the exception, we can't handle it + if "overlaps with other requested revisions" not in str( + exc + ) and "Can't locate revision identified by" not in str(exc): raise exc # This means there's wrong revision in the DB # We need to delete the alembic_version table From c9410992757e63fa66d9a2b6c68fc3ebae532262 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 8 Oct 2023 17:50:14 -0300 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=90=9B=20fix(Makefile):=20fix=20typo?= =?UTF-8?q?=20in=20make=20target=20name=20'install=5Ffrontendc'=20to=20'in?= =?UTF-8?q?stall=5Ffrontend'=20to=20resolve=20error=20during=20frontend=20?= =?UTF-8?q?installation=20=E2=9C=A8=20feat(Makefile):=20add=20error=20hand?= =?UTF-8?q?ling=20to=20retry=20frontend=20installation=20if=20it=20fails?= =?UTF-8?q?=20to=20ensure=20successful=20installation=20=F0=9F=90=9B=20fix?= =?UTF-8?q?(Makefile):=20fix=20typo=20in=20make=20target=20name=20'install?= =?UTF-8?q?=5Ffrontendc'=20to=20'install=5Ffrontend'=20to=20resolve=20erro?= =?UTF-8?q?r=20during=20frontend=20installation=20=E2=9C=A8=20feat(Makefil?= =?UTF-8?q?e):=20add=20support=20for=20running=20backend=20with=20or=20wit?= =?UTF-8?q?hout=20autologin=20based=20on=20the=20value=20of=20the=20'autol?= =?UTF-8?q?ogin'=20variable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1fbd7403c..168ac06d2 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,11 @@ setup_devcontainer: poetry run langflow --path src/frontend/build frontend: - make install_frontend + @-make install_frontend + @if [ $$? -ne 0 ]; then \ + echo "An error occurred while installing frontend dependencies. Attempting to fix."; \ + make install_frontendc; \ + fi make run_frontend frontendc: @@ -65,7 +69,13 @@ install_backend: backend: make install_backend - poetry run uvicorn --factory src.backend.langflow.main:create_app --port 7860 --reload --log-level debug +ifeq ($(autologin),1) + @echo "Running backend with autologin"; + LANGFLOW_AUTO_LOGIN=True poetry run langflow run --backend-only --port 7860 --host 0.0.0.0 +else + @echo "Running backend without autologin"; + poetry run langflow run --backend-only --port 7860 --host 0.0.0.0 +endif build_and_run: echo 'Removing dist folder' From 1ce520026ae7736603d6bb940009a27c44c9f645 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 8 Oct 2023 17:57:40 -0300 Subject: [PATCH 3/5] Fix langflow gif --- img/langflow-demo.gif | Bin 2092028 -> 2092059 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/img/langflow-demo.gif b/img/langflow-demo.gif index 4cea586282ab5fe1d1676f94a8840f7d1ce31f45..19b63eeb19864e440394016763b21d20e2385f09 100644 GIT binary patch delta 324 zcmex!y?*wM`VD(Z8F@GFDcyd6k#~Es8RG{vAe|h`*b)V#pKoU@WdqVN`xraaf%KE7 zjLtt9dE3?RGi_JD&&r$|?PpzX2&6SXvU&o|Z7f#da8Ag%h0^Sl92?H4hw?O(*W1w4RkmUwO; z=Go2?&s*UOR8zBt_rq17cuo`F_M9gE>(_u{&XEEu>wxr|>jE8~K)Dh{K_C_aV&Uy2 ziX!ujfpS8jA}jv@>D_^%3;cmueXf91*b8$H1P#Vz=wXZ2Dg5(2QNLhuI>lX zS+{^l2*{_mN$?2k^|v+V3C}Qx1s4jp1s4ktNQV|*3x^h847V0v4R}qrkE{*w)rWwB z4!3}U57*YWSXmIMezyYH5Qs^Kiy;w*iy;z+iy;%Yiy;)AGq);L6si2T)KL|nPlt7( z6}NSv79>W8n&%dWn&%gXn&%j|n&%k-nzx*R8cQ9A=$;yf=$;$5=$;%1@rUt`9k=n1 M9v_>x5i1`G!FcO+)Bpeg From 419822211f0822080f2b0dcc5daef2e3ac21f3e4 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 8 Oct 2023 18:01:05 -0300 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=94=80=20chore(README.md):=20update?= =?UTF-8?q?=20GIF=20link=20to=20point=20to=20the=20correct=20branch=20(dev?= =?UTF-8?q?)=20to=20ensure=20the=20latest=20demo=20is=20displayed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a9effbce6..d3421ecc6 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@

- +

From 6f1306887a3bb35503ebfa2c914d6e1fc1257668 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 8 Oct 2023 18:44:08 -0300 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=94=A7=20chore(Makefile):=20simplify?= =?UTF-8?q?=20frontend=20target=20by=20combining=20install=5Ffrontend=20an?= =?UTF-8?q?d=20run=5Ffrontend=20commands=20=F0=9F=90=9B=20fix(Makefile):?= =?UTF-8?q?=20handle=20error=20in=20install=5Ffrontend=20command=20and=20a?= =?UTF-8?q?ttempt=20to=20fix=20it=20by=20running=20install=5Ffrontendc=20?= =?UTF-8?q?=F0=9F=94=A7=20chore(Makefile):=20simplify=20backend=20target?= =?UTF-8?q?=20by=20combining=20install=5Fbackend=20and=20run=5Fbackend=20c?= =?UTF-8?q?ommands=20=E2=9C=A8=20feat(Makefile):=20add=20support=20for=20l?= =?UTF-8?q?ogin=20flag=20to=20control=20autologin=20feature=20in=20backend?= =?UTF-8?q?=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 168ac06d2..79a2f6582 100644 --- a/Makefile +++ b/Makefile @@ -53,12 +53,8 @@ setup_devcontainer: poetry run langflow --path src/frontend/build frontend: - @-make install_frontend - @if [ $$? -ne 0 ]; then \ - echo "An error occurred while installing frontend dependencies. Attempting to fix."; \ - make install_frontendc; \ - fi - make run_frontend + @-make install_frontend || (echo "An error occurred while installing frontend dependencies. Attempting to fix." && make install_frontendc) + @make run_frontend frontendc: make install_frontendc @@ -69,12 +65,12 @@ install_backend: backend: make install_backend -ifeq ($(autologin),1) - @echo "Running backend with autologin"; - LANGFLOW_AUTO_LOGIN=True poetry run langflow run --backend-only --port 7860 --host 0.0.0.0 -else +ifeq ($(login),1) @echo "Running backend without autologin"; - poetry run langflow run --backend-only --port 7860 --host 0.0.0.0 + poetry run langflow run --backend-only --port 7860 --host 0.0.0.0 --no-open-browser +else + @echo "Running backend with autologin"; + LANGFLOW_AUTO_LOGIN=True poetry run langflow run --backend-only --port 7860 --host 0.0.0.0 --no-open-browser endif build_and_run: