Could not connect to the Gradle daemon in Flutter and Android Studio - flutter

I just set up Android Studio and kept on trying to run a simple Flutter project but it keeps failing. I've already done all of the suggested environment variable path solution but it is still not working.
However, I get these errors:
FAILURE: Build failed with an exception.
* What went wrong:
Could not connect to the Gradle daemon.
Daemon uid: 172214b8-f7ea-4f3d-8ab7-c713e0d9b3a9 with diagnostics:
Daemon pid: 15560
log file: C:\Users\George\.gradle\daemon\6.7\daemon-15560.out.log
----- Last 20 lines from daemon log file - daemon-15560.out.log -----
2021-04-09T22:42:29.554+0800 [DEBUG] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertised daemon context: DefaultDaemonContext[uid=172214b8-f7ea-4f3d-8ab7-c713e0d9b3a9,javaHome=C:\Program Files\Android\Android Studio\jre,daemonRegistryDir=C:\Users\George\.gradle\daemon,pid=15560,idleTimeout=10800000,priority=NORMAL,daemonOpts=-Xmx1024m,-Dfile.encoding=windows-1252,-Duser.country=US,-Duser.language=en,-Duser.variant]
2021-04-09T22:42:29.555+0800 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Storing daemon address: [bae42ebf-f3ca-4a19-82c4-edb1b3ba7f99 port:52911, addresses:[0.0.0.0/0.0.0.0]], context: DefaultDaemonContext[uid=172214b8-f7ea-4f3d-8ab7-c713e0d9b3a9,javaHome=C:\Program Files\Android\Android Studio\jre,daemonRegistryDir=C:\Users\George\.gradle\daemon,pid=15560,idleTimeout=10800000,priority=NORMAL,daemonOpts=-Xmx1024m,-Dfile.encoding=windows-1252,-Duser.country=US,-Duser.language=en,-Duser.variant]
2021-04-09T22:42:29.561+0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
2021-04-09T22:42:29.563+0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2021-04-09T22:42:29.566+0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2021-04-09T22:42:29.567+0800 [LIFECYCLE] [org.gradle.launcher.daemon.server.Daemon] Daemon server started.
2021-04-09T22:42:29.567+0800 [DEBUG] [org.gradle.launcher.daemon.bootstrap.DaemonStartupCommunication] Completed writing the daemon greeting. Closing streams...
2021-04-09T22:42:29.571+0800 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] stopOnExpiration() called on daemon
2021-04-09T22:42:29.572+0800 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] awaitExpiration() called on daemon
2021-04-09T22:42:29.572+0800 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
2021-04-09T22:42:39.581+0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2021-04-09T22:42:39.582+0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2021-04-09T22:42:39.584+0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2021-04-09T22:42:39.585+0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2021-04-09T22:42:39.586+0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2021-04-09T22:42:39.586+0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2021-04-09T22:42:39.588+0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2021-04-09T22:42:39.591+0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] The file lock is held by a different Gradle process (pid: 4648, lockId: 2926288451081611781). Pinged owner at port 62685
2021-04-09T22:42:39.591+0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2021-04-09T22:42:39.596+0800 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
----- End of the daemon log -----
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Exception: Gradle task assembleDebug failed with exit code 1

Related

How boofuzz detect crashes and log crashed test cases

