Error when updating Heroku CLI: write lock exists: update - heroku

I am trying to update the Heroku CLI, however, without success.
Current version of Heroku CLI is
heroku-cli/6.15.5-1f03166 (win32-x64) node-v9.3.0
When running
heroku update
I get the following error
C:\>heroku update
CLI is updating... !
! 'ELOCK': write lock exists: update
I didnt' find any solution to this problem so far as I am hesitating to just uninstall and re-install the Heroku CLI (all my configs are lost then).

I solved this problem by uninstalling heroku and installing via command line:
npm install -g heroku
So I got the most current version.

Updating heroku worked for me:
npm update -g heroku

Not sure what the cause of this was but restarting solved the issue for me. Good luck!
11:53:26 | ~ : heroku update
heroku-cli: Updating CLI from 6.15.26-5726b6f to 6.15.30-e7b41cd...
done
Updating plugins, node version changed to 9.7.1... done
heroku-cli: Updating plugins... done

I had the same problem and I solved removing this file:
/Users/YOUR_USER/Library/Caches/heroku/update.lock
I use mac, but I guess you will have same file in a similar location

I had the same problem on the Mac - solved it by running htop, filtering by heroku and killing all processes.
TLDR; kill running Heroku processes

I also had the same problem and solved it by removing error.log from the following directory in Windows 10: C:\Users\Behzad\.heroku\error.log

Related

heroku - Item could not be updated:

I'm trying to add / modify Config Var, when I try to save the change I get a message:
Item could not be updated:
Unknown Error. Please contact support.
Any ideas on what may be wrong?
The below command solved my issue. Hope it works for others too.
Using Heroku CLI:
heroku config:set DB_PASSWORD=secret -a [heroku-app-name]
Bonus Points:
If Heroku CLI is not installed, you could use NPM to install it easily in [windows] system.
npm install -g heroku
heroku login
Try to update in incognito mode or in different browser. It worked for me.

Laravel error - Class setEventDispatcher does not exist

Short version
I'm getting this error, when I run php artisan serve and visit my home page:
ReflectionException (-1)
Class setEventDispatcher does not exist
Details
Laravel version: 5.6.39
Environment: local
OS: macOS Mojave 10.14.2
It started, when I got an error using npm (in another project), so I reinstalled Node (this way).
After doing that, then this project (in question) couldn't be started. I was getting this error, when running php artisan serve:
dyld: Library not loaded: /usr/local/lib/libpng16.16.dylib with anything php related
Referenced from: /usr/local/bin/php
Reason: image not found
That error was resolved by updating and upgrading brew.
Then I was capable of starting the project (php artisan serve). But when I visit the home page, this error was shown:
ReflectionException (-1)
Class setEventDispatcher does not exist
If I follow the stack trace, then I can see that it was this line (from my homeController) that triggered the error:
if( ! Auth::check() ){
return view( 'pages.home' );
}
If I commented that out, then the same error occured from another place, where the Auth-module was being used.
Here's the stack trace:
Does anyone know how to resolve this? I can't find any promising results on Google, - and I have no idea why this happens... :-/
Addition1
I tried composer clear-cache and deleting the vendor-folder, and then doing a composer install and the problem still occured.
I also checked my Service Providers, as Marcus suggested, - but I don't really know what to look for in there. It all looks pretty regular (no fancy if-statements or anything).
Addition2
I realized, that I couldn't connect to my database using Sequel Pro. And it was because Brew had updated my MySQL-version from 5.5 to 8.0.
That was resolved by doing something along these lines (I did a bunch of stuff, so I might be missing a coulple of steps):
brew unlink mysql
brew install mysql#5.7
brew switch mysql 5.7.21
brew link mysql
and I could then verify the version with mysql --version. I also had some permission issues with that MySQL-version-change, but I'm emitting that, so this doesn't get too long.
Addition3
I tried disabling the Laravel Debugbar (by deleting it from composer.json, deleting composer.lock and vendor and then running composer install). And that fixed it!! ... But!
When I later tried to install Barryvdh's IDE Helper, then the exact same error came back!?
I performed these three steps, to install the IDE Helper (and re-introduce the error):
Run this command from the root of my directory: curl https://gist.githubusercontent.com/barryvdh/5227822/raw/4be028a27c4ec782965bb8f2fdcb4c08c71a441d/_ide_helper.php -o _ide_helper.php
Add these lines to app/Provider/AppServiceProvider.php:
...
if ($this->app->environment() !== 'production') {
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
}
Run this command: composer require --dev barryvdh/laravel-ide-helper
So I'm back at this error:
ReflectionException (-1)
Class setEventDispatcher does not exist
... The stack trace is identical to the one shown previously (sprung from Container.php).
Tried every solution, none of them worked.
Finally, i realised that when trying to upgrade php to 7.3.3 it was infact a network error that caused the fail. Read the logs, tried again, restarted valet and tried again.
It works now.
Upgrading to 7.3.3 was the solution indeed.
Thank you!
So this is what usually fixes it for me
Reinstall composer dependencies by removing vendor folder and composer.lock. Then run composer clear-cache and then composer install (this is usually the problem)
Check that all service providers are imported correctly in app.php under directory config
Make sure that your service providers are not importing something that does not exist, for example if you register a service provider in production but is only installed as dev:
if (env('APP_DEBUG')) {
$app->register(Barryvdh\Debugbar\LumenServiceProvider::class);
}
If you use valet, I solved it running
valet restart and all works fine.
cheers!
The fix for me was to update PHP to 7.3.3 and then restart valet. Apparently this was a bug with php 7.3
https://github.com/laravel/framework/issues/27052
Hope this helps
I got some idea... I've just run into this problem after reconfiguring my apache virtual host ports, so I restarted apache/httpd again, and the problem went away. Might it be related with the server environment?
I am facing the same issue in mac book pro. My system configuration is PHP 7.3, MySQl and I use SQL Pro. I have implemented all the above methods but nothing gets worked.
The issue is still a mystery for me but for temporary I have solved this issue using
artisan command as bellow.
php artisan serve
Its Allow me to run the project on http://localhost:8000
Hope this can help to solve this issue.
Try to restart PHP. When I reboot my Mac, then this happens. After restarting PHP everything starts to work.
sudo brew services restart nginx

