flow/flow-bin

Flow Server Not responding

pss2125 opened this issue ยท 29 comments

My flowconfig is blank.

package.json:

{
"name": "flowtest",
"version": "0.1.0",
"private": true,
"dependencies": {
"babel-cli": "^6.26.0",
"babel-eslint": "^8.2.6",
"babel-preset-flow": "^6.23.0",
"flow-bin": "^0.76.0",
"prettier-eslint": "^8.8.2",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-scripts": "1.1.4"
},
"scripts": {
"build": "babel src/ -d lib/",
"prepublish": "npm run build",
"start": "react-scripts start",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"flow": "flow",
"flow stop": "flow stop",
"flow status": "flow status",
"flow check": "flow check",
"flow type-at-pos": "flow type-at-pos"
},
"devDependencies": {
"eslint": "^4.19.1",
"eslint-config-airbnb": "^17.0.0",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.9.1"
}
}

.babelrc:

{
"presets": ["flow", "react"],
"retainLines": true

}

.eslintrc:

{
"parser": "babel-eslint",
"extends": "airbnb",
"plugins": [
"react",
"jsx-ally",
"import"
]

}

Log file:

[2018-07-21 21:24:22.275] argv=C:\Users\pss21\Documents\Programming\ReactProjects\flowtest\node_modules\flow-bin\flow-win64-v0.76.0\flow.exe start --temp-dir C:\Users\pss21\AppData\Local\Temp\flow C:\Users\pss21\Documents\Programming\ReactProjects\flowtest
Out of shared memory:
Raised by primitive operation at file "hack/heap/sharedMem.ml", line 80, characters 2-47
Called from file "hack/heap/sharedMem.ml", line 144, characters 5-26
Called from file "src/server/server.ml", line 228, characters 15-50
Called from file "src/server/server.ml", line 241, characters 4-70
Called from file "src/server/server.ml", line 267, characters 6-54

Monitor Logs:

Jul 21 21:24:22.219 [info] argv=C:\Users\pss21\Documents\Programming\ReactProjects\flowtest\node_modules\flow-bin\flow-win64-v0.76.0\flow.exe start --temp-dir C:\Users\pss21\AppData\Local\Temp\flow C:\Users\pss21\Documents\Programming\ReactProjects\flowtest
Jul 21 21:24:22.219 [info] Creating a new Flow server
Jul 21 21:24:22.304 [error] Closing connection 'server #1' due to uncaught exception in read loop: Unix.Unix_error(Unix.EPIPE, "write", "")
Jul 21 21:24:22.304 [error] backtrace:
Jul 21 21:24:22.304 [error] Raised by primitive operation at file "src/unix/lwt_unix.cppo.ml", line 648, characters 38-65
Jul 21 21:24:22.304 [error] Called from file "src/unix/lwt_unix.cppo.ml", line 563, characters 17-28
Jul 21 21:24:22.304 [error] Re-raised at file "src/monitor/connections/flowServerMonitorConnection.ml", line 152, characters 6-230
Jul 21 21:24:22.304 [error]
Uncaught async exception: Failure("Dfind was not initialized")
Raised at file "src/common/lwt/lwtLoop.ml", line 51, characters 9-68