We are using boofuzz for fuzzing remote service with tcp protocol. The fuzzer script is as follows.
session = Session(target = Target(connection = SocketConnection(host, port, proto='tcp')))
s_initialize("Test")
s_string("Fuzz", fuzzable = True)
session.connect(s_get("Test"))
session.fuzz()
After a while, we noticed the remote service is crashed but the fuzzer just repeatly tried to restart. The fuzzer did not detect the remote service is closed and the crashed test case is not stored.
[2022-02-02 04:18:42,231] Test Step: Restarting target
[2022-02-02 04:18:42,231] Info: Restarting target process using CallbackMonitor
[2022-02-02 04:18:42,231] Test Step: Cleaning up connections from callbacks
[2022-02-02 04:18:42,231] Info: Closing target connection...
[2022-02-02 04:18:42,231] Info: Connection closed.
[2022-02-02 04:18:42,231] Info: No reset handler available... sleeping for 5 seconds
[2022-02-02 04:18:47,236] Info: Opening target connection (xxx)...
[2022-02-02 04:18:47,237] Info: Cannot connect to target; retrying. Note: This likely indicates a failure caused by the previous test case, or a target that is slow to restart.
[2022-02-02 04:18:47,237] Test Step: Restarting target
[2022-02-02 04:18:47,237] Info: Restarting target process using CallbackMonitor
[2022-02-02 04:18:47,237] Test Step: Cleaning up connections from callbacks
[2022-02-02 04:18:47,237] Info: Closing target connection...
[2022-02-02 04:18:47,237] Info: Connection closed.
[2022-02-02 04:18:47,237] Info: No reset handler available... sleeping for 5 seconds
[2022-02-02 04:18:52,243] Info: Opening target connection (xxx)...
[2022-02-02 04:18:52,244] Info: Cannot connect to target; retrying. Note: This likely indicates a failure caused by the previous test case, or a target that is slow to restart.
How can we customize the boofuzz script so that:
we can detect the remote service is closed (e.g., try tcp connect)?
we can store the untruncated crashed test case to disk?
If you are not using the monitors, you could add a post_test_case_callbacks that check if the server is alive. This function will be called after each test case.
post_test_case_callbacks (list of method) – The registered method will
be called after each fuzz test case. Default None.
e.g.
logger = FuzzLoggerText()
def target_alive(target, fuzz_data_logger, session, sock, *args, **kwargs):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
sock.connect((host, port))
logger.log_pass(description="alive")
except ConnectionRefusedError:
logger.log_fail(description="Server down")
session = Session(target=Target(SocketConnection(host, int(port))), post_test_case_callbacks=[target_alive])

All members disappeared from a patroni cluster

I have 2 members in patroni cluster (1-master and 1-replica). In logs i saw problem after master reconnecting to new etcd server:
ERROR: Request to server http://etcd2:2379 failed: MaxRetryError('HTTPConnectionPool(host=\'etcd2\', port=2379): Max retries exceeded with url: /v2/keys/patroni/patroni-cluster/?recursive=true (Caused by ReadTimeoutError("HTTPConnectionPool(host=\'etcd2\', port=2379): Read timed out. (read timeout=3.333078201239308)"))')
INFO: Reconnection allowed, looking for another server.
INFO: Retrying on http://etcd1:2379
INFO: Selected new etcd server http://etcd1:2379
INFO: Lock owner: patroni2; I am patroni1
INFO: does not have lock
INFO: Reaped pid=3098484, exit status=0
LOG: received immediate shutdown request
WARNING: terminating connection because of crash of another server process
DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
HINT: In a moment you should be able to reconnect to the database and repeat your command.
After this replica node became a master:
INFO: Got response from patroni1 http://0.0.0.0:8008/patroni: {"state": "running", "postmaster_start_time": "2021-08-09 14:43:18.372 UTC", "role": "replica", "server_version": 120003, "cluster_unlocked": true, "xlog": {"received_location": 139045264096, "replayed_location": 139045264096, "replayed_timestamp": "2021-09-27 15:03:10.389 UTC", "paused": false}, "timeline": 30, "database_system_identifier": "6904244251638517787", "patroni": {"version": "1.6.5", "scope": "patroni-cluster"}}
WARNING: Could not activate Linux watchdog device: "Can't open watchdog device: [Errno 2] No such file or directory: '/dev/watchdog'"
INFO: promoted self to leader by acquiring session lock
server promoting
LOG: received promote request
INFO: Lock owner: patroni2; I am patroni2
INFO: no action. i am the leader with the lock
ERROR: replication slot "patroni1" does not exist
ERROR: replication slot "patroni1" does not exist
INFO: acquired session lock as a leader
As you can see above new master cannot see a patroni1 now. After several times to recover wal patroni1 wrote these logs below:
INFO: establishing a new patroni connection to the postgres cluster
INFO: My wal position exceeds maximum replication lag
INFO: following a different leader because i am not the healthiest node
INFO: My wal position exceeds maximum replication lag
These logs information doesn't change at this time. patroni2 writes acquired session lock as a leader and patroni1 writes my wal position exceeds maximum replication lag.
But i can't see them in patroni cluster when use patronictl -c /patroni.yml list command.
How should i bring them back to cluster in better way?

