Observatory server failed to start - Fails to create Socket Server - websocket

I'm building some internal tooling for myself to generate Flutter apps using some templates that I've setup along with some additional functionality that I can share between apps.
At the moment the code compiles, builds fine and deploys but it gets stuck on the first view (blank white screen) and retries to start the Observatory server 11 times before failing. There are no other errors besides the one below.
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Built build\app\outputs\apk\debug\app-debug.apk.
I/flutter ( 7011): Observatory server failed to start after 1 tries
I/flutter ( 7011): Observatory server failed to start after 2 tries
I/flutter ( 7011): Observatory server failed to start after 3 tries
I/flutter ( 7011): Observatory server failed to start after 4 tries
I/flutter ( 7011): Observatory server failed to start after 5 tries
I/flutter ( 7011): Observatory server failed to start after 6 tries
I/flutter ( 7011): Observatory server failed to start after 7 tries
I/flutter ( 7011): Observatory server failed to start after 8 tries
I/flutter ( 7011): Observatory server failed to start after 9 tries
I/flutter ( 7011): Observatory server failed to start after 10 tries
I/flutter ( 7011): Observatory server failed to start after 11 tries
I/flutter ( 7011): Could not start Observatory HTTP server:
I/flutter ( 7011): SocketException: Failed to create server socket (OS Error: Permission denied, errno = 13), address = 127.0.0.1, port = 0
I/flutter ( 7011): #0 _NativeSocket.bind (dart:io/runtime/bin/socket_patch.dart:591:7)
I/flutter ( 7011): <asynchronous suspension>
I/flutter ( 7011): #1 _RawServerSocket.bind (dart:io/runtime/bin/socket_patch.dart:1206:26)
I/flutter ( 7011): #2 _ServerSocket.bind (dart:io/runtime/bin/socket_patch.dart:1466:29)
I/flutter ( 7011): #3 ServerSocket.bind (dart:io/runtime/bin/socket_patch.dart:1457:26)
I/flutter ( 7011): #4 _HttpServer.bind (dart:_http/http_impl.dart:2520:25)
I/flutter ( 7011): #5 HttpServer.bind (dart:_http/http.dart:227:19)
I/flutter ( 7011): #6 Server.startup.poll (dart:vmservice_io/server.dart:355:36)
I/flutter ( 7011): <asynchronous suspension>
I/flutter ( 7011): #7 Server.startup (dart:vmservice_io/server.dart:367:23)
I/flutter ( 7011): <asynchronous suspension>
I/flutter ( 7011): #8 main (dart:vmservice_io/vmservice_io.dart:253:12)
I/flutter ( 7011):
My question's are:
how do I go about debugging this problem?
Do you have an idea of what can cause this?
The code looks the same as the template I'm working off (that works) with the only difference being the package name is different.
Edit 1
Here is the link to the project that hangs for reproduction.

In Android Manifest file add Internet Permission.
I'm also facing this problem. after adding this permission now working fine.
<uses-permission android:name="android.permission.INTERNET"/>
Problem is Internet permission is needed in release mode.
Android Manifest file have description for this
The INTERNET permission is required for development. Specifically,
flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.

Check android/app/src should have debug, main and profile directories.
check image
if debug folder is missing, just create one and copy manifest from profile, paste in debug.
if debug folder is there check it is having internet permissions or not. if not add.

When I was stripping down the template I unknowingly removed the debug folder under android/app/src thinking it was files generated from the build. That's the manifest Android uses to allow debugging so it needs to be there.

Related

Install laravel sail specific version (8)

