Could not deploy React app from Visual studio Code to azure App service - visual-studio-code

I am trying to deploy a simple React app to Azure App Service from Visual Studio Code using AzureAppService extension. However it was failed with the error: Couldn't detect a version for the platform 'nodejs' in the repo. the node version on both local machine and Azure Web App is 16.
Any idea please?
9:10:47 pm spa1234: Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 16 -p virtualenv_name= --log-file /tmp/build-debug.log -i /tmp/8dab4f80016b776 -p compress_node_modules=tar-gz | tee /tmp/oryx-build.log
9:10:53 pm spa1234: Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
9:10:53 pm spa1234: You can report issues at https://github.com/Microsoft/Oryx/issues
9:10:53 pm spa1234: Oryx Version: 0.2.20220812.1, Commit: cdf6b1b, ReleaseTagName: 20220812.1
9:10:53 pm spa1234: Build Operation ID: |75RCaacLtWg=.52a37c81_
9:10:53 pm spa1234: Repository Commit : 745ee158-98c2-4cb4-8cba-c067ab33681a
9:10:53 pm spa1234: Detecting platforms...
9:10:53 pm spa1234: Could not detect any platform in the source directory.
9:10:53 pm spa1234: Error: Couldn't detect a version for the platform 'nodejs' in the repo.
9:10:56 pm spa1234: /bin/bash -c "oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 16 -p virtualenv_name= --log-file /tmp/build-debug.log -i /tmp/8dab4f80016b776 -p compress_node_modules=tar-gz | tee /tmp/oryx-build.log ; exit $PIPESTATUS "
9:10:56 pm spa1234: Generating summary of Oryx build
9:10:56 pm spa1234: Parsing the build logs
9:10:56 pm spa1234: Found 0 issue(s)
9:10:56 pm spa1234: Build Summary :

Suggestion here is to make the SCM_DO_BUILD_DURING_DEPLOYMENT= FALSE it should work.

Related

Can't import backup file

Linux Mint 20.1
DBaver 22.1.4
I try to restore PostgreSQL from backup file.
But I get error:
/run/user/1000/doc/65139af1/bin/pg_restore --verbose --host=localhost --port=5432 --username=myUserName --format=c --dbname=myDB/home/alex/postgresql.backup
Task 'PostgreSQL restore' started at Thu Dec 15 14:49:01 EET 2022
/run/user/1000/doc/65139af1/bin/pg_restore: error while loading shared libraries: libpq.so.5: cannot open shared object file: No such file or directory
Task 'PostgreSQL restore' finished at Thu Dec 15 14:49:01 EET 2022
2022-12-15 14:49:01.945 - IO error: Process failed (exit code = 127). See error log.
2022-12-15 14:49:01.947 - java.io.IOException: Process failed (exit code = 127). See error log.
at org.jkiss.dbeaver.tasks.nativetool.AbstractNativeToolHandler.validateErrorCode(AbstractNativeToolHandler.java:242)
at org.jkiss.dbeaver.ext.postgresql.tasks.PostgreDatabaseRestoreHandler.validateErrorCode(PostgreDatabaseRestoreHandler.java:151)
at org.jkiss.dbeaver.tasks.nativetool.AbstractNativeToolHandler.executeProcess(AbstractNativeToolHandler.java:223)
at org.jkiss.dbeaver.tasks.nativetool.AbstractNativeToolHandler.doExecute(AbstractNativeToolHandler.java:262)
at org.jkiss.dbeaver.tasks.nativetool.AbstractNativeToolHandler.lambda$0(AbstractNativeToolHandler.java:83)
at org.jkiss.dbeaver.runtime.RunnableContextDelegate.lambda$0(RunnableContextDelegate.java:39)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
check library libpq.so.5 it is installed or not, check use command in your terminal
ldconfig -p | grep libpq.so.5
if installed, you will see
try this :

sdkmanager install package build-tools on debian 11

