Is there an alternative when using supervisor with Gunicorn? - gunicorn

I am creating a Flask app and I using Nginx and Gunicorn inside a virtual enviroment. When I start Gunicorn, gunicorn app:app everything works fine. Then when I activate the Supervisor to keep gunicorn active, it gives me a 500 error. I am reading in my log in var/log/ that is error happens when I try to open a file that should have been created after subprocess.run(command, capture_output=True, shell=True) So this line is not being executed correctly.
Is there an alternative to supervisor to keep my app running when my putty is closed?
Thanks.

I found the answer here.
https://docs.gunicorn.org/en/stable/deploy.html
It says that one good option is using Runit.
EDIT:
I ended up using the Gunicorn function called --deamon. It is similar and makes everything much simpler.

Related

PhpStorm showing "unvailable" breakpoint whereas execution is suspended

I'm sometimes stuck while attempting to debug my code.
Debug Session is active, code execution is suspended :
But I cannot see what really happens, as the breakpoint show "unavailable" ("no parking" symbol):
Does anybody know about this sign ?
I still haven't found any information about it on JetBrains sites... that's why I'm here :-)
(PhpStorm 2020.3, using docker containers (linux containers) with Docker Desktop/ Windows 10)
[EDIT] :
I just noticed that "break at first line in php script" seem to be functioning though:
But I have these weird breakpoints instead of red "normal" ones, and an highlighted line.
I tried restarting my docker containers, same issue. This produces seemingly randomly and gets solved after a while ... (reboot ?...)
[EDIT] SOLVED
The path mapping (local<->docker) for the root of my project was empty (how did it happen...) in my docker configuration in PhPStorm.
I'm not sure how this problem occured, but I'll be able to solve it next time if it's back.
If you try to disable "break at first line in php scripts" you may get the message :
17:38 Debug session was finished without being paused It may be
caused by path mappings misconfiguration or not synchronized local and
remote projects. To figure out the problem check path mappings
configuration for 'docker-server' server at PHP|Servers or enable
Break at first line in PHP scripts option (from Run menu). Do not
show again
In my case, the path mapping for the root of my project was incomplete "Absolute path on the server" was emtpy. I don't know how it happened but you could check :
In PHP | Servers

Running Github Actions on OSX results in "Could not find domain for port (Aqua)"

I've followed the directions here, but when I run ./svc.sh run, I receive the following error:
Could not find domain for port (Aqua)
I'm SSH-ing into a box to run this command, it seems to work fine when I'm not in a headless session, but I need this to be headless and as a background service. Anyone else run into this?
I was able to resolve this, addressed here
sudo cp {/Users/xxx/Library/LaunchAgents,/Library/LaunchDaemons}/your.plist
I was able to reboot my machine without logging in and see the runner active
Solution by #futbolpal not good, because LaunchDaemons doesn't have access to keychain.
Better copy to LaunchAgents
Like:
sudo cp {/Users/xxx/Library/LaunchAgents,/Library/LaunchAgents}/your.plist

Frankenserve... how to stop polyserve?

While at the (excellent!) Polymer Summit in London, as part of the codelabs I ran "polymer serve" and got the application template up and running: http://localhost:8080/
Great! But how do I stop the server? It's continually running and survives a reboot. I need to get on with another project :P
I'm on Windows (W10 64). I have tried the usual method I have used before to stop node servers (is Polyserve node based?).
If i run netstat -an there is nothing listed related to 8080
If I run
netstat -ano | find "LISTENING" | find "8080"
nothing is returned.
Answering my own question, I guess this is just down to the hard caching by the service worker, as a hard reload refreshes as expected.
Lots of potential for confusion with service worker lifecycle!
Edit: "unregister service worker" in devtools did the trick!

Perl can't load SSLeay.dll because LWP::Protocol::https is not installed

