Airflow command not found for all commands - airflow

I am getting an error when attempting to create a user. I have Airflow running on Unbunto Virtualbox and I am SSH from Visual Studio Code. As a sanity test, I ran airflow scheduler and got a "command not found" again. Attempted to run the command with sudo as well.

Turns out if you are working in the sandbox and close out virtual studio code you need to get back in the sandbox and then run the commands.
>source sandbox/bin/activate
>airflow db init
>airflowebserver

Related

Firebase CLI usage blocked [duplicate]

I have installed the firebase tools, however whenever I try to initialize it in my rootfolder, using the terminal from Vscode, I receive the following error. Why is that?
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Install firebase globally
npm i -g firebase
and then,
firebase login
firebase init
TLDR: Just delete your firebase.ps1 file and try again
I would not recommend bypassing the execution policy on PowerShell, as it makes your system more vulnerable to malicious scripts.
Instead, simply delete the firebase.ps1 file at the location indicated by the error message and try running the command again.
Note: in case the above doesn't work, you might need to clear your npm cache by running npm cache clean --force.
Source: https://stackoverflow.com/a/54776674/1536286
Run the following at the terminal in VS Code (make sure the app is run with the option Running as Administrator as suggested by #MaylorTaylor)
Set-ExecutionPolicy RemoteSigned
Then run the script in that same console.
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
This worked for me
Open Windows Power Shell as Administrator and then run the below command to change Execution Policy setting to RemoteSigned
Set-ExecutionPolicy RemoteSigned
Now change directory to your project folder and run the following
firebase login
firebase init
Close cmd and powershell and VS Code.
Then right click on VS code---RunAs Administrator
and in the VS Code Terminal run the following command:
Set-ExecutionPolicy Unrestricted
Then in the same VS Code cmd run:
firebase login
firebase init
This should solve your problem.
Windows now comes with an extra layer of security to protect your OS environment from random scripts running in the background without admin privilege's.
Most Random Scripts(From browser engines on unverified sites and applications) are also bad for your OS,unless you are running them yourself as an admin or as a developer,provided you know what you are doing.
Firebase scripts are pretty safe.
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Run this in your current working directory, i.e where Firebase is initialized and run this command, worked for me.
If using VScode, installing the PowerShell extension by Microsoft will solve this issue.
enter link description here
Instead of setting Execution Policy. I ran windows terminal as administrator instead of VS code terminal and execute command without an issue.
Simply in VScode switch from PowerShell to cmd
and type this command.
firebase login
And you will be redirected to your browser to allow Firebase CLI to access the account connected to your firebase project and then type this command.
firebase init
That should work
In cmd it works
firebase login
firebase init
Select project
The solution for me: is that i am using Windows 11 and i used to use Windows Power Shell instead of Command Prompt
In case want to use Windows Power Shell you have to run this cmd first:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

AWS CodeDeploy deployment failed at event ApplicationStop

I am trying to set up auto-deployment from GitHub to AWS, using EC2.
I set Role with CodeDeployServiceRole auto policy
After following the Tutorial: Use AWS CodeDeploy to Deploy an Application from GitHub, my deployment fails at the ApplicationStop event, after trying for couple of minutes with error code HEALTH_CONSTRAINT. I'm not sure how to troubleshoot the issue/where to look.
These are few hints of how you can navigate your way
Logs as mentioned in comments in /var/log/aws/codedeploy-agent
As AWS support recommend you can add for one time --ignore-application-stop-failures so it will skip that step in case it failed last time and see، because the application stop Lifecycle event uses the appspec file from the last successful build so if that one is corrupted somehow this step will fail in the following builds
(not recommended) you can delete the file, that CodeDeploy uses to keep track of the previous successful deployment in the following path /opt/codedeploy-agent/deployment-root/deployment-instructions/
Check the latest logs at /var/log/aws/codedeploy-agent
If your deployment is failing at ApplicationStop event, then most likely the issue is your EC2 instance does not have the necessary permissions to get the artifacts from S3 bucket.
Your EC2 instance must have an IAM role attached which gives it enough permissions to download the artifacts from S3 bucket
Your EC2 must be started with an IAM role. So you may have to reboot your instance after attaching the role to it.
From your configuration, looks like you have provided permissions to CodeDeploy to perform certain actions on your EC2. You may want to check if your EC2 also has the necessary permissions to download packages from S3 bucket.
Another reason for this error is that the CodeDeploy Service is not running on your machine. On Windows machines, Code Deploy Service terminates sometimes, and as a result, the deployment is not downloaded on the machine. Nothing appears in the logs either.
Run services.msc and check the code deploy agent service. If it is not running, start it and retry the deployment.
I had the same issue and solved it by solving codedeploy-agent that wasn't working on my EC2 instance.
sudo service {httpd/apache2} status
Something might have cause the agent not to run properly
Hope it will help
I had the same issue. You also need to make sure that your EC2 instance has code-deploy-agent installed.
Follow the below aws guide. It worked for me.
AWS guide to install code agent in linux server
Check if the codedeploy-agent is running.
sudo service codedeploy-agent status
if not running then use below command to run
sudo service codedeploy-agent start
If you are using aws Windows server, check the logs at :
C:\ProgramData\Amazon\CodeDeploy\log\codedeploy-agent-log.txt
AWS Docs
To check if the codedeployagent running in windows. Open powersheel command window and run these command.
powershell.exe -Command Get-Service -Name codedeployagent
Better to stop and start again.
powershell.exe -Command Stop-Service -Name codedeployagent
powershell.exe -Command Start-Service -Name codedeployagent
Or Restarting also works
powershell.exe -Command Restart-Service -Name codedeployagent
For me I had to uninstall the codedeployagent on windows by uninstalling and deleting old files of codedeploy.
Run the below command in powershell one by one to uninstall.
wmic
product where name="CodeDeploy Host Agent" call uninstall /nointeractive
exit
After this delete the codedeploy folder at this location.
C:\ProgramData/Amazon/CodeDeploy/
Now install codedeployagent on windows.
Start the codedeployagent again.
powershell.exe -Command Start-Service -Name codedeployagent

How to know whether I installed Apache Airflow successfully?

My OS is Mac OS. I followed airflow official installation guide to install. But when I test: airflow test tutorial print_date 2015-06-01 from airflow testing it doesn't print any output. The result is here.. I wonder did I install it successfully? I've run other commands on the official airflow testing page. They report no error.
So far I see only WARNING output, it doesn't mean that airflow isn't running nor installed improperly. You'd have an easier time testing your install with airflow list_dags and you probably must run airflow initdb before most of the commands (and look at the airflow.cfg file).

Meteor mup setup don't work

I would like use Meteor Up for deploy my app on my Digital Ocean server.
I've init with mup init and config my mup.js. When i run mup setup, it just open my mup.js on my editor ..
Do you have any idea why the file is opened and not config my server ?
THank you !
Problem is the mup.js has an association with a program, instead of typing mup use
mup.cmd
eg
mup.cmd setup
mup.cmd deploy
I had a similar problem where my command line would not run the mup commands. I finally found a solution where I used windows PowerShell.
Just click the Windows Start button and search PowerShell, run it and use the commands just like you would in a regular command prompt.

update-database command fails in code first migrations

I am trying to follow the tutorial http://www.asp.net/web-forms/tutorials/data-access/model-binding/retrieving-data.
When I am trying the update-database command in PM console, i get the following error.
Cannot attach the file 'D:\ASPdotNet\ContosoUniversity\ContosoUniversity\App_Data\ContosoUniversity.Models.SchoolContext.mdf' as database 'ContosoUniversity.Models.SchoolContext'.
Just ran into the exact same issue. To resolve I used,
Open the "Developer Command Propmpt for VisualStudio" under your start/programs menu and
run the following commands:
sqllocaldb.exe stop v11.0
sqllocaldb.exe delete v11.0
Rebuild the solution and try to update the database again.

Resources