Laravel Valet - This Site Can't Be Reached

I have successfully followed the Setup a Mac Dev Machine until this tutorial: https://laracasts.com/series/setup-a-mac-dev-machine-from-scratch/episodes/10?autoplay=true
The problem is that when I go to SITENAME.dev, nothing shows up. Instead, I get the following message:
This site can’t be reached
test2.dev refused to connect. Did you mean http://test2.de/? Search Google for test2 dev ERR_CONNECTION_REFUSED
I've tried this both for a laravel install (using the laravel installer) and a wordpress install. Neither one works.
Any idea why it is not working. I have followed the course step-by-step as well as the comments. For instance, I modified the .zshrc file as follows based on the course and comments:
export PATH=$HOME/bin:/usr/local/bin:$HOME/.composer/vendor/bin:$PATH
And, in case it is relevant, I am on Mac Sierra (freshly updated).
In short, where Jeffrey is able to get a home page of laravel, I get an error.
Any idea how to fix this?
Thanks.
Go to your site folder and execute the following commands:
cd your_project
composer global update
valet uninstall
rm -rf ~/.valet
rm -rf ~/.config/valet
valet install
valet link
valet open
It fixed this issue for me, and particularly after PHP upgrades.
Mac os mojave - version 10.14,
cd in your-project-folder-name and run
valet secure your-project-folder-name
Solution:
composer global update
brew upgrade nginx
cd your_project
valet start
For more details read this blog
https://medium.com/#panjeh/valet-this-site-cant-be-reached-err-connection-refused-ad424ea1e343
Have you actually started the valet service? Head over to the directory that you ran
$valet park
in, I'm assuming it's where you've also placed your project and type:
$valet start
into the terminal. That works for me.
Be sure you're over http://app.test and not https://app.test
Laravel Valet uses Not secure http as default.
By the way if you want to secure your app then use
valet secure YOURAPPNAME
Deleting the file (sudo rm /etc/resolver/dev) will clear this issue up.
IF valet is trying to open a HTTPS (SSL connection) type command line in your terminal
valet secure

Heroku push fails: Error: `libsass` bindings not found. Try reinstalling `node-sass`?

I'm trying to push a new app to Heroku but I'm getting this libsass error:
Error: ´libsass´ bindings not found. Try reinstalling ´node-sass´?
I've looked all around but the solutions I've found are for a local environment, but I have no problem on my machine.
One of the things I found was to use node 0.12.0, I was on 0.10, but Heroku is already on 0.12.0
What else can I do on Heroku?
I assume you have node-sass in your package.json if so setting NODE_MODULES_CACHE to false may help
You can do it on heroku.com or in CLI:
heroku config:set NODE_MODULES_CACHE=false

Heroku CLI error - "cli.Spinner is not a function"

I am getting the following message when I try to load a rails console in heroku:
→ heroku run rails console -a myapp
▸ cli.Spinner is not a function
Output from checking heroku version:
→ heroku --version
heroku-toolbelt/3.42.47 (x86_64-darwin10.8.0) ruby/1.9.3
heroku-cli/4.29.3-7996295 (amd64-darwin) go1.6
=== Installed Plugins
heroku-apps#1.7.3
heroku-cli-addons#0.3.0
heroku-fork#4.1.2
heroku-git#2.4.5
heroku-local#5.0.1
heroku-orgs#1.0.5
heroku-pg-extras
heroku-pipelines#1.1.3
heroku-run#3.1.1
heroku-spaces#2.1.2
heroku-status#2.1.2
It has worked for me in the past but now I get this error. I've reinstalled the Heroku CLI using both the Heroku provided package and with brew install heroku. I am able to use the CLI for logs with heroku logs -a myapp. Any thoughts about what might be the issue?
You can fix this by removing your ~/.heroku directory and running heroku update. If you have manually installed plugins you will have to manually reinstall them.
This solution actually works in linux. A friend next to me have the issue, and we just remove the ~/.heroku and run heroku again, because all the files were deleted is just install all the updates.

Resources