Debug.Log:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\pss21\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'flow' ]
2 info using npm@6.2.0
3 info using node@v8.9.3
4 verbose run-script [ 'preflow', 'flow', 'postflow' ]
5 info lifecycle flowtest@0.1.0preflow: flowtest@0.1.0
6 info lifecycle flowtest@0.1.0
flow: flowtest@0.1.0
7 verbose lifecycle flowtest@0.1.0flow: unsafe-perm in lifecycle true
8 verbose lifecycle flowtest@0.1.0
flow: PATH: C:\Users\pss21\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\pss21\Documents\Programming\ReactProjects\flowtest\node_modules.bin;C:\Program Files (x86)\RSA SecurID Token Common;C:\Program Files\RSA SecurID Token Common;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Git\cmd;C:\WINDOWS\System32\OpenSSH;C:\Program Files\nodejs;C:\Users\pss21\AppData\Roaming\npm;;C:\Program Files\Microsoft VS Code\bin;C:\Python27;C:\Users\pss21\AppData\Local\Microsoft\WindowsApps;C:\Program Files\MongoDB\Server\3.6\bin;C:\Users\pss21\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin;C:\Users\pss21\AppData\Roaming\Dashlane\5.8.0.17084\bin\Firefox_Extension{442718d9-475e-452a-b3e1-fb1ee16b8e9f}\components;C:\Users\pss21\AppData\Roaming\Dashlane\5.8.0.17084\ucrt;C:\Program Files\Microsoft VS Code\bin;C:\Users\pss21\AppData\Roaming\npm;
9 verbose lifecycle flowtest@0.1.0flow: CWD: C:\Users\pss21\Documents\Programming\ReactProjects\flowtest
10 silly lifecycle flowtest@0.1.0
flow: Args: [ '/d /s /c', 'flow' ]
11 silly lifecycle flowtest@0.1.0flow: Returned: code: 7 signal: null
12 info lifecycle flowtest@0.1.0
flow: Failed to exec flow script
13 verbose stack Error: flowtest@0.1.0 flow: flow
13 verbose stack Exit status 7
13 verbose stack at EventEmitter. (C:\Users\pss21\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:304:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess. (C:\Users\pss21\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid flowtest@0.1.0
15 verbose cwd C:\Users\pss21\Documents\Programming\ReactProjects\flowtest
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\pss21\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "flow"
18 verbose node v8.9.3
19 verbose npm v6.2.0
20 error code ELIFECYCLE
21 error errno 7
22 error flowtest@0.1.0 flow: flow
22 error Exit status 7
23 error Failed at the flowtest@0.1.0 flow script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 7, true ]

This has been happening at my side for the past 2 months... anyone has more info or possible workaround?

Not working for me also

+1 even with version 0.83.0 on windows 10

Same issue with version 0.86.0 on Windows 10

Win 10
Flow, a static type checker for JavaScript, version 0.87.0

Get "The flow server is not responding (0 retries remaining)" after 3-10 minutes flow-server run on react-native project in 100%.
Windows 10.
Tried with 0.79.1, 0.81, 0.91

flow server --debug --sharedmemory-log-level=1
Log tail
...
[2019-01-31 01:26:51.423] Re-resolving directly dependent files
[2019-01-31 01:26:51.473] Recalculating dependency graph
[2019-01-31 01:26:51.560] remerge 2 dependent files:
[2019-01-31 01:26:51.560] 1/2: P:\trunk\cerebro.sln\react.native\src\client\index.native.js
[2019-01-31 01:26:51.560] 2/2: P:\trunk\cerebro.sln\react.native\src\client\native\appNative.js
[2019-01-31 01:26:51.560] Merge prep
[2019-01-31 01:26:51.560] to_merge: Focused: 1, Dependents: 2, Dependencies: 0
[2019-01-31 01:26:51.560] Calculating dependencies
[2019-01-31 01:26:51.560] Merging
[2019-01-31 01:26:52.166] Merge skipped 1 of 3 modules
[2019-01-31 01:26:52.166] Done
[2019-01-31 01:26:52.166] Checked set: Focused: 334, Dependents: 0, Dependencies: 8
[2019-01-31 01:26:52.169] Committing context heaps
[2019-01-31 01:26:52.169] Committing ResolvedRequiresHeap
[2019-01-31 01:26:52.169] Committing ResolvedRequiresHeap
[2019-01-31 01:26:52.169] Committing NameHeap
[2019-01-31 01:26:52.169] Committing InfoHeap
[2019-01-31 01:26:52.169] Committing all_providers hashtable
[2019-01-31 01:26:52.169] Committing parsing heaps
[2019-01-31 01:26:52.171] sending (22 errors) and (warnings from 150 files) to 1 subscribed clients (of 1 total)
[2019-01-31 01:26:52.550] recheck 1 modified, 0 deleted files
[2019-01-31 01:26:52.550] modified files:
[2019-01-31 01:26:52.550] 1/1: P:\trunk\cerebro.sln\react.native\src\client\native\appNavigator.js
[2019-01-31 01:26:52.550] Parsing
[2019-01-31 01:26:52.587] recheck: old = 2737, del = 0, fresh = 0, unmod = 2737
*** old modules (changed and deleted files) 0 ***
*** new modules (new and changed files) 0 ***
*** done committing modules ***
[2019-01-31 01:26:53.034] Re-resolving directly dependent files
[2019-01-31 01:26:53.034] Recalculating dependency graph
[2019-01-31 01:26:53.046] Merge prep
[2019-01-31 01:26:53.046] to_merge: Focused: 0, Dependents: 0, Dependencies: 0
[2019-01-31 01:26:53.046] Calculating dependencies
[2019-01-31 01:26:53.046] Merging
[2019-01-31 01:26:53.046] Merge skipped 0 of 0 modules
[2019-01-31 01:26:53.046] Done
[2019-01-31 01:26:53.046] Checked set: Focused: 334, Dependents: 0, Dependencies: 8
[2019-01-31 01:26:53.047] Committing context heaps
[2019-01-31 01:26:53.047] Committing ResolvedRequiresHeap
[2019-01-31 01:26:53.047] Committing ResolvedRequiresHeap
[2019-01-31 01:26:53.047] Committing NameHeap
[2019-01-31 01:26:53.047] Committing InfoHeap
[2019-01-31 01:26:53.047] Committing all_providers hashtable
[2019-01-31 01:26:53.047] Committing parsing heaps
[2019-01-31 01:26:53.050] sending (22 errors) and (warnings from 150 files) to 1 subscribed clients (of 1 total)
[2019-01-31 01:26:53.052] Request: coverage P:\trunk\cerebro.sln\react.native\src\client\native\appNavigator.js

Output: tail
...
Jan 31 01:26:51.547 [debug] Writing 'Request 67' to the server connection
Jan 31 01:26:51.581 [debug] Server status: Server is rechecking (parsed files 0/0 (0.0%))
Jan 31 01:26:51.581 [debug] Server status: Server is rechecking (calculating dependencies)
Jan 31 01:26:51.581 [debug] Server status: Server is rechecking (merged files 0/3 (0.0%))
Jan 31 01:26:52.049 [debug] Server status: Server is rechecking (merged files 1/3 (33.3%))
Jan 31 01:26:52.548 [debug] Server status: Server is rechecking (merged files 3/3 (100.0%))
Jan 31 01:26:52.548 [debug] Server status: Server is rechecking (collating errors)
Jan 31 01:26:52.548 [debug] Server status: Server is rechecking (finishing up)
Jan 31 01:26:52.550 [debug] Server status: Server is rechecking (starting up)
Jan 31 01:26:52.550 [debug] Server status: Server is rechecking (parsed files 0/1 (0.0%))
Jan 31 01:26:52.580 [debug] Server status: Server is rechecking (parsed files 1/1 (100.0%))
Jan 31 01:26:52.587 [debug] Creating a new ephemeral connection
Jan 31 01:26:52.587 [debug] Waiting for a new socket connection
Jan 31 01:26:52.588 [debug] Adding request (status) to the command stream
Jan 31 01:26:52.799 [debug] Creating a new ephemeral connection
Jan 31 01:26:52.799 [debug] Waiting for a new socket connection
Jan 31 01:26:52.800 [debug] Server status: Server is rechecking (resolving dependencies)
Jan 31 01:26:52.801 [debug] Adding request (find-refs P:\trunk\cerebro.sln\react.native\src\client\native\appNavigator.js:259:25:false:false) to the command stream
Jan 31 01:26:53.049 [debug] Writing 'Request 68' to the server connection
Jan 31 01:26:53.049 [debug] Server status: Server is rechecking (parsed files 0/0 (0.0%))
Jan 31 01:26:53.049 [debug] Server status: Server is rechecking (calculating dependencies)
Jan 31 01:26:53.049 [debug] Server status: Server is rechecking (collating errors)
Jan 31 01:26:53.052 [debug] Server status: Server is rechecking (finishing up)
Jan 31 01:26:53.052 [debug] Server status: Server is handling a request (starting up)
Jan 31 01:26:53.552 [debug] Writing 'Request 69' to the server connection

I suspect we have windows-platform specific stability/resource-leakage issue here.
I've tested various versions of flow-bin on Windows 10.

It seems that last version not affected by stall-problem was 0.69.

In particular, I note how many Requests server proceeds before hung with "The flow server is not responding" issue.

Here is collected data for more modern versions:
v.0.70 : 185, 117, 339, 82 (number of Requests before hung)
v.073 : 361
v.075 : 215,137
v.076 : 19, 207
v.091 : 69,107
v.092 : 17

Last messages in stdout ussually is:
"Writing 'Request N' to the server connection"
"Waiting for a new socket connection"
There is no unusuall (no errors) messages in Server Log.

Versions 0.69, 0.68, 0.65, 0.59 can handle thousands of request without stalling. (Its throw exceptions rarely, however get instanly restared by IDE)

I work on react-native project, node_modules contains ~46K files.
Increasing "shared-memory" settings does not change much.

I understand your pain, I don't know if we can alleviate it at the moment. In any case, could you please share some info on your .flowconfig, server parameters/flags, and whether you're using lazy mode, and which version of it?

run server with --debug flag
All other settings by default.

For all versions I used same config. I add some Lib, Ignore lines.
change module.name_mapper to
module.name_mapper.extension='png' -> '<PROJECT_ROOT>/src/client/flow/DisableImageStub.js.flow'
file DisableImageStub.js.flow:

const stub = {  uri: 'stub.png' };
export default stub; 

.flowconfig

[ignore]
; We fork some components by platform
;.*/*[.]android.js
.*/*[.]web.js
<PROJECT_ROOT>/node_modules/.*/*[.]android.js
<PROJECT_ROOT>/web
<PROJECT_ROOT>/src/client/web

; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/

; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*

; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
.*/Libraries/react-native/ReactNative.js

; Additional create-react-native-app ignores

; Ignore duplicate module providers
.*/node_modules/fbemitter/lib/*

; Ignore misbehaving dev-dependencies
.*/node_modules/xdl/build/*
.*/node_modules/reqwest/tests/*

; Ignore missing expo-sdk dependencies (temporarily)
; https://github.com/expo/expo/issues/162
.*/node_modules/expo/src/*

; Ignore react-native-fbads dependency of the expo sdk
.*/node_modules/react-native-fbads/*

;.*/node_modules/react-native/Libraries/Lists/*
.*/node_modules/react-native/Libraries/Experimental/*
;.*/node_modules/react-native/Libraries/Components/Slider/Slider.js
;.*/node_modules/react-native/Libraries/Components/Switch/Switch.js
;.*/node_modules/react-native/Libraries/ReactNative/AppContainer.js
;.*/node_modules/react-native/Libraries/react-native/react-native-implementation.js

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow
src/lib/flow/tLibGlobal.js
src/lib/flow/tLibRpc.js
src/lib/flow/tLibPlatform.native.js
src/client/flow/tGlobal.js
src/client/flow/tPlatform.native.js

[options]
module.system=haste

module.file_ext=.ios.js
module.file_ext=.android.js
module.file_ext=.native.js
module.file_ext=.js

;experimental.strict_type_args=true
;unsafe.enable_getters_and_setters=true

munge_underscores=true

;module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
module.name_mapper.extension='png' -> '<PROJECT_ROOT>/src/client/flow/DisableImageStub.js.flow'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe
suppress_type=$FlowFixMeProps

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError


[version]
^0.XX.

Try stopping flow (flow stop) first then run it. In my case, an instance of flow server was already running, not sure why, maybe it was a zombie from before or maybe I just forgot about it after running flow once.

still have the problem wiith flow 0.95.1 in a react project (https://github.com/electron-react-boilerplate/electron-react-boilerplate) I even kill the proc with taskkill /F /IM flow.exe but even after restart I get the same error...

any ideas?

Ok so I just killed all flow processes with taskkill and upgraded flow to 0.97.0 also Dont let VisualStudio Code to restart the flow Client. After that I ran yarn flow and it worked.

I lost all hopes to get Flow working under Windows.
My solution is VirtualBox with Linux for developing. Under Linux Flow works without problems (any version)

4 of 5 times stuck in Server is initializing (resolving dependencies): /

@0.80 - @0.97

I get this error a fair amount on windows 10 too. Doesn't occur on linux environment.

Still happening in 0.114.0.

tlgb commented

Still happening in 0.115.0

cmtmc commented

It hangs and crashes, multiple flow.exe are hanging. Windows 10. Any chance to make it work smoothly? Thanks!

Any solution for windows 10?
Version: 0.92.1
It Hangs and Crashes. Can please focus this BUG it affect a lot of time to re-run the whole project because of this. thanks

Still happening in 0.117.0

Temporary solution on Mac, the following command helped me after being done coding for the day;
killall flow

I'm still getting this in 0.138.0. This issue has been open for years. Does flow basically just not support Windows 10? I would really like the functionality but if it isn't supported I'll have to look elsewhere.

Still this issue occurs, I don't know why no one bother to fix it.
Screenshot 2021-07-20 at 1 32 56 AM

cmtmc commented

Sounds great! Could you please say what the clue is - install per project?

Ya I think that works :)

@bribay I am on flow 0.162.1 currently, and here's what I have found after running flow server --debug --sharedmemory-log-level=1 and adding sharedmemory.hash_table_pow=21 to .flowconfig:

  • Even though I had been blaming the flow server, I must admit that the flow server seems to be stable; at least if launched in foreground mode
  • What is suspicious though, is that the VS Code extension seems to be firing a multitude of requests to the server even when I am idle (that is, not typing anything, not hovering mouse over the source code lines etc.). Most of the time this happens when computing coverage after saving changes to the source file, but not always - sometimes these "request bursts" seem to be quite random.

So, at least in combination with VS Code, I am no longer sure who's to blame: either it's the server's background mode that is much less stable on Windows, or the default hash table size settings that are too "modest", or is it actually a problem with the VS Code extension that seems to periodically overload the server.

mroch commented

Closing out old issues. This repository is just packaging prebuilt binaries. Please report issues with Flow itself on facebook/flow

note: there have been many recent Windows fixes, including in the latest 0.174.0. give that a shot and open a new issue on the other repo if there are still issues.

@bribay I am on flow 0.162.1 currently, and here's what I have found after running flow server --debug --sharedmemory-log-level=1 and adding sharedmemory.hash_table_pow=21 to .flowconfig:

  • Even though I had been blaming the flow server, I must admit that the flow server seems to be stable; at least if launched in foreground mode
  • What is suspicious though, is that the VS Code extension seems to be firing a multitude of requests to the server even when I am idle (that is, not typing anything, not hovering mouse over the source code lines etc.). Most of the time this happens when computing coverage after saving changes to the source file, but not always - sometimes these "request bursts" seem to be quite random.

So, at least in combination with VS Code, I am no longer sure who's to blame: either it's the server's background mode that is much less stable on Windows, or the default hash table size settings that are too "modest", or is it actually a problem with the VS Code extension that seems to periodically overload the server.

This resolves my issue