I want to set up the repo of Jeffrey Wey from here with Laravel sail.
In the docs of laravel sail, I read how to setup everything:
I cloned the repo of Jeffrew Wey from here.
I did
composer require laravel/sail
then
php artisan sail:install
but here I get prompted with something which I cannot decide:
php artisan sail:install
Which services would you like to install? [mysql]:
[0] mysql
[1] pgsql
[2] mariadb
[3] redis
[4] memcached
[5] meilisearch
[6] minio
[7] mailhog
[8] selenium
I tried with 0 and then with 9 for mysql and got no error.
I tried starting the server with
APP_PORT=3002 WWWGROUP=1000 WWWUSER=1000 ./vendor/bin/sail up -d
But: Laravel is not accesible via the port 3002.
these are the docker containers running:
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
92687dc31ecd sail-8.1/app "start-container" 2 minutes ago Up 2 minutes 0.0.0.0:5173->5173/tcp, :::5173->5173/tcp, 8000/tcp, 0.0.0.0:3002->80/tcp, :::3002->80/tcp morph-laravel.test-1
eb763e3cd457 mysql/mysql-server:8.0 "/entrypoint.sh mysq…" 2 minutes ago Up 2 minutes (healthy) 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060-33061/tcp morph-mysql-1
The error logs of the container are quite long:
$ docker logs morph-laravel.test-1
2022-10-04 18:03:38,800 INFO Set uid to user 0 succeeded
2022-10-04 18:03:38,807 INFO supervisord started with pid 1
2022-10-04 18:03:39,814 INFO spawned: 'php' with pid 16
PHP Fatal error: During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Collection.php:1411
Stack trace:
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(11): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 /var/www/html/vendor/composer/ClassLoader.php(571): include('...')
#2 /var/www/html/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/helpers.php(15): Composer\Autoload\ClassLoader->loadClass()
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(89): collect()
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(78): Illuminate\Foundation\PackageManifest->config()
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php(26): Illuminate\Foundation\PackageManifest->aliases()
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(237): Illuminate\Foundation\Bootstrap\RegisterFacades->bootstrap()
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(310): Illuminate\Foundation\Application->bootstrapWith()
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(127): Illuminate\Foundation\Console\Kernel->bootstrap()
#10 /var/www/html/artisan(37): Illuminate\Foundation\Console\Kernel->handle()
#11 {main} in /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Collection.php on line 11
PHP Fatal error: Uncaught ErrorException: Function must be enabled in php.ini by setting 'xdebug.mode' to 'develop' in /var/www/html/vendor/symfony/error-handler/Error/FatalError.php:37
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 /var/www/html/vendor/symfony/error-handler/Error/FatalError.php(37): xdebug_get_function_stack()
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(143): Symfony\Component\ErrorHandler\Error\FatalError->__construct()
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(130): Illuminate\Foundation\Bootstrap\HandleExceptions->fatalErrorFromPhpError()
#4 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown()
#5 {main}
thrown in /var/www/html/vendor/symfony/error-handler/Error/FatalError.php on line 37
2022-10-04 18:03:41,424 INFO success: php entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-10-04 18:03:41,426 INFO exited: php (exit status 255; not expected)

Issue while using yasca in CentOS