How to solve flutter build apk error "Could not dispatch a message to the daemon"

I was run flutter build apk command then I am facing this exception below:
FAILURE: Build failed with an exception.
* What went wrong:
Could not dispatch a message to the daemon.
The message received from the daemon indicates that the daemon has disappeared.
Build request sent: Build{id=68f521a5-3aa3-4a37-be49-737d539a0090, currentDir=C:\Users\Lenovo\AndroidStudioProjects\subidha-pharmacy\android}
Attempting to read last messages from the daemon log...
Daemon pid: 10516
log file: C:\Users\Lenovo\.gradle\daemon\5.1.1\daemon-10516.out.log
----- Last 20 lines from daemon log file - daemon-10516.out.log -----
14:41:46.324 [DEBUG] [org.gradle.process.internal.health.memory.MemoryManager] Emitting OS memory status event {Total: 16627265536, Free: 448
6569984}
14:41:46.324 [DEBUG] [org.gradle.launcher.daemon.server.health.LowMemoryDaemonExpirationStrategy] Received memory status update: {Total: 1662
7265536, Free: 4486569984}
14:41:46.324 [DEBUG] [org.gradle.process.internal.health.memory.MemoryManager] Emitting JVM memory status event {Maximum: 1431830528, Committ
ed: 1229455360}
14:41:46.605 [DEBUG] [sun.rmi.transport.tcp] RMI TCP Connection(19)-127.0.0.1: (port 61852) connection closed
14:41:46.606 [DEBUG] [sun.rmi.transport.tcp] RMI TCP Connection(19)-127.0.0.1: close connection
14:41:47.590 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
14:41:47.594 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
14:41:47.595 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
14:41:47.595 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
14:41:47.596 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
14:41:47.597 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
14:41:47.597 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
14:41:47.598 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
14:41:47.599 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
14:41:47.599 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
14:41:50.130 [DEBUG] [sun.rmi.transport.tcp] RMI TCP Connection(20)-127.0.0.1: (port 61852) connection closed
14:41:50.130 [DEBUG] [sun.rmi.transport.tcp] RMI TCP Connection(20)-127.0.0.1: close connection
14:41:51.313 [DEBUG] [org.gradle.process.internal.health.memory.MemoryManager] Emitting OS memory status event {Total: 16627265536, Free: 448
3686400}
14:41:51.313 [DEBUG] [org.gradle.launcher.daemon.server.health.LowMemoryDaemonExpirationStrategy] Received memory status update: {Total: 1662
7265536, Free: 4483686400}
14:41:51.314 [DEBUG] [org.gradle.process.internal.health.memory.MemoryManager] Emitting JVM memory status event {Maximum: 1431830528, Committ
ed: 1229455360}
----- End of the daemon log --enter code here---
FAILURE: Build failed with an exception.
What went wrong:
Could not dispatch a message to the daemon.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full in
sights.
Get more help at https://help.gradle.org
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 424.7s (!)
Gradle task assembleRelease failed with exit code 1
flutter clean
flutter build apk

how to solve Exception: Gradle task assembleDebug failed with exit code 1

