upgrade 4.0.17 to 4.1 version - processmaker

How to upgrade an earlier version to the latest?
I am running 4.0.17 (bitnami) version and trying to start using the latest 4.1 version. Platform Debian.
Unpack 4.1 files
CD into the folder and run composer update --no-dev
Copied .env file from 4.0.17 version backup
Install javascript assets using npm install
Compile javascript assets using npm run dev
Has anyone seen any upgrade steps? I am only getting error 500 in the browser. How to get access to detailed error logging to get more detailed error messages?

I was encountering similar issues when trying to upgrade the Processmaker 4 AMI to the latest version. After some trial and error and a bit of help from folks with experience in laravel, I seem to have resolved most issues with my processmaker upgrade. These are the full steps I used to upgrade the AMI:
sudo su - bitnami
cd /opt/bitnami
sudo wget https://github.com/ProcessMaker/processmaker/releases/download/v4.1.0/pm4.1.tar.gz
sudo ./ctlscript.sh stop
sudo mv processmaker/ processmaker-old/
sudo tar -xzvf pm4.1.tar.gz -C .
sudo cp processmaker-old/.env processmaker/
sudo cp processmaker-old/laravel-echo-server.json processmaker/
sudo cp /opt/bitnami/processmaker-old/storage/oauth-p* /opt/bitnami/processmaker/storage/
sudo cp -R /opt/bitnami/processmaker-old/storage/app/* /opt/bitnami/processmaker/storage/app/
sudo chown -R bitnami:daemon processmaker/
cd processmaker/
composer install --no-dev
npm install
npm run dev
sudo find /opt/bitnami/processmaker/ | sudo xargs sudo chmod a+w
php artisan migrate
sudo /opt/bitnami/ctlscript.sh start
My current sticking point is that previously uploaded media is not getting displayed on the site, but I am no longer getting errors with laravel-echo-server or MySQL.
Aside from the files which needed to be copied from the old installation (.env, laravel-echo-server.json, oauth keys and app data) The biggest hurdle for me here was php artisan migrate, which modifies tables in the processmaker database to support changes in laravel/processmaker.

Related

How to keep PHPUnit up to date in Docker / Devilbox?

I am using Devilbox LAMPstack as my development environment. It ships with PHPUnit v 7.x, which I can update by doing this:
$ wget https://phar.phpunit.de/phpunit.phar
$ chmod +x phpunit.phar
$ sudo mv phpunit.phar /usr/local/bin/phpunit
This gets me to the latest version of PHPUnit (currently 9.x). Of course it does not persist if I run docker-compose down or docker-compose rm -f, as is recommended on Devilbox.
I'm very new to Docker / Devilbox. My question is, is there a permanent way to get the updated version of PHPUnit to persist?

How to get wkhtmltopdf with a Dockerized Rails App with running ruby:3.0.4-alpine for use with Wicked PDF

I'm trying to upgrade a Dockerized Rails app to Ruby 3+ and Rails 7. Due to other project dependencies, I've landed on this version of Ruby Docker image ruby:3.0.4-alpine. Here's my Dockerfile:
FROM ruby:3.0.4-alpine
RUN apk --update add --no-cache build-base bash git vim curl postgresql-dev openssl-dev nodejs npm yarn tzdata less \
imagemagick postgresql-client gcompat
RUN mkdir /app
WORKDIR /app
COPY Gemfile Gemfile.lock package.json yarn.lock ./
RUN yarn set version berry
RUN bundle update --bundler
RUN bundle install --jobs 5
ADD . /app
RUN yarn install
RUN yarn install --frozen-lockfile \
&& RAILS_SECRET_KEY_BASE=secret_key_base RAILS_ENV=production bundle exec rails assets:precompile apipie:cache \
&& rm -rf node_modules
EXPOSE 5000
VOLUME ["/app/public", "/usr/local/bundle"]
CMD bash -c "bundle exec puma -C config/puma.rb"
At this point the only dependency in my Rails app that doesn't work with this Dockerfile is wkhtmltopdf.
I would prefer to install wkhtmltopdf with the Alpine Package Keeper (apk) as part of RUN apk --update add --no-cache.
But, it appears that the latest version of Alpine that has the wkhtmltopdf package available is Alpine 3.14. The release notes for Alpine 3.15 state "qt5-qtwebkit, kdewebkit, wkhtmltopdf, and py3-pdfkit have been removed due to known vulnerabilities and lack of upstream support for qtwebkit."
So other than switching off of Alpine Linux, which would present other dependency issues. I would prefer not to do as that seems to be the version used by most Dockerized Rails apps for the foreseeable future, what are my options?
I also tried using the wkhtmltopdf_binary gem, but that was last updated in 2016. When I try to export a PDF using wicked_pdf with wkhtmltopdf installed by that gem, I get this error:
/usr/local/bundle/gems/wkhtmltopdf-binary-0.12.6.5/bin/wkhtmltopdf:61:in `<top (required)>': Invalid platform, must be running on Ubuntu
16.04/18.04/20.04 CentOS 6/7/8, Debian 9/10, archlinux amd64, or intel-based Cocoa macOS (missing binary: /usr/local/bundle/gems/wkhtmltopdf-binary-0.12.6.5/bin/wkhtmltopdf_alpine_3.16.0_i386). (RuntimeError) from /usr/local/bundle/bin/wkhtmltopdf:25:in `load' from /usr/local/bundle/bin/wkhtmltopdf:25:in `<main>'
I believe I'm getting this error because the docker image ruby:3.0.4-alpine is running Alpine 3.16 and Alpine dropped support for wkhtmltopdf on version 3.14. The wkhtmltopdf_binary gem hasn't been updated since 2016, so it wouldn't target more recent versions of Alpine.
So, what are my options to work around this? Is there a way to script a compatible installation of the wkhtmltopdf in my Dockerfile? If so, how would I do that?
I haven't been able to find another gem that targets more recent versions of Alpine that install wkhtmltopdf. Is there one out there that I'm missing?
This has to be a common problem (Rails app running on Docker Alpine image with Ruby 3+ that needs to export PDFs using wkhtmltopdf).
Or, is there another way to export PDFs in ruby that doesn't depend on wkhtmltopdf that I haven't found? (I've found other NodeJS options, but that introduces a whole other set of dependencies, so a Docker/Ruby solution is preferable.)

Unable to create superuser in cvat

I am able to build and run cvat tool. But when I trying to create a superuser then it is giving me below error.
ImportError: No module named 'gitdb.utils.compat'
I am running below command for creating a superuser.
docker exec -it cvat bash -ic 'python3 ~/manage.py createsuperuser'
Does anyone have any idea or suggestion for the above problem?
It seems the newer version of gitdb does not work with cvat (default version is 4.0.2), you can follow Furkan Kirac answer but with gitdb version is 0.6.4:
# pip uninstall gitdb
# pip install gitdb==0.6.4
This problem is most probably due to a newer gitdb2 python package.
If cvat is already built as a docker container, for testing, you must log into the container as root, uninstall it and install an older gitdb.
docker exec -it -u root cvat bash
pip3 uninstall gitdb2
pip3 install gitdb
Then, running python script must work. If that is the case, then a persistent solution is to rebuild the containers.
You need to edit Dockerfile as below:
# Install git application dependencies
...
fi
RUN pip3 uninstall -y gitdb2
RUN pip3 install --no-cache-dir gitdb
Run "docker-compose build".
Hope this helps.

How to install docker-ce without internet and intranet yum repository?

I downloaded the RPM package from the official website, but I still need to download some dependencies when I install it. I need to install docker-ce without any network or repository at all, so I need all the RPM packages I depend on and the order in which they are installed.
Docker-CE Version: 18.03+
Only way to install if there is no internet is download tar and extract.
Steps available at :- Docker Install Steps
tar can be downloaded from
Binary repo
if you don't want to install the binary file and thus configure it from scratch Docker, you can download all the RPM packages needed for your system, upload them to your offline machine, and install them.
Suppose you are on Centos 7.7, spin up a docker centos container, find all the needed dependencies. Download them. Upload and install them.
# In an online machine
docker run --rm -v ${PWD}/bin:/tmp -it centos:7.7.1908 bash # Run an online container similar to your offline machine
# In the online container:
cd /tmp
yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo # Add Docker repo
yum makecache fast # Update Yum cache
yum list docker-ce --showduplicates | sort -r # Choose a version
yumdownloader --resolve docker-ce-20.10.5-3.el7 # Download all non-installed RPM depencencies
Upload all the RPM packages to your offline machine. You can make a tar out of them:
tar cvzf docker-rpm-deps.tar.gz * # Create an archive of all the RPMs
Install all the RPMs
# In the offline machine
tar xzvf docker-rpm-deps.tar.gz -C /tmp # Exctract archive
cd /tmp
rpm -ivh --replacefiles --replacepkgs *.rpm # Install all .rpm in the current folder
Voila! Now you just need to enable and start docker.
systemctl enable docker.service
systemctl start docker.service
If, when you are in the offline machine, you still miss an RPM package you can download all the needed RPMs with the command below
# Instead of using yumdownloader
repotrack -a x86_64 -p ./docker-rpm-pkgs docker-ce-20.10.5-3.el7 # Download all RPM dependencies, even the already installed ones
you must download the DEB package and install it manually and manage upgrades completely manually. This is useful in situations such as installing Docker on air-gapped systems with no access to the internet.
Install from a package
If you cannot use Docker’s repository to install Docker CE, you can download the .deb file for your release and install it manually. You will need to download a new file each time you want to upgrade Docker CE.
1.Go to [https://download.docker.com/linux/ubuntu/dists/], choose your Ubuntu version, browse to pool/stable/ and choose amd64, armhf, ppc64el, or s390x. Download the .deb file for the Docker version you want to install.
Note: To install an edge package, change the word stable in the URL to edge.
Install Docker CE, changing the path below to the path where you downloaded the Docker package.
$ sudo dpkg -i /path/to/package.deb
and run
$ sudo docker version
to peresent docker version and succeed of inestallation.

Rails, Redis, Linux bin file error

i am attempting to get redis-server running in my rails app. i am following this post here (the version numbers are a little outdated) but it seems from the error i am getting
#rob:~/Work/boogle[master]$ redis-server
bash: /usr/local/bin/redis-server: No such file or directory
that the file isnt being found! as you can see its looking for it in /usr/local/bin/ the post i am following suggested that i cp src/redis-server src/redis-cli /usr/bin which suggests that /usr/local/bin/ and /usr/bin are different bin files is it safe to just cp src/redis-server src/redis-cli /usr/local/bin i am a little scared to mess with the bin files, and creating a 'redis-ception ' by running redis-server in the home dir.
I have a bad feeling like my bin or .bashrc file is F'd, any suggestions?
The guide asks you to install redis via the source.
You don't need this.
You can simply install redit with apt :
sudo add-apt-repository ppa:rwky/redis
sudo apt-get update
sudo apt-get install redis-server

Resources