Trying to install build-tools;30.0.03 in debian:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
$ sdkmanager --install "build-tools;30.0.3" --sdk_root=$ANDROID_SDK_ROOT --verbose
Info: Parsing /opt/android-sdk/build-tools/30.0.2/package.xml
Info: Parsing /opt/android-sdk/build-tools/31.0.0/package.xml
Info: Parsing legacy package: /opt/android-sdk/cmdline-tools/7583922
Info: Parsing /opt/android-sdk/emulator/package.xml
Info: Parsing /opt/android-sdk/extras/android/m2repository/package.xml
Info: Parsing /opt/android-sdk/extras/google/m2repository/package.xml
Info: Parsing /opt/android-sdk/patcher/v4/package.xml
Info: Parsing /opt/android-sdk/platform-tools/package.xml
Info: Parsing /opt/android-sdk/platforms/android-30/package.xml
Info: Parsing /opt/android-sdk/platforms/android-31/package.xml
Info: Parsing /opt/android-sdk/system-images/android-30/default/x86_64/package.xml
Info: Parsing /opt/android-sdk/system-images/android-30/google_apis/x86/package.xml
Info: Parsing /opt/android-sdk/system-images/android-31/default/x86_64/package.xml
Info: Parsing /opt/android-sdk/tools/package.xml
Info: Preparing "Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)".
Warning: Failed to read or create install properties file.
But the package is not installed:
$ sdkmanager --list_installed
Installed packages:=====================] 100% Fetch remote repository...
Path | Version | Description | Location
------- | ------- | ------- | -------
build-tools;30.0.2 | 30.0.2 | Android SDK Build-Tools 30.0.2 | build-tools/30.0.2
emulator | 30.9.5 | Android Emulator | emulator
extras;android;m2repository | 47.0.0 | Android Support Repository | extras/android/m2repository
extras;google;m2repository | 58 | Google Repository | extras/google/m2repository
patcher;v4 | 1 | SDK Patch Applier v4 | patcher/v4
platform-tools | 31.0.3 | Android SDK Platform-Tools | platform-tools
platforms;android-30 | 3 | Android SDK Platform 30 | platforms/android-30
system-images;android-30;google_apis;x86 | 10 | Google APIs Intel x86 Atom System Image | system-images/android-30/google_apis/x86
If I tried different sdk_root=$ANDROID_SDK_ROOT/build-tools, then I got a request to accept the license. But after accept it, the package wasn't installed neither.
January 16, 2019
---------------------------------------
Accept? (y/N): y
Info: Preparing "Install SDK Patch Applier v4 (revision: 1)".
Warning: Failed to read or create install properties file.
Have to run sdkmanager in sudo mode.
$ sudo sdkmanager --install "build-tools;30.0.3" --sdk_root=$ANDROID_SDK_ROOT --verbose
[sudo] password for <debian>:
sudo: sdkmanager: command not found
But command above went wrong, because running a command that is known to exist in a folder that is in a $PATH but fails when attempting to execute with sudo. So I login as root sudo su and run the command above. You can also try one of solutions here to pass env var for sudoers.

Authentication error when using rundeck cli (aka rd)

I'm using rundeck-cli rd on my container.
I set
RD_URL=http://localhost:4440/rundeck
RD_USER=myuser
RD_PASSWORD=mypassword
but
when trying to login, I fail to authenticate.
I tested the credentials on the web UI successfully
Apr 28, 2020 7:26:41 PM okhttp3.internal.platform.Platform log
INFO: --> GET http://localhost:4440/rundeck/ http/1.1
Apr 28, 2020 7:26:41 PM okhttp3.internal.platform.Platform log
INFO: <-- 302 Found http://localhost:4440/rundeck/ (8ms, 0-byte body)
Apr 28, 2020 7:26:41 PM okhttp3.internal.platform.Platform log
INFO: --> GET http://localhost:4440/user/login http/1.1
Apr 28, 2020 7:26:41 PM okhttp3.internal.platform.Platform log
INFO: <-- 200 OK http://localhost:4440/user/login (19ms, unknown-length body)
Apr 28, 2020 7:26:41 PM okhttp3.internal.platform.Platform log
INFO: --> POST http://localhost:4440/rundeck/j_security_check http/1.1 (33-byte body)
Apr 28, 2020 7:26:41 PM okhttp3.internal.platform.Platform log
INFO: <-- 302 Found http://localhost:4440/rundeck/j_security_check (26ms, 0-byte body)
Apr 28, 2020 7:26:41 PM okhttp3.internal.platform.Platform log
INFO: --> GET http://localhost:4440/rundeck/ http/1.1
Apr 28, 2020 7:26:41 PM okhttp3.internal.platform.Platform log
INFO: <-- 404 Not Found http://localhost:4440/rundeck/ (19ms, unknown-length body)
Exception in thread "main" java.lang.IllegalStateException: Password Authentication failed, expected a successful response.
at org.rundeck.client.util.FormAuthInterceptor.authenticate(FormAuthInterceptor.java:82)
at org.rundeck.client.util.FormAuthInterceptor.intercept(FormAuthInterceptor.java:59)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)
You can do that "tuning" the Rundeck official image using docker-compose and Dockerfile.
Create a directory and put the docker-compose.yml with the following content:
version: '3'
services:
rundeck:
build:
context: .
args:
IMAGE: ${RUNDECK_IMAGE:-rundeck/rundeck:3.2.6}
ports:
- 4440:4440
links:
- postgres
environment:
RUNDECK_DATABASE_DRIVER: org.postgresql.Driver
RUNDECK_DATABASE_USERNAME: rundeck
RUNDECK_DATABASE_PASSWORD: rundeck
RUNDECK_DATABASE_URL: jdbc:postgresql://postgres/rundeck?autoReconnect=true&useSSL=false
postgres:
image: postgres
expose:
- 3306
environment:
- POSTGRES_USER=rundeck
- POSTGRES_PASSWORD=rundeck
volumes:
- dbdata:/var/lib/postgresql/data
volumes:
dbdata:
And put this Dockerfile in the same directory with the following content:
ARG IMAGE
FROM ${IMAGE}
RUN sudo apt-get update \
&& sudo echo "deb https://dl.bintray.com/rundeck/rundeck-deb /" | sudo tee -a /etc/apt/sources.list \
&& sudo curl "https://bintray.com/user/downloadSubjectPublicKey?username=bintray" > /tmp/bintray.gpg.key \
&& sudo apt-key add - < /tmp/bintray.gpg.key \
&& sudo apt-get -y install apt-transport-https \
&& sudo apt-get -y update \
&& sudo apt-get -y install rundeck-cli
ENV RD_AUTH_PROMPT false
# or your defined host
ENV RD_URL http://localhost:4440
ENV RD_USER admin
ENV RD_PASSWORD admin
To create all environment do: docker-compose up
Enter to your container with: docker exec -it your_rundeck_container bash
And test RD-CLI doing: rd run -j YourJobName -p YourProjectName
You can see the result and execution on GUI.
Here you have a lot of examples to do anything with Rundeck and Docker.

