Flutter Web - dial tcp 127.0.0.1:8080: connect: connection refused - flutter

I was developing new Flutter Website, every time I run this command webdev serve --auto restart from VS Code, and test the site through http://127.0.0.1:8080/ and it just works good.
But when I did an update in main.dart file (normal edit for widgets), and do run the previous command again, it throws this error
dial tcp 127.0.0.1:8080: connect: connection refused
The terminal output is..
[INFO] Reading cached asset graph completed, took 543ms
[INFO] Checking for updates since last build completed, took 1.9s
[INFO] Serving `web` on http://127.0.0.1:8080
[INFO] Running build completed, took 531ms
[INFO] Caching finalized dependency graph completed, took 302ms
[INFO] Succeeded after 867ms with 0 outputs (0 actions)
[INFO] -------------------------------------------------------------------
My dart file has only normal widgets.

Related

How Kubernetes TCP Probe handle the fact that TCP handshake is manage by the OS?

I'm a bit confuse on how are handle TCP probe with Kubernetes the documentation says:
A third type of liveness probe uses a TCP socket. With this
configuration, the kubelet will attempt to open a socket to your
container on the specified port. If it can establish a connection, the
container is considered healthy, if it can't it is considered a
failure.
source
But has far as I known, socket client is connected before the server perform accept on the socket. This TCP handshake is managed by the OS... So how Kubernetes "known" the state of the socket?
To give a little be of context I'm trying to write a unit test in my application (C++) and I cannot figure how K8s handle this, but in k8s it does work as expected (I mean that if I do not accept the connection it will declare my container as not alive).
Thank you for your time and consideration!
Edit 1
Sorry #Steffen Ullrich it take me some time but here a sample of code: https://github.com/quentingodeau/k8s-probe
And then the traces that I get:
$ kubectl logs -f $(kubectl get pods | egrep -o 'sample-deployment-[^ ]*')
[2021-07-10 18:46:22.837] [info] Server acccept the client...
[2021-07-10 18:46:23.838] [info] Server acccept the client...
[2021-07-10 18:46:24.840] [info] Server acccept the client...
[2021-07-10 18:46:25.837] [info] Server acccept the client...
[2021-07-10 18:46:26.836] [info] Server acccept the client...
[2021-07-10 18:46:27.839] [info] Server acccept the client...
[2021-07-10 18:46:28.840] [info] Server acccept the client...
[2021-07-10 18:46:29.836] [info] Server acccept the client...
[2021-07-10 18:46:30.843] [info] Server acccept the client...
[2021-07-10 18:46:31.028] [info] Send SIGUSR1
[2021-07-10 18:46:31.836] [info] Server acccept the client...
[2021-07-10 18:46:31.836] [info] Start to not procssing incoming connection
[2021-07-10 18:46:35.855] [info] End of application (signal=15)
Edit 2
https://github.com/kubernetes/kubernetes/issues/103632
But has far as I known, socket client is connected before the server perform accept on the socket
While it is true that the connection might be established in the OS before accept is called, it is only established after listen is called on the socket. If the application is not running (failed to start, crashed) then there is no listening socket so any connection to it will fail. If the listen queue is full since the application fails to handle new connections in time, then the connection will fail too.
This kind of cheap probe is sufficient in many cases but it surely does not handle every case, like making sure that the application responds correctly and responds within the expected time. If such checks are needed more elaborate probes and maybe even application specific probes need to be done.

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

Ejabberd error while communicating Wait for feature request error

2016-09-05 19:34:51.079 [info] <0.498.0>#ejabberd_http:init:157 started: {gen_tcp,#Port<0.3947>}
2016-09-05 19:35:06.894 [info] <0.491.0>#ejabberd_listener🉑299 (#Port<0.3948>) Accepted connection 103.255.4.61:40738 -> 162.243.172.244:5222
2016-09-05 19:35:07.306 [info] <0.500.0>#ejabberd_c2s:wait_for_feature_request:789 ({socket_state,gen_tcp,#Port<0.3948>,<0.499.0>}) Failed authentication for 57a6697147e6e21b268b456d#server1.**.com from 193.355.4.61
2016-09-05 19:35:08.225 [info] <0.491.0>#ejabberd_listener🉑299 (#Port<0.3949>) Accepted connection 103.255.4.61:40739 -> 162.243.172.244:5222
2016-09-05 19:35:08.503 [info] <0.502.0>#ejabberd_c2s:wait_for_feature_request:789 ({socket_state,gen_tcp,#Port<0.3949>,<0.501.0>}) Failed authentication for 57a6697147e6e21b268b456d#server1.**.com from 193.355.4.61
Getting this error when XMPP-master client app try to send Request to Driver app

Deploy on Heroku using Scalatra

