Apache Airflow Webserver Log In Failed - airflow

I realise this is a duplicate of thousands of posts across the internet, but I have only found solutions for version <2.0, and those solutions do not apply to >2.0.
Basically, I have installed Apache Airflow on an Ubuntu system. Everything installed fine, as far as I see from command line, and I first create a user:
airflow users create --role Admin --username admin --email admin --firstname admin --lastname admin --password admin
And then from here I start up the webserver and scheduler:
airflow webserver -p 8585 > ${AIRFLOW_HOME}/logs/webserver.log 2>&1 &
airflow scheduler > ${AIRFLOW_HOME}/logs/scheduler.log 2>&1 &
And then I can access the webserver via "http://<HOST_IP>:8585" - This loads to the log in screen no problem.
But when I try to log in using the user details initially created, or by using my OS user (on the off-chance), it just fails with "Invalid login." I've tried restarting the webserver and Ubuntu to no avail.
I've used Airflow <2.0 in the past and never even created a user and just logged in straight away, so I'm really blank on what the answer is here. I absolutely hate Airflow and am loosing my mind just trying to log in, so a massive thanks for any help!

Okay, sooo I managed to get it running with login potential. I think I've discovered the issue, at least, and can re-create the problem, though frankly I have ZERO idea why it IS an issue (software coded issue??).
Basically, I had to run the install processes above as ROOT user. I was trying to run it as my admin user, but it kept resulting in the log in issue above - I did notice however that all install guides appear to use the ROOT user, so I gave it a shot in case it was as annoyingly simple as that, and VOILA!! First time logged in.
I did stop the software running at this point, quickly restart it as my admin user and immediately got the same login issue. There's something odd going on here, and I don't know what it is, but when in doubt: Try ROOT.

Solution- Create user again
I ran into the same issue. I had created an Admin user using the same command and after some changes to my config file, I ran airflow db init. After this when I started the webserver, I tried logging in with my admin credentials, but no luck. When I checked the logs, it showed me -
WARNING - No user yet created, use flask fab command to do it.
So I created the user again and it worked.

Related

How do I launch The Littlest JupyterHub as admin?

I'm trying to get up to speed with The Littlest JupyterHub.
I've followed the documentation and added myself as an admin with the following.
Updated my config file with my key and cert then launched the hub with jupyterhub -f ./jupyterhub_config.py.
I then get to this screen:
My issue is that I dont see the control panel described here:
Can anyone suggest where I've gone wrong?

Compute Engine (wordpress website) crashed, wrong SSL command and space issue

