forms-flow-ai icon indicating copy to clipboard operation
forms-flow-ai copied to clipboard

config.js Installed with MacOS QuickInstallation has Port Error

Open turbodata opened this issue 1 year ago • 3 comments

Bug Report

Please provide information about your setup

  • formsflow.ai Version: 5.1.0
  • Browser: Chrome
  • Browser version: 113.0.5672.92

Steps to Reproduce

  1. Follow instructions at https://aot-technologies.github.io/forms-flow-installation-doc/Pages/PC/macOS/onMac.html
  2. Choose either with Redash or without. Occurs in Both.
  3. Attempt to Open Forms Flow http://localhost:3000
  4. Challenge and response with login (if you did not visit any of the other pages yet). It occurs when you log in on another page first, then proceed to the Forms target or when you have not logged in to any page, and you are directed to login when you go to the Forms target.
  5. Opens target http://localhost:3000, but it freezes.
  6. If you attempt to go to http://localhost:3000/forms, the web page remains frozen.

Observed Behaviour

I opened the Web Page inspector and saw that, just before the three dots appeared on the page, the system had to open config.js. Looking at the console, I saw that there was a call to http://{my-ip-addres}:5001 and it was responding with an error (I believe 450). The page froze awaiting a response from the Web service.

When I inspected the Source config.js in the browser, I compared the text in that file to the one found in the "Containerized Deployment" - https://aot-technologies.github.io/forms-flow-installation-doc/assets//DockerFull/dockerfull_7.png - I noted to differences: 1) the REACT_APP_WEB_BASE_URL:"http://{my-ip-addres}:5000" in the Containerized Deployment said REACT_APP_WEB_BASE_URL:"http://{my-ip-addres}:5001" in the config.js installed with the initial zip file. 2) the last curly brace in the Containerized Deployment was followed by a semi-colon), but the config.js file delivered with the zip file did not have a semi-colon in the final position. (I do not know JS, so I am not sure if item 2 is significant).

Further, I went into the zip file Containerized Deployment and confirmed that the sample.env file had the same values as those shown in the Containerized Deployment found on the install site.

Expected Behaviour

I deleted all of the docker containers and images installed by the install.bash script. Then I edited config.js to resemble the file from the Containerized Deployment (https://aot-technologies.github.io/forms-flow-installation-doc/assets//DockerFull/dockerfull_7.png) - I corrected both Item 1 and Item 2 from above...

I then shifted to the instructions from Containerized Deployment and edited the sample.env as instructed, then ran Docker Compose as instructed. The system re-depoyed the images with the correct config.js file, and then the Forms page http://localhost:3000 opened properly.

I am new to Docker as well as Java Script, so forgive the poor comments. However, the instructions were excellent and easy to use even without the experience.

turbodata avatar May 14 '23 02:05 turbodata

There is another indicator of this same error. When you deploy using the Quick Installation for Mac (https://aot-technologies.github.io/forms-flow-installation-doc/Pages/PC/macOS/onMac.html), the install.bash script never closes out completely and repeats "Finishing setup".

I reviewed the bash script, and this is where I saw that the 5000/5001 error described in this bug came up. The function "isUp" will repeat "Finishing setup" until it gets a "200" response from the web service. The default $webapi_port is 5000 set on line 3 of the script, and only changes to 5001 if the user is "Darwin". Since the curl is going to port 5000, and the config.js in this zip file is set to 5001, so we will never get a "200" back.

turbodata avatar May 14 '23 02:05 turbodata

This is even worse because port 5000 as par several trials or or this whether on MacOS Ventura or Monterey is used by Control Center. xeus@mbp ~ % lsof -i :5000 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME ControlCe 487 xeus 7u IPv4 0x7d79147da3613257 0t0 TCP *:commplex-main (LISTEN) ControlCe 487 xeus 8u IPv6 0x7d79147da222404f 0t0 TCP *:commplex-main (LISTEN) So, would a change to another TCP port be welcome in a PR to cater for this a cross mac users? Gonna try push one

katxeus avatar May 15 '23 15:05 katxeus

Thank you for raising this issue. Our script tries to identify the OS and change the port to 5001 for webapi. Could you provide the output for below command from your local ? uname -a

sumesh-aot avatar Jun 12 '23 06:06 sumesh-aot