I am trying to deploy my Scalatra web application in heroku but I am having one problem.
My application works in local with SBT and using "heroku local web". I am using heroku sbt plugin.
When I use "sbt stage deployHeroku" the application is uploaded and started properly, obtaining:
user#user-X550JF:~/Documents/SOFT/cloudrobe$ sbt stage deployHeroku
Detected sbt version 0.13.9
....
....
[info] Packaging /home/user/Documents/SOFT/cloudrobe/target/scala-2.11/cloudrobe_2.11-0.1.0-SNAPSHOT.war ...
[info] Done packaging.
[success] Total time: 2 s, completed May 25, 2016 1:04:51 AM
[info] -----> Packaging application...
[info] - app: cloudrobe
[info] - including: target/universal/stage/
[info] -----> Creating build...
[info] - file: target/heroku/slug.tgz
[info] - size: 45MB
[info] -----> Uploading slug... (100%)
[info] - success
[info] -----> Deploying...
[info] remote:
[info] remote: -----> Fetching set buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/jvm-common.tgz... done
[info] remote: -----> sbt-heroku app detected
[info] remote: -----> Installing OpenJDK 1.8... done
[info] remote:
[info] remote: -----> Discovering process types
[info] remote: Procfile declares types -> web
[info] remote:
[info] remote: -----> Compressing...
[info] remote: Done: 93.5M
[info] remote: -----> Launching...
[info] remote: Released v11
[info] remote: https://cloudrobe.herokuapp.com/ deployed to Heroku
[info] remote:
[info] -----> Done
___________________________________________________________________________
Using "heroku logs" I can see:
2016-05-24T23:14:16.007200+00:00 app[web.1]: 23:14:16.006 [main] INFO org.mongodb.driver.connection - Opened connection [connectionId{localValue:5, serverValue:5}] to localhost:33333
2016-05-24T23:14:16.370324+00:00 app[web.1]: 23:14:16.370 [main] INFO o.f.s.servlet.ServletTemplateEngine - Scalate template engine using working directory: /tmp/scalate-5146893161861816095-workdir
2016-05-24T23:14:16.746719+00:00 app[web.1]: 23:14:16.746 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.w.WebAppContext#7a356a0d{/,file:/app/src/main/webapp,AVAILABLE}
2016-05-24T23:14:16.782745+00:00 app[web.1]: 23:14:16.782 [main] INFO o.e.jetty.server.ServerConnector - Started ServerConnector#7dc51783{HTTP/1.1}{0.0.0.0:8080}
2016-05-24T23:14:16.782924+00:00 app[web.1]: 23:14:16.782 [main] INFO org.eclipse.jetty.server.Server - Started #6674ms
But, 5 or 10 seconds later appears the following error showing that the connection has been timed out:
2016-05-24T23:52:32.962896+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=cloudrobe.herokuapp.com request_id=a7f68d98-54a2-44b7-8f5f-47efce0f1833 fwd="52.90.128.17" dyno= connect= service= status=503 bytes=
2016-05-24T23:52:45.463575+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
This is my Procfile using the port 5000:
web: target/universal/stage/bin/cloudrobe -Dhttp.address=127.0.0.1
Thank you.
Your app is binding to port 8080, but it needs to bind to the port set as the $PORT environment variable on Heroku. To do this, you need to add -Dhttp.port=$PORT to your Procfile. It also needs to bind to 0.0.0.0 and not 127.0.0.1. So it might look like this:
web: target/universal/stage/bin/cloudrobe -Dhttp.address=0.0.0.0 -Dhttp.port=$PORT

Openshift Minecraft Server timeout

I recently made an Minecraft Server on Openshift with this Tutorial.
After I made the port forwarding, I was able do get a Connection in Minecraft to my Server. But I cannot login! It simply ends with the Message: Timed-Out.
In the Server logs I only see, what I know: I lost my connection. Here are the logs:
2016-01-01 17:29:17 [INFO] Starting minecraft server version 1.
2016-01-01 17:29:17 [INFO] Loading properties
2016-01-01 17:29:17 [INFO] Default game type: SURVIVAL
2016-01-01 17:29:17 [INFO] Generating keypair
2016-01-01 17:29:18 [INFO] Starting Minecraft server on 127.2.1
2016-01-01 17:29:18 [INFO] Preparing level "world"
2016-01-01 17:29:18 [INFO] Preparing start region for level 0
2016-01-01 17:29:20 [INFO] Preparing spawn area: 52%
2016-01-01 17:29:20 [INFO] Done (1.911s)! For help, type "help"
2016-01-01 17:30:41 [SEVERE] Reached end of stream
2016-01-01 17:30:41 [INFO] /127.2.105.129:29361 lost connection
java.io.IOException: Bad packet id 72
at ei.a(SourceFile:193)
at ci.i(SourceFile:250)
at ci.c(SourceFile:16)
at cj.run(SourceFile:94)
2016-01-01 18:10:21 [INFO] /127.2.105.129:32075 lost connection
java.io.IOException: Bad packet id 72
at ei.a(SourceFile:193)
at ci.i(SourceFile:250)
at ci.c(SourceFile:16)
at cj.run(SourceFile:94)
2016-01-01 18:10:21 [INFO] /127.2.105.129:32098 lost connection
java.io.IOException: Bad packet id 72
at ei.a(SourceFile:193)
at ci.i(SourceFile:250)
at ci.c(SourceFile:16)
at cj.run(SourceFile:94)
java.io.IOException: Bad packet id 72 deals will a malformed packet. I've read where it could mean anything from not specifying the correct port to trying to connect with incompatible mod versions.
In your case, it looks like you are explicitly defining the server-ip in your server.properties. In the starting logs:
2016-01-01 17:29:18 [INFO] Starting Minecraft server on 127.2.1
127.2.1 is not a valid address, so it makes sense to me that packet transmission would be malformed. Leave this field blank (as it is by default) or provide a valid IPv4 address.
I feel pretty confident that is what is going on because the tutorial your provided makes you set this field as well.
Bad packet id 72 means that you are trying to login to a server that's port isn't configured correctly. in the log, you have mentioned 2016-01-01 17:29:18 [INFO] Starting Minecraft server on 127.2.1.
solution:
(I have configured my test server to similar to yours)
1. go to server.properties and in server-ip:section, remove the content after that. That will make it the default ip
go to your router home page and port forward the server to 25565
it should now work
Good luck on your new server! :)