Is yaska supported in Linux? I tried installing it on CentOS and getting below error.
[root#390f68c98d2b yasca]# sh yasca.sh ./resources/test
Fatal error: Uncaught exception 'LogicException' with message 'Class Yasca\Scanner could not be loaded' in /var/www/html/yasca/Yasca/Main.php:36
Stack trace:
#0 /var/www/html/yasca/Yasca/Main.php(36): spl_autoload('Yasca\\Scanner')
#1 [internal function]: {closure}()
#2 /var/www/html/yasca/Yasca/Main.php(357): call_user_func(Object(Closure))
#3 /var/www/html/yasca/Yasca/Start.php(14): include('/var/www/html/y...')
#4 {main}
thrown in /var/www/html/yasca/Yasca/Main.php on line 36
Can someone please help in this?

poste.io Let's encrypt certificate issue exception

I am using the poste.io mail server. While trying to issue the SSL cert using lets encrypt, it throws below error. Anyone has observed it already and could fix it?
[2016-11-08 00:12:44] LEScript.INFO: Account already registered. Continuing.
[2016-11-08 00:12:44] LEScript.INFO: Starting certificate generation process for domains
[2016-11-08 00:12:44] LEScript.INFO: Requesting challenge for mail.domain.ltd
[2016-11-08 00:12:45] LEScript.INFO: Sending signed request to /acme/new-authz
[2016-11-08 00:12:45] LEScript.INFO: Got challenge token for mail.domain.ltd
[2016-11-08 00:12:45] LEScript.INFO: Token for mail.domain.ltd saved at /opt/www//.well-known/acme-challenge/UEyhta88fiS_E5WTn-SOxKI-lqbsK1-eTOceiE_UnTQ and should be available at http://mail.domain.ltd/.well-known/acme-challenge/UEyhta88fiS_E5WTn-SOxKI-lqbsK1-eTOceiE_UnTQ
[2016-11-08 00:12:47] LEScript.ERROR: Please check http://mail.domain.ltd/.well-known/acme-challenge/UEyhta88fiS_E5WTn-SOxKI-lqbsK1-eTOceiE_UnTQ - token not available
[2016-11-08 00:12:47] LEScript.ERROR: #0 /opt/mailserver-admin/src/Analogic/LetsEncryptBundle/Handler/LeHandler.php(55): Analogic\ACME\Lescript->signDomains(Array)
[2016-11-08 00:12:47] LEScript.ERROR: #1 /opt/mailserver-admin/src/Analogic/LetsEncryptBundle/Controller/LeController.php(74): Analogic\LetsEncryptBundle\Handler\LeHandler->renew(true)
[2016-11-08 00:12:47] LEScript.ERROR: #2 [internal function]: Analogic\LetsEncryptBundle\Controller\LeController->issueAction(Object(Symfony\Component\HttpFoundation\Request))
[2016-11-08 00:12:47] LEScript.ERROR: #3 /opt/mailserver-admin/var/bootstrap.php.cache(3040): call_user_func_array(Array, Array)
[2016-11-08 00:12:47] LEScript.ERROR: #4 /opt/mailserver-admin/var/bootstrap.php.cache(2995): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
[2016-11-08 00:12:47] LEScript.ERROR: #5 /opt/mailserver-admin/var/bootstrap.php.cache(2335): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
[2016-11-08 00:12:47] LEScript.ERROR: #6 /opt/mailserver-admin/web/app.php(19): Symfony\Component\HttpKernel\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request))
[2016-11-08 00:12:47] LEScript.ERROR: #7 {main}
Have posted in https://bitbucket.org/analogic/mailserver/issues/139/lets-encrypt-certificate-issue-exception but seems they only respond to pro customers. :(
Problem solved. My firewall disabled the port 25. Once the port is open, it started to work.

Redis/Laravel - Keep getting error: Unknown prefix:

I have been searching and searching for any information regarding this redis error, but so far have not found any information. Any help would be greatly appreciated.
Here is my setup:
Laravel with 2 redis connections, 6379 for cache, and 6380 for a datastore.
Every couple of requests to the datastore, I get this error in my logs:
exception 'Predis\Protocol\ProtocolException' with message 'Unknown prefix: '1' [tcp://MY_SERVER_ADDRESS:6380]
This just started within the last few days, and I have not changed anything in the redis config or laravel redis config.
A little more info:
I do not have a prefix set in laravel anywhere.. laravel, predis, or redis is adding it itself.
The "prefix" that gets added changes, yesterday it was 'O', today it is '1'.
This is happening on two separate instances of laravel. The instances share an encryption key, but do not share any files or configs. They both connect to this redis server
Here is the full stack trace:
[2015-02-02 22:19:13] production.ERROR: exception 'Predis\Protocol\ProtocolException' with message 'Unknown prefix: '1' [tcp://MY_SERVER_ADDRESS:6380]' in /var/www/html/vendor/predis/predis/lib/Predis/Connection/AbstractConnection.php:151
Stack trace:
#0 /var/www/html/vendor/predis/predis/lib/Predis/Connection/StreamConnection.php(274): Predis\Connection\AbstractConnection->onProtocolError()
#1 /var/www/html/vendor/predis/predis/lib/Predis/Connection/StreamConnection.php(262): Predis\Connection\StreamConnection->read()
#2 /var/www/html/vendor/predis/predis/lib/Predis/Connection/AbstractConnection.php(130): Predis\Connection\StreamConnection->read()
#3 /var/www/html/vendor/predis/predis/lib/Predis/Connection/AbstractConnection.php(122): Predis\Connection\AbstractConnection->readResponse()
#4 /var/www/html/vendor/predis/predis/lib/Predis/Client.php(246): Predis\Connection\AbstractConnection->executeCommand()
#5 /var/www/html/vendor/predis/predis/lib/Predis/Client.php(228): Predis\Client->executeCommand()
#6 /var/www/html/app/interfaces/RedisRepository.php(47): Predis\Client->__call()
#7 /var/www/html/app/controllers/TrackingController.php(239): RedisRepository->registerNodeEventStatsGlobal()
#8 (): TrackingController->saveTrackerUserData()
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(231): call_user_func_array()
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(93): Illuminate\Routing\Controller->callAction()
#11 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(62): Illuminate\Routing\ControllerDispatcher->call()
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(962): Illuminate\Routing\ControllerDispatcher->dispatch()
#13 (): {closure}()
#14 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(109): call_user_func_array()
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1028): Illuminate\Routing\Route->run()
#16 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(996): Illuminate\Routing\Router->dispatchToRoute()
#17 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(775): Illuminate\Routing\Router->dispatch()
#18 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(745): Illuminate\Foundation\Application->dispatch()
#19 /var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware.php(72): Illuminate\Foundation\Application->handle()
#20 /var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Queue.php(47): Illuminate\Session\Middleware->handle()
#21 /var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Guard.php(51): Illuminate\Cookie\Queue->handle()
#22 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Illuminate\Cookie\Guard->handle()
#23 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(641): Stack\StackedHttpKernel->handle()
#24 /var/www/html/public/index.php(49): Illuminate\Foundation\Application->run()
#25 {main} [] []
Help plz :(
The issue turned out to be specific to HHVM. Once I switched back to PHP-FPM the errors stopped.
HHVM does still have its quirks.

How to debug Cocoa application that crashes before main loop only when breakpoints are enabled?

I have a Cocoa application that works when run in both debug and release mode, but crashes as soon as I run it in debug mode with breakpoints enabled. The crash happens before the app has finished loading, and the stack trace hints at a KVO problem. Unfortunately, since the crash happens outside of my code, all I can see in the debugger are the (generic) method names and assembly code. How do I go about finding the root cause?
Stack trace:
#0 0x98dde4e6 in objc_exception_throw
#1 0x943443e8 in +[NSException raise:format:arguments:]
#2 0x9434435a in +[NSException raise:format:]
#3 0x9092bc49 in -[NSObject(NSKeyValueObserverRegistration) _removeObserver:forProperty:]
#4 0x9092b864 in -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:]
#5 0x938a8a63 in -[NSController removeObserver:forKeyPath:]
#6 0x0037807a in dyld_stub_write
#7 0x00378b0e in dyld_stub_write
#8 0x003774d6 in dyld_stub_write
#9 0x003775fe in dyld_stub_write
#10 0x936b8c3b in -[NSCustomObject nibInstantiate]
#11 0x936b8a49 in -[NSIBObjectData instantiateObject:]
#12 0x936b7d4e in -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:]
#13 0x936b61f4 in loadNib
#14 0x936b55ed in +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:]
#15 0x936b54fe in +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:]
#16 0x936b5449 in +[NSBundle(NSNibLoading) loadNibNamed:owner:]
#17 0x936b224d in NSApplicationMain
#18 0x00001f68 in main at main.m:13
Look at the bottom of the stack. This is nib loading code. Given the KVO at the top of the stack, my first guess would be that you connected something to an outlet or through bindings but didn't properly define the property you connected to. Make sure you include accessors for any properties you define.

Resources