I am try to learn flutter. but in first when I want to run default app in flutter(counter) I face to this error. can you help me how I can solve it?
Launching lib\main.dart on Android SDK built for x86 in debug mode…
Running Gradle task ‘assembleDebug’…
FAILURE: Build failed with an exception.
What went wrong:
Could not connect to the Gradle daemon.
Daemon uid: 7e121133-e94a-477f-b757-cb0b2f130b5e with diagnostics:
Daemon pid: 11244
log file: C:\Users\Morteza.gradle\daemon\5.6.2\daemon-11244.out.log
----- Last 20 lines from daemon log file - daemon-11244.out.log -----
23:51:11.367 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
23:51:11.368 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter #2-Native WiFi Filter Driver-0000
23:51:11.371 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
23:51:11.372 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter #2-QoS Packet Scheduler-0000
23:51:11.375 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
23:51:11.376 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter #2-WFP 802.3 MAC Layer LightWeight Filter-0000
23:51:11.380 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
23:51:11.383 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpIncomingConnector] Listening on [dcd48d42-facd-4af7-9888-10006483df5b port:65384, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]].
23:51:11.388 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] Daemon starting at: Wed Sep 16 23:51:11 PDT 2020, with address: [dcd48d42-facd-4af7-9888-10006483df5b port:65384, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]]
23:51:11.389 [INFO] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertising the daemon address to the clients: [dcd48d42-facd-4af7-9888-10006483df5b port:65384, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]]
23:51:11.389 [DEBUG] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertised daemon context: DefaultDaemonContext[uid=7e121133-e94a-477f-b757-cb0b2f130b5e,javaHome=C:\Program Files\Android\Android Studio\jre,daemonRegistryDir=C:\Users\Morteza.gradle\daemon,pid=11244,idleTimeout=10800000,priority=NORMAL,daemonOpts=-Xmx1536M,-Dfile.encoding=windows-1252,-Duser.country=US,-Duser.language=en,-Duser.variant]
23:51:11.391 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Storing daemon address: [dcd48d42-facd-4af7-9888-10006483df5b port:65384, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]], context: DefaultDaemonContext[uid=7e121133-e94a-477f-b757-cb0b2f130b5e,javaHome=C:\Program Files\Android\Android Studio\jre,daemonRegistryDir=C:\Users\Morteza.gradle\daemon,pid=11244,idleTimeout=10800000,priority=NORMAL,daemonOpts=-Xmx1536M,-Dfile.encoding=windows-1252,-Duser.country=US,-Duser.language=en,-Duser.variant]
23:51:11.405 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
23:51:11.411 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
23:51:11.420 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
23:51:11.420 [LIFECYCLE] [org.gradle.launcher.daemon.server.Daemon] Daemon server started.
23:51:11.423 [DEBUG] [org.gradle.launcher.daemon.bootstrap.DaemonStartupCommunication] Completed writing the daemon greeting. Closing streams…
23:51:11.433 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] stopOnExpiration() called on daemon
23:51:11.435 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] awaitExpiration() called on daemon
23:51:11.435 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
----- End of the daemon log -----
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Exception: Gradle task assembleDebug failed with exit code 1
What you can try is flutter clean flutter upgrade and Invalidate caches and restart. If you are using Android Studio/IntelliJ

Terraform apply throwing Error "timeout while waiting for plugin to start"

I am running into below error during terraform apply.
Error: timeout while waiting for plugin to start
Debug LOG:
2020-07-09T13:15:46.551-0400 [DEBUG] plugin: plugin process exited: path=/.terraform/plugins/darwin_amd64/terraform-provider-kubernetes_v1.11.3_x4 pid=48631
2020-07-09T13:15:46.551-0400 [DEBUG] plugin: plugin exited
2020-07-09T13:15:46.555-0400 [WARN] plugin: plugin failed to exit gracefully
2020-07-09T13:15:46.558-0400 [DEBUG] plugin: plugin process exited: path=/.terraform/plugins/darwin_amd64/terraform-provider-null_v2.1.2_x4 pid=48389
2020-07-09T13:15:46.558-0400 [DEBUG] plugin: plugin exited
That might happen because the lack of resources on your system (e.g RAM).