For internal messaging the company I work for uses Slack. It allows for a lot of awesome integration with tons of different software and services. I'm making my own bot for sending webhooks to Slack.
I got everything set up and working, I have a Perl script that sends a JSON payload. If I trigger the script manually, everything works flawlessly and my Slack bot sends messages.
However, when the script gets triggered by Finalbuilder (Software for automatic build processing), it it fails.
I get the following response:
501 Can't load 'C:/Strawberry/perl/site/lib/auto/Net/SSLeay/SSLeay.dll' for module Net::SSLeay: load_file:The specified module could not be found (LWP::Protocol::https not installed)
So I figured I needed to install the "LWP::Protocol::https" module. I just opened my cpan client and wrote install LWP::Protocol::https
Still get the error after installing the module.
I wrote test LWP::Protocol:https, which gave the following response:
Running test for module 'LWP::Protocol::https'
Running make for M/MS/MSCHILLI/LWP-Protocol-https-6.06.tar.gz
Checksum for C:\Strawberry\cpan\sources\authors\id\M\MS\MSCHILLI\LWP-Protocol-https-6.06.tar.gz ok
Scanning cache C:\Strawberry\cpan\build for sizes
............................................................................DONE
CPAN.pm: Going to build M/MS/MSCHILLI/LWP-Protocol-https-6.06.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for LWP::Protocol::https
Could not read metadata file. Falling back to other methods to determine prerequisites
cp lib/LWP/Protocol/https.pm blib\lib\LWP\Protocol\https.pm
MSCHILLI/LWP-Protocol-https-6.06.tar.gz
C:\Strawberry\c\bin\dmake.EXE -- OK
Running make test
C:\Strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0,'blib\lib', 'blib\arch')" t/*.t
t/apache.t ....... ok
t/https_proxy.t .. 1/56 # creating cert for direct.ssl.access
# creating cert for direct.ssl.access
# creating cert for foo
# creating cert for bar
# creating cert for foo
# creating cert for foo
# creating cert for bar
# creating cert for bar
t/https_proxy.t .. ok
All tests successful.
Files=2, Tests=61, 8 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU)
Result: PASS
MSCHILLI/LWP-Protocol-https-6.06.tar.gz
C:\Strawberry\c\bin\dmake.EXE test -- OK
I can trigger my script with windows CMD, or Finalbuilder. Both will work just fine, but when the Finalbuilder project gets activated through Continua CI, I get the "can't load ssleay.dll" error.
I have no clue what to do now. Does anyone know how I can fix the Perl error?
I got this same error while running scripts from IDE, but not from command line (same issue).
My command line was adding these to the path. (These were not globally defined).
c:\perl\perl\bin;c:\perl\sup\bin;c:\perl\c\bin;
But the IDE didn't have these. So same fix should work for FinalBuilder, it is missing the perl path information.
Have you loaded the header files? I don't know what they are for Windows but in Linux, they're called: libssl-dev and zlib1g-dev
I also had this error for awhile. In my case the solution was quite simple. It turned out that I hadn't restarted the SVN service, so when it ran the post-commit.bat file the PATH environment hadn't been updated to reflect the new paths that had been added during the Perl install.
While I was testing I was running from a new console window which had the correct PATH, but as soon as it ran from the batch file via SVN it broke, with exactly the same error you posted.
Same problem with IDE Eclipse, command line fine but error with IDE.
I check the location:
C:\>perldoc -l LWP::Protocol::https
C:\zailperl\perl\vendor\lib\LWP\Protocol\https.pm
And I add it to Environments variables.
I didn't want to reboot my PC so I add the parent path to the IDE.
Right click on project.
enter image description here

openshift : need to edit httpd.conf to enable or add directive according to my needs but it's not work

i've build my application on localhost and running it without any error. i choose openshift to host my application code but i have a problem to make it works perfectly like on my localhost.
i want to add directive of AllowEncodedSlashes and set it to On in my apache2 configuration file, i have tried to edit the file from ~/php/configuration/etc/conf/httpd.conf and then restart the server using ctl_all restart. but the result are http error code 400 (Bad Request). before i add this directive into httpd.conf the result are http error code 404, i am just not sure if the changes are in effect or not. or apache is bugging?
is there anyone knows howto make this work for me?
See if you can add it into .htaccess file instead of httpd.conf file. Also the best way to troubleshoot these problems would be by reviewing your application logs for errors. All you have to do is run "rhc tail {appName}" from your client machine (where the rhc client tools are installed). That gives you the current log entries.
To get to the entire log, you'll want to ssh onto the gear(s) on which the language framework/cartridge is installed using this FAQ and run: more ~/{cartridgeID}/logs/*.log
where {cartridgeID} is your framework cartridge like nodejs-0.6, or your embedded cartridge logs like mysql-5.1.
I created a feature request for this. See this Trello card and feel free to vote it up.