Docker compose missing yarn dependencies on build

Can't get node_modules folder when running yarn install in the Dockerfile
test-sof
├── docker-compose.yml
├── Dockerfile
├── package.json
└── yarn.lock
docker-compose.yml
version: '3'
services:
web:
build: .
volumes:
- .:/myapp
package.json
{
"name": "site",
"private": true,
"dependencies": {
"#rails/webpacker": "^3.2.1",
"babel-preset-react": "^6.24.1",
"prop-types": "^15.6.0",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"reactjs": "^1.0.0",
"underscore": "^1.8.3"
},
"devDependencies": {
"webpack-dev-server": "^2.11.1"
}
}
Dockferfile
FROM ruby:2.5
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && \
apt-get install -qq -y build-essential libpq-dev nodejs yarn
RUN mkdir /myapp
WORKDIR /myapp
ADD ./package.json /myapp/
RUN yarn install
output of the step RUN yarn install when docker-compose build:
Step 6/6 : RUN yarn install
---> Running in 3a0e7095ec81
yarn install v1.3.2
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#1.1.3: The platform "linux" is incompatible with this module.
info "fsevents#1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "#rails/webpacker > postcss-cssnext#3.1.0" has unmet peer dependency "caniuse-lite#^1.0.30000697".
warning " > webpack-dev-server#2.11.1" has unmet peer dependency "webpack#^2.2.0 || ^3.0.0".
warning "webpack-dev-server > webpack-dev-middleware#1.12.2" has unmet peer dependency "webpack#^1.0.0 || ^2.0.0 || ^3.0.0".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 21.11s.
Removing intermediate container 3a0e7095ec81
---> 5720579a0f2a
Successfully built 5720579a0f2a
Successfully tagged testsof_web:latest
Running command: docker-compose run web bash to get in the container
root#11af1818e494:/myapp# ls
Dockerfile docker-compose.yml package.json
no node_modules folder present, but later when running inside the container: yarn install output:
root#11af1818e494:/myapp# yarn install
yarn install v1.3.2
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#1.1.3: The platform "linux" is incompatible with this module.
info "fsevents#1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "#rails/webpacker > postcss-cssnext#3.1.0" has unmet peer dependency "caniuse-lite#^1.0.30000697".
warning " > webpack-dev-server#2.11.1" has unmet peer dependency "webpack#^2.2.0 || ^3.0.0".
warning "webpack-dev-server > webpack-dev-middleware#1.12.2" has unmet peer dependency "webpack#^1.0.0 || ^2.0.0 || ^3.0.0".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 13.03s.
then when listing:
root#11af1818e494:/myapp# ls
Dockerfile docker-compose.yml node_modules package.json yarn.lock
folder node_modules IT IS present. Why?
This part of Dockerfile installs yarn packages:
RUN mkdir /myapp
WORKDIR /myapp
ADD ./package.json /myapp/
RUN yarn install
Folder /myapp is created, package.json is copied to it and yarn packages are installed. Build is successful and, of course, node_modules folder is inside built image.
But after that you start built image with:
volumes:
- .:/myapp
which means that content of folder where docker-compose.yaml is is mounted to /myapp folder inside container, so it covers content of container's /myapp folder.
You don't need to mount current folder to container's folder to achieve what you want. Just delete it from your docker-compose.yaml:
version: '3'
services:
web:
build: .
Now you can:
$ docker-compose build
$ docker-compose run web bash
root#558d5b0c2ccb:/myapp# ls -la
total 268
drwxr-xr-x 3 root root 4096 Feb 23 22:25 .
drwxr-xr-x 65 root root 4096 Feb 23 22:36 ..
drwxr-xr-x 818 root root 36864 Feb 23 22:25 node_modules
-rw-rw-r-- 1 root root 333 Feb 23 22:07 package.json
-rw-r--r-- 1 root root 219075 Feb 23 22:25 yarn.lock
EDIT:
But what I want is when building the image, get these dependencies not
when spinning up the containers. Otherwise I have another container
which mounts de source code and needs this node_modules folder when
running the "docker-compose up" and I'd like to avoid some kind of
ugly sleep until the node_modules is finished. So I need present this
folder on my root host before up the containers somehow
If you want to achieve the above goal, you can use the following workaround:
1. You modify Dockerfile a little:
FROM ruby:2.5
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && \
apt-get install -qq -y build-essential libpq-dev nodejs yarn
RUN mkdir /build && mkdir /myapp
WORKDIR /build
ADD ./package.json /build/
RUN yarn install
WORKDIR /myapp
CMD cp -a /build/node_modules/ /myapp/
That's means that yarn packages will be built in /build folder inside image and copied to /myapp folder once container is started.
2. You use the original docker-compose.yaml file:
version: '3'
services:
web:
build: .
volumes:
- .:/myapp
when you start web container:
docker-compose up web
folder node_modules is copied to mounted folder i.e. to . folder on your host machine.
3. Now you can start any container and it will be contain node_modules folder inside /myapp:
docker-compose run web bash
So, you will be able to achieve your goal the following way:
$ docker-compose build && docker-compose up web
$ docker-compose run web bash
root#4b38e60adfa3:/myapp# ls -la
total 64
drwxrwxr-x 3 1000 1000 4096 Feb 24 10:59 .
drwxr-xr-x 66 root root 4096 Feb 24 11:13 ..
-rw-rw-r-- 1 1000 1000 497 Feb 24 10:55 Dockerfile
-rw-rw-r-- 1 1000 1000 73 Feb 24 09:02 docker-compose.yaml
drwxr-xr-x 818 root root 40960 Feb 24 10:57 node_modules
-rw-rw-r-- 1 root root 333 Feb 23 22:07 package.json

Dockerfile RUN command not working

I am trying to create IBM WAS image from my local binary but it is not working . i used the dockerfile and added below command but getting error :
Dockerfile:
FROM centos:centos6
RUN yum update -y
RUN "/docker/software/im/installc -acceptLicense -accessRights nonAdmin \
-installationDirectory /docker/IBM/InstallationManager -dataLocation /docker/var/ibm/InstallationManager -showProgress"
Error:
---> Running in 206e970b75c8 /bin/sh: /docker/software/im/installc -acceptLicense -accessRights nonAdmin -installationDirectory /docker/IBM/InstallationManager -dataLocation
/docker/var/ibm/InstallationManager -showProgress: No such file or
directory The command '/bin/sh -c "/docker/software/im/installc
-acceptLicense -accessRights nonAdmin -installationDirectory /docker/IBM/InstallationManager -dataLocation
/docker/var/ibm/InstallationManager -showProgress"' returned a
non-zero code: 127
Docker is trying to run installc from within the image. The image centos:centos6 image does not contain IBM Installation Manager.
I recommend taking a look at the WebSphere traditional Docker images published by IBM to Docker hub. If you wish to create something slightly different for example use centos instead of ubuntu then take a look at the instructions for building WebSphere traditional Docker images, they are Apache licensed so you are free to adapt them.
Docker build error :
/bin/sh: /tmp/im/installc: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
The command '/bin/sh -c unzip -qd /tmp/im /tmp/agent.installer.linux.gtk.x86_1.8.0.20140902_1503.zip && /tmp/im/installc -acceptLicense -show Progress -installationDirectory /usr/lib/im -dataLocation /var/im && rm -rf /tmp/agent.installer.linux.gtk.x86_1.8.0.20140902_1503.zip /tmp/i m' returned a non-zero code: 126
Linux version : AWS linux 3.10.0-514.10.2.el7.x86_64 #1 SMP Mon Feb 20 02:37:52 EST 2017 x86_64 x86_64 x86_64 GNU/Linux