I have been running my wordpress website on Google cloud the last 12 months with no issue. VM instance - using SSH on Apache server.
My website went down yesterday and I could not access it through wordpress. I am trying to do everything myself and I am a beginner when it comes to learning the back end functionality.
So I went into my google cloud and ssl’d onto my server. I though it might be an outdated certificate and I entered an incorrect command (see photo attached - I didn't include my actual email and domain name stupidly, copied and pasted it from the internet). And now I am getting an error saying mysql is not working. I think there may be a space issue too.
When I try go to my website I get and
Error establishing a database connection
So my questions are - did I mess up anything from entering the wrong code in SSL? And how do I solve the space issue and get my site running again.
I just tried to updated my server size through google console - but gettting the error in the screenshot that it can't connect.
Enter the following content into the script and save it. Ensure to replace the ‘Domain’ placeholder with your actual domain name, and the ‘Email-Address’ placeholder with your email address.
For Apache:
#!/bin/bash
sudo /opt/bitnami/ctlscript.sh stop apache
sudo /opt/bitnami/letsencrypt/lego --tls --email="EMAIL-ADDRESS" --domains="DOMAIN" --path="/opt/bitnami/letsencrypt" renew --days 90
sudo /opt/bitnami/ctlscript.sh start apache
Please go through this link for more information.
In some cases, the certificates aren’t properly uploaded to the server, so the server is still using the dummy ones. Perform the following checks:
Check that the certificate files are located as below for Apache:
Certificate: /opt/bitnami/apache2/conf/server.crt
Key: /opt/bitnami/apache2/conf/server.key
CA: /opt/bitnami/apache2/conf/server-ca.crt.
Please follow this link for connection refused error.
If you still face issues after following the above, do mention the details about the error to narrow down the issue.

user not able to launch firefox from unix- X11 error

Using MobaXTerm on RedHat, I am able to launch Firefox from my user profile and access browser GUI. However if I sudo to root and try to launch firefox I get an error:
X11 connection rejected because of wrong authentication.
I want to access CUPS in the browser with root access so that I can administer printers from GUI (not trying to browse as root!). I am aware that all of the administration can be done from command line, but sometimes the GUI is just easier.
How can I resolve this error so that I may launch firefox as root?
Under my user profile where firefox is working, run:
xauth list
The output will be something like:
servername/unix:11 MIT-MAGIC-COOKIE-1 256d99dc3f0f7acdf90190a2710d7042
servername/unix:11 MIT-MAGIC-COOKIE-2 61f888d3342b65f4f05f02fcb708f3d8
servername/unix:11 MIT-MAGIC-COOKIE-3 656d49dc3f0f7acdf96190a2710d7042
Copy the list of these entries.
Then sudo to root and run xauth list again. You will find a different list of cookies.
To repair the trouble, add each of the cookie under my user profile to root's profile via xauth add command:
xauth add servername/unix:11 MIT-MAGIC-COOKIE-1 256d99dc3f0f7acdf90190a2710d7042
As far as I know each cookie needs to be added one at a time, but someone jump in if they know of a bulk method.
After adding the cookies to root profile, Firefox can be launched from root.
Thanks to Byron for the help on this.

SVN credentials from command line..?

I've never used SVN except to push updates to my WordPress plugins. All of the plugins I've ever worked with are under the same account at WordPress.org. I honestly don't remember how I setup SVN credentials the very first time I ever did one, but ever since then, I've never had to enter them again. Any new plugin I create just works for me.
Now, though, I've got a new plugin that I created on a different WordPress.org account. I was able to check out the new plugin repo from WordPress, but then when I try to check in my plugin files I get an authentication error.
I'm assuming this is because somewhere it has my primary account's credentials saved and that's what it's trying to use here, which won't work of course. It's never asking me for credentials of any kind.
I tried to specify different credentials at the command line like this...
svn ci -m "Adds files for 1.0.0 release" --username myusername --password mypassword
The thing is, my password has some )'s in it, and when I try that command I get this error back:
bash: syntax error near unexpected token `)'
So at this point I'm stuck and I don't know what to do. Any info on this would be greatly appreciated. Thanks!
UPDATE: I changed my password to something more basic, and now when I use the --username and --password options it works fine. So I guess one thing that would help is to figure out how I can use passwords with special characters in them from the command line without getting a syntax error..??
You can omit the --password option. Subversion asks you then for the password.
This is also saver as your password is not stored in cleartext in your history

How can I check Drupal log files?

How can I check Drupal log files?
I'm using Ubuntu 10.10 + Apache2 + PHP 5.33 + MySQL and Drupal 7.
To view entries in Drupal's own internal log system (the watchdog database table), go to http://example.com/admin/reports/dblog. These can include Drupal-specific errors as well as general PHP or MySQL errors that have been thrown.
Use the watchdog() function to add an entry to this log from your own custom module.
When Drupal bootstraps it uses the PHP function set_error_handler() to set its own error handler for PHP errors. Therefore, whenever a PHP error occurs within Drupal it will be logged through the watchdog() call at admin/reports/dblog. If you look for PHP fatal errors, for example, in /var/log/apache/error.log and don't see them, this is why. Other errors, e.g. Apache errors, should still be logged in /var/log, or wherever you have it configured to log to.
If you love the command line, you can also do this using drush with the watchdog show command:
drush ws
More information about this command available here:
https://drushcommands.com/drush-7x/watchdog/watchdog-show/
Make sure drush is installed (you may also need to make sure the dblog module is enabled) and use:
drush watchdog-show --tail
Available in drush v8 and below.
This will give you a live look at the logs from your console.
We came across many situation where we need to check error and error logs to figure out issue we are facing we can check by possibly following method:
1.) On blank screen
Some time we got nothing but blank screen instead of our site or message written The website encountered an unexpected error. Please try again later , so we can Print Errors to the Screen
by adding
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
in index.php at top.;
2.) We should enable optional core module for Database Logging at /admin/build/modules, and then we can check logs your_domain_name/admin/reports/dblog
3.) We can use drush command also to check logs
drush watchdog-show it will show recent ten message
or if we want to continue showing logs with more information we can user
drush watchdog-show --tail --full.
4.) Also we can enable core Syslog module this module logs events of operating system of any web server.
We can use drush command also to check logs
drush watchdog-show it will show recent 10 messages.
or if we want to continue showing logs with more information we can user
drush watchdog-show --tail --full.
MAMP/logs/php_error.log
Above all given option does not work go to the MAMP/logs/ check all type of log-like.
mysql_error.log
nginx_error.log
apache_error.log
For drupal 9, you can access to your logs with drush , here some commands:
watchdog:delete (wd-del, wd-delete, wd) Delete watchdog log records.
watchdog:list (wd-list) Interactively filter the watchdog message listing.
watchdog:show (wd-show, ws) Show watchdog messages.
watchdog:show-one (wd-one) Show one log record by ID.
watchdog:tail (wd-tail, wt) Tail watchdog messages.
One more thing if your are not fan with commands, please in the Administrative menu, go to Reports > Recent log messages. On this page is a list of recent log messages which you can filter by type and severity.
but if your are professional you can configure ELK that's will give you all
In Drupal, you can check the log files through the Drupal admin interface or by accessing the server files directly. Here are the steps for each method:
Through the Drupal admin interface:
Log in to your Drupal site as an administrator.
Go to Reports > Recent log messages.
This will show you a list of recent log entries, filtered by severity level and type.
By accessing server files:
Connect to your server via FTP or SFTP.
Locate your Drupal installation directory.
Look for the "logs" directory or server level /var/log.
Open the log files you want to view.
Note: The location of the log files may vary depending on your Drupal installation and server configuration. You may need to consult your hosting provider or server administrator for help finding the logs.

Resources