Laravel 8 deploy to heroku failed on Pusher.php ($auth_key) - laravel-8

remote: Generating optimized autoload files
remote: > Illuminate\Foundation\ComposerScripts::postAutoloadDump
remote: > #php artisan package:discover --ansi
remote:
remote: In Pusher.php line 63:
remote:
remote: Pusher\Pusher::__construct(): Argument #1 ($auth_key) must be of type strin
remote: g, null given, called in /tmp/build_fb8ecd51/vendor/laravel/framework/src/I
remote: lluminate/Broadcasting/BroadcastManager.php on line 218
Here is my .env pusher configuration. I have "pusher/pusher-php-server": "^7.0" installed and tried change it to other version but still not working.
PUSHER_APP_ID=1368435
PUSHER_APP_KEY=fe949b1c86852b82bc6e
PUSHER_APP_SECRET=117bc32cf87c7d0b37f1
PUSHER_APP_CLUSTER=ap1

you need to go to your app on heroku -> settings->Reveal Config Vars->
then add this with key and value
PUSHER_APP_ID=1368435
PUSHER_APP_KEY=fe949b1c86852b82bc6e
PUSHER_APP_SECRET=117bc32cf87c7d0b37f1
PUSHER_APP_CLUSTER=ap1
hopefully that is help you

Related

Error installing prawn-gmagick within Heroku stack 20 due to invalid wand/magick_wand.h path

Here is the error I'm getting when trying to deploy to Heroku using the most recent stack (20)
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/tmp/build_20bfe735/vendor/bundle/ruby/2.6.0/gems/prawn-gmagick-0.0.9/ext/image
/tmp/build_20bfe735/vendor/ruby-2.6.6/bin/ruby -I
/tmp/build_20bfe735/vendor/ruby-2.6.6/lib/ruby/2.6.0 -r
./siteconf20210328-11397-1gaqmyj.rb extconf.rb
creating Makefile
current directory:
/tmp/build_20bfe735/vendor/bundle/ruby/2.6.0/gems/prawn-gmagick-0.0.9/ext/image
make "DESTDIR=" clean
current directory:
/tmp/build_20bfe735/vendor/bundle/ruby/2.6.0/gems/prawn-gmagick-0.0.9/ext/image
make "DESTDIR="
compiling image.c
image.c:3:10: fatal error: wand/magick_wand.h: No such file or directory
3 | #include <wand/magick_wand.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:245: image.o] Error 1
make failed, exit code 2
Same error after I tried this buildpack with graphicsmagick
https://elements.heroku.com/buildpacks/bogini/heroku-buildpack-graphicsmagick
So, after playing a bit I made it work by adding 3 additional dependencies to the Aptfile in the example above
libgraphicsmagick++3
libgraphicsmagick++1-dev
libgraphicsmagick-q16-3
So the final Aptfile looks like this
debhelper
g++
gsfonts
libbz2-dev
libexif-dev
libfreetype6-dev
libice-dev
libjbig-dev
libjpeg-dev
liblcms2-dev
libltdl-dev
libpng-dev
libsm-dev
libtiff-dev
libwebp-dev
libwmf-dev
libx11-dev
libxext-dev
libxml2-dev
perl
sharutils
transfig
x11proto-core-dev
zlib1g-dev
libgraphicsmagick++3
libgraphicsmagick++1-dev
libgraphicsmagick-q16-3
And my buildpacks setup:
1. https://github.com/heroku/heroku-buildpack-apt
2. https://github.com/bogini/heroku-buildpack-graphicsmagick
3. heroku/ruby
Do you guys see any problem with any of those dependencies and setup?

Tensorflow Apps No Longer Deploying To Heroku: Slug Size Too Large

I have a number of heroku applications that I've been able to update pretty seamlessly until recently. They make use of tensorflow and streamlit, and all give off similar messages on deployment:
-----> Compressing...
remote: ! Compiled slug size: 560.2M is too large (max is 500M).
remote: ! See: http://devcenter.heroku.com/articles/slug-size
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 5c0f686a86459f6e81627ce14770f7494f4bd244
remote: !
remote: ! We have detected that you have triggered a build from source code with version 5c0f686a86459f6e81627ce14770f7494f4bd244
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to dry-caverns-08193.
remote:
To https://git.heroku.com/dry-caverns-08193.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/dry-caverns-08193.git'
I know it says the slug size is too large, but they have run previously with the same message, so I'm not sure that's what the issue is.
Here's my file setup:
app.py
Procfile
requirements.txt
setup.sh
my_model/
-- assets/
-- variables/
-- variables.index
-- variables.data-00000-of-000001
saved_model.pb
requirements.txt reads as follows:
tensorflow==2.*
streamlit==0.67.0
requests==2.24.0
requests-oauthlib==1.3.0
setup.sh reads as follows:
mkdir -p ~/.streamlit/
echo "\
[general]\n\
email = \"myemail#gmail.com\"\n\
" > ~/.streamlit/credentials.toml
echo "\
[server]\n\
headless = true\n\
enableCORS=false\n\
port = $PORT\n\
" > ~/.streamlit/config.toml
My immediate suspicion is that tensorflow is causing the slug size to be too large -- but again it worked w/ tensorflow previously, so I"m not sure why it would not work now.
Is there anything else it could be?
EDIT:
After looking at this question: Heroku: If you are developing on a branch and deploying via git you must run: I tried git push heroku master:main, but that did not work with the following displaying in the logs:
Push rejected to dry-caverns-08193.
remote:
To https://git.heroku.com/dry-caverns-08193.git
! [remote rejected] master -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/dry-caverns-08193.git'
If you are using the free dyno:
Make a change in the requirements.txt:
tensorflow-cpu
instead of
tensorflow
This would reduce your slug size considerably
Additionally, your issue may also be dependent on model weight size
Another Tip:
Use a `.slugignore' file if you are directly pulling the code from GitHub so that you can ignore anything like README to GitHub Actions to notebooks from being added to your Dyno
I haven't thoroughly tested this, but just placing it here in case it helps someone.
I have had many apps over the 500MB slug size limit. It warns but doesn't error when I do this. It is possibly because I am not on the free plan, but on a paid plan. So if someone is desperate to get it working, and cannot reduce the slug size below 500MB any other way, it may be a workable solution to go on the lowest paid plan for that app.

How is the correct syntax/call to get the sls-file working - salt

I'm trying to build a reactor sls file, which starts running when an event occurs.
The content of the sls file should be as the following cli commands:
sudo salt minion git.add /srv/salt .
sudo salt minion git.commit /srv/salt test
sudo salt minion git.push /srv/salt origin master identity=/home/autogit/.ssh/id_rsa
If i run the code bellow triggered by the reactor. I get the following error message.
[DEBUG ] Reactor is populating module client cache
[ERROR ] An un-handled exception from the multiprocessing process 'Reactor-9:1' was caught:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/utils/process.py", line 765, in _run
return self._original_run()
File "/usr/lib/python2.7/dist-packages/salt/utils/reactor.py", line 271, in run
self.call_reactions(chunks)
File "/usr/lib/python2.7/dist-packages/salt/utils/reactor.py", line 228, in call_reactions
self.wrap.run(chunk)
File "/usr/lib/python2.7/dist-packages/salt/utils/reactor.py", line 330, in run
self.populate_client_cache(low)
File "/usr/lib/python2.7/dist-packages/salt/utils/reactor.py", line 324, in populate_client_cache
self.reaction_class[reaction_type](self.opts['conf_file'])
KeyError: u'module'
[CRITICAL] Engine 'reactor' could not be started!
I've tried different syntax (old style and new style) but couldn't figure out what the problem is. Always getting an KeyError: u'module' or u'git'.
Also tried it with runner function to run it locally on the master.
git pull:
module.run:
- git.pull:
- cwd: /srv/salt
- remote: git#git.xyz.com:user/sbt.git
- identity: /home/autogit/.ssh/id_rsa
- git.add:
- cwd: /srv/salt
- filename: .
- git.commit:
- cwd: /srv/salt
- remote: git#git.xyz.com:user/sbt.git
- git.push:
- cwd: /srv/salt
- remote: git#git.xyz.com:user/sbt.git
- identity: /home/autogit/.ssh/id_rsa
salt --versions-report
Salt Version:
Salt: 2019.2.0
Dependency Versions:
cffi: Not Installed
cherrypy: unknown
dateutil: 2.6.1
docker-py: Not Installed
gitdb: 2.0.3
gitpython: 2.1.8
ioflo: Not Installed
Jinja2: 2.10
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: 1.0.7
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
python-gnupg: 0.4.1
PyYAML: 3.12
PyZMQ: 16.0.2
RAET: Not Installed
smmap: 2.0.3
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.2.5
System Versions:
dist: Ubuntu 18.04 bionic
locale: UTF-8
machine: x86_64
release: 4.15.0-46-generic
system: Linux
version: Ubuntu 18.04 bionic
Since i'm quite new to Salt, hopefully you can give me a hint what i'm doing wrong:
You didn't provide the master config.
About module.run confusion: add in your settings (minion and maybe to master since I don't know your use-case)
use_superseded:
- module.run
That will enable your syntax, more doc about this here: https://docs.saltstack.com/en/latest/ref/states/all/salt.states.module.html#salt.states.module.run
In general: you are executing execution modules from the place that state modules are allowed only (the term module is heavily overused in salt...)
You didn't provide the full Master config. Reactor requires dedicated config to match events to sls files:
https://docs.saltstack.com/en/latest/ref/configuration/master.html#master-reactor-settings
You can also check the doc I've written some time ago about events and reactors:
https://github.com/kiemlicz/util/wiki/Salt-Events-and-Reactor
Assuming you've configured your events-to-sls-files-matching in master config, your provided sls:
git pull:
module.run:
- git.pull:
- cwd: /srv/salt
- remote: git#git.xyz.com:user/
...
will not work.
Mind that reaction happens on Salt Master thus the reaction sls file need to provide type of reaction (local, runner etc.) since it's no longer 'view of one minion' but possibly of tons of minions!
First create runner reaction type (which delegates to some orchestration sls file which will contain your logic wrapped with (I think) salt.function )
Help yourself with aforementioned github link to my attempt of explaining Reactor.
Refer to official doc as well: https://docs.saltstack.com/en/latest/topics/reactor/index.html

Push to GitLab: ! [remote rejected] master -> master (pre-receive hook declined)

Attempted to push local repository to GitLab and got the following error:
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 220 bytes | 73.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_net.rb:153:in `parse_who': undefined method `start_with?' for nil:NilClass (NoMethodError)
remote: from /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_net.rb:31:in `check_access'
remote: from /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_access.rb:27:in `block in exec'
remote: from /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_metrics.rb:50:in `measure'
remote: from /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_access.rb:26:in `exec'
remote: from hooks/pre-receive:30:in `<main>'
To <my_gitlab_server>:<path_to_repo>
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#<my_gitlab_server>:<path_to_repo>'
Using GitLab Community Edition version 11.4.0 installed on a Linux server and Git Bash version 2.19.1 64-bit for Windows.
I created an empty project in the GitLab UI, cloned this to a local repository and attempted a push from the local repository to this project, for which I have Maintainer status.
The pre-receive hook being called here is the default one placed by GitLab, not the one in the local repository (since it is .sample).
I have been getting the exact same error. So what I have just done is:
Accessed the gitlab server:
cd /opt/gitlab/embedded/service/gitlab-shell/hooks
mv pre-receive pre-receive-old
And I was able to push to my repository.
Why this happened and what exactly the file was blocking, beats me.

Can't install Puppet modules, '302 Found', Win 8.1 64 running Ubuntu trusty 64 in Vagrant 1.8.4

I'm trying to vagrant up successfully, but I always end up with ah SSH non-zero exit status. The real error I'm having is that puppet won't install any modules. It starts by trying to install stdlib, and fails there, and never recovers.
Here is the relevant part of a verbose error log:
==> default: Successfully installed librarian-puppet-2.2.3
==> default: 10 gems installed
==> default: Installing ri documentation for thor-0.19.1...
==> default: Installing ri documentation for librarianp-0.6.3...
==> default: Installing ri documentation for rsync-1.0.9...
==> default: Installing ri documentation for multipart-post-2.0.0...
==> default: Installing ri documentation for faraday-0.9.2...
==> default: Installing ri documentation for faraday_middleware-0.10.0...
==> default: Installing ri documentation for semantic_puppet-0.1.3...
==> default: Installing ri documentation for minitar-0.5.4...
==> default: Installing ri documentation for puppet_forge-2.2.1...
==> default: Installing ri documentation for librarian-puppet-2.2.3...
==> default: Installing RDoc documentation for thor-0.19.1...
==> default: Installing RDoc documentation for librarianp-0.6.3...
==> default: Installing RDoc documentation for rsync-1.0.9...
==> default: Installing RDoc documentation for multipart-post-2.0.0...
==> default: Installing RDoc documentation for faraday-0.9.2...
==> default: Installing RDoc documentation for faraday_middleware-0.10.0...
==> default: Installing RDoc documentation for semantic_puppet-0.1.3...
==> default: Installing RDoc documentation for minitar-0.5.4...
==> default: Installing RDoc documentation for puppet_forge-2.2.1...
==> default: Installing RDoc documentation for librarian-puppet-2.2.3...[0m
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: stdout: Error executing puppet module install. Check that this command succeeds:
puppet module install --version 4.5.1 --target-dir /var/www/my-repository/puppet/.tmp/librarian/cache/source/puppet/forge/forgeapi_puppetlabs_com/puppetlabs-stdlib/4.5.1 --module_repository https://forge.puppetlabs.com --modulepath /var/www/my-repository/puppet/.tmp/librarian/cache/source/puppet/forge/forgeapi_puppetlabs_com/puppetlabs-stdlib/4.5.1 --module_working_dir /var/www/my-repository/puppet/.tmp/librarian/cache/source/puppet/forge/forgeapi_puppetlabs_com/puppetlabs-stdlib/4.5.1 --ignore-dependencies puppetlabs-stdlib
Error:
[1;31mError: Could not execute operation for 'puppetlabs/stdlib'
The server being queried was https://forge.puppetlabs.com
The HTTP response we received was '302 Found'
Check the author and module names are correct.[0m
INFO interface: info: Error executing puppet module install. Check that this command succeeds:
puppet module install --version 4.5.1 --target-dir /var/www/my-repository/puppet/.tmp/librarian/cache/source/puppet/forge/forgeapi_puppetlabs_com/puppetlabs-stdlib/4.5.1 --module_repository https://forge.puppetlabs.com --modulepath /var/www/my-repository/puppet/.tmp/librarian/cache/source/puppet/forge/forgeapi_puppetlabs_com/puppetlabs-stdlib/4.5.1 --module_working_dir /var/www/my-repository/puppet/.tmp/librarian/cache/source/puppet/forge/forgeapi_puppetlabs_com/puppetlabs-stdlib/4.5.1 --ignore-dependencies puppetlabs-stdlib
Error:
[1;31mError: Could not execute operation for 'puppetlabs/stdlib'
The server being queried was https://forge.puppetlabs.com
The HTTP response we received was '302 Found'
Check the author and module names are correct.[0m
INFO interface: info: ==> default: Error executing puppet module install. Check that this command succeeds:
==> default: puppet module install --version 4.5.1 --target-dir /var/www/my-repository/puppet/.tmp/librarian/cache/source/puppet/forge/forgeapi_puppetlabs_com/puppetlabs-stdlib/4.5.1 --module_repository https://forge.puppetlabs.com --modulepath /var/www/my-repository/puppet/.tmp/librarian/cache/source/puppet/forge/forgeapi_puppetlabs_com/puppetlabs-stdlib/4.5.1 --module_working_dir /var/www/my-repository/puppet/.tmp/librarian/cache/source/puppet/forge/forgeapi_puppetlabs_com/puppetlabs-stdlib/4.5.1 --ignore-dependencies puppetlabs-stdlib
==> default: Error:
==> default: [1;31mError: Could not execute operation for 'puppetlabs/stdlib'
==> default: The server being queried was https://forge.puppetlabs.com
==> default: The HTTP response we received was '302 Found'
==> default: Check the author and module names are correct.[0m
[1;32m==> default: Error executing puppet module install. Check that this command succeeds:
==> default: puppet module install --version 4.5.1 --target-dir /var/www/my-repository/puppet/.tmp/librarian/cache/source/puppet/forge/forgeapi_puppetlabs_com/puppetlabs-stdlib/4.5.1 --module_repository https://forge.puppetlabs.com --modulepath /var/www/my-repository/puppet/.tmp/librarian/cache/source/puppet/forge/forgeapi_puppetlabs_com/puppetlabs-stdlib/4.5.1 --module_working_dir /var/www/my-repository/puppet/.tmp/librarian/cache/source/puppet/forge/forgeapi_puppetlabs_com/puppetlabs-stdlib/4.5.1 --ignore-dependencies puppetlabs-stdlib
==> default: Error:
==> default: [1;31mError: Could not execute operation for 'puppetlabs/stdlib'
==> default: The server being queried was https://forge.puppetlabs.com
==> default: The HTTP response we received was '302 Found'
==> default: Check the author and module names are correct.[0m[0m
DEBUG ssh: Exit status: 1
ERROR warden: Error occurred: The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
How do I get around this error? The issue seems to be networking related, or a problem with the actual puppet program. The 302 Found is really throwing me for a loop...
Thanks in advance.
I solved that problem running "puppet module install puppetlabs-apt --module_repository https://forge.puppet.com/"