I have just deployed a version of my Clojure application to Heroku.
I cannot open lein repl using "heroku run":
$ heroku run lein repl
Running lein repl attached to terminal... up, run.6649
Picked up JAVA_TOOL_OPTIONS: -Djava.net.preferIPv4Stack=true -Djava.rmi.server.useCodebaseOnly=true
rlwrap: Could not open master pty: Exec format error
This has worked previously.
Related
Heroku sees my app in the list of apps, but I can't access it with any commands. I constantly getting the error "Couldn't find that app". I tried all these:
heroku run python manage.py migrate --app app-generator
heroku run python manage.py migrate
heroku run python manage.py createsuperuser --app app-generator
Although when I try to run commands for 'heroku apps' in my console, says I have one app called my-api. I followed other similar questions and tried the git remote commands beforehand but still failed. Example:
heroku apps
heroku git:remote -app app-generator
If it's another user's heroku project. Then you need to use "... -a name" where name should be name of the team, not the name of the app. Login to heroku and find the team name from the dropdown.And run commands again.
I have deployed my django-app on heroku with Github.
It is test server so I am using sqlitedb.
But because of the dyno manager, my sqlitedb resets everyday.
So I am going to download only db on heroku.
I tried this command.
heroku git:clone -a APP-NAME
But this clones empty repository.
And when I run $heroku run bash -a APP-NAME command, I got ETIMEOUT error.
Is there any other way to download the source code on heroku?
What you want to do with git is not possible because changes to the database is not versioned.
The command to run bash on Heroku is heroku run bash, not heroku bash run. You may have to specify the app using the -a flag: https://devcenter.heroku.com/articles/heroku-cli-commands#heroku-run
I have solved with downloading the application slug.
If you have not used git to deploy your application, or using heroku git:clone has only created an empty repository, you can download the slug that was build when you application was last deployed.
First, install the heroku-slugs CLI plugin with heroku plugins:install heroku-slugs,
then run:
heroku slugs:download -a APP_NAME
This will download and compress your slug into a directory with the same name as your application.
I have a django app that is deployed on aws elastic beanstalk when I want to deploy I need to run the migrate, and the collectstatic script.
I have created 01_build.config in .ebextensions directory and this is its content
commands:
migrate:
command: "python manage.py migrate"
ignoreErrors: true
collectstatic:
command: "python manage.py collectstatic --no-input"
ignoreErrors: true
but still, it is not running these scripts.
Sounds like you want to run these scripts after the app has been set up, in which case you need to use the key container_commands rather than commands. From the docs:
The commands run before the application and web server are set up and the application version file is extracted.
and
Container commands run after the application and web server have been set up and the application version archive has been extracted, but before the application version is deployed. Non-container commands and other customization operations are performed prior to the application source code being extracted.
I'm running a Django application on my Amazon Linux instance using the below command:
python manage.py runserver ec2-instance-ip.us-east-2.compute.amazonaws.com:8000
I want the application to be running even after I quit the shell. How do I run this web server even after quitting the shell on Amazon Linux?
I tried using the & as shown below, but it didn't work.
python manage.py runserver ec2-instance-ip.us-east-2.compute.amazonaws.com:8000 &
Running python manage.py ... is how you run in development, but it's not how you run on a web server. You need to deploy your application.
Take a look at Apache and mod_wsgi.
Install screen with below command
Screen is basically a tool which runs the process always, even we exit.
sudo apt-get update
sudo apt-get install screen
For details you can see: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-screen-on-an-ubuntu-cloud-server
Create a screen for you command, so your command can run as a daemon.
screen -S <processName> //Process name could be any random name for your process.
To enter inside screen.
screen -r <processName>
Now you are inside screen and can run your command here.
python manage.py runserver ec2-instance-ip.us-east-2.compute.amazonaws.com:8000
Now exit screen: ctrl+a and then d
You can create multiple screens as many you want and can any time list them by command:
screen -ls
!important: this is not recommended for Production server.
Look this to run Python app on production server: https://docs.djangoproject.com/en/2.0/howto/deployment/
I am trying to download/install/run clojure/lein and facing some initial problems. I am using cygwin on windows-7.
After downloading the latest clojure (1.8.0), the following step works fine:
java -cp clojure-1.8.0.jar clojure.main
Now I installed lein using the following steps (thanks to stackoverflow/18711805 for help):
download lein script into ~/bin , set filetype=unix
install wget and deps (see stackoverflow/18711805)
setenv HTTP_CLIENT "wget --no-check-certificate -O"
lein self-install
Now when I run "lein repl", I find that lein has downloaded another clojure version (1.7.0) and using that.
So, how can I ask lein to use my version of clojure (ie 1.8.0) and not the 1.7.0 ? Are there any extra environment variables to be set before the lein run?
Also, where does lein install its extra downloads, and how do I clean up that area?
"lein upgrade" did the trick, I got the hint from stackoverflow/24094597. Now when I run lein again I can see 1.8.0 (not my own install, but lein has installed this new version). But since I installed lein just a few minutes ago from scratch anyway, I am not sure why it did not install the latest version in the first place.