Installing Self Hosted Linux Agent for Azure devops Server - linux

Hello Cloud Engineers,
I am trying to create a self hosted agent in azure to run by build and release pipeline.
When i am configuring the linux VM as a agent, i am getting below error.
--------OS Information--------
NAME="SLES"
VERSION="15-SP2"
PRETTY_NAME="SUSE Linux Enterprise Server 15 SP2"
___ ______ _ _ _
/ _ \ | ___ (_) | (_)
/ /_\ \_____ _ _ __ ___ | |_/ /_ _ __ ___| |_ _ __ ___ ___
| _ |_ / | | | '__/ _ \ | __/| | '_ \ / _ \ | | '_ \ / _ \/ __|
| | | |/ /| |_| | | | __/ | | | | |_) | __/ | | | | | __/\__ \
\_| |_/___|\__,_|_| \___| \_| |_| .__/ \___|_|_|_| |_|\___||___/
| |
agent v2.183.1 |_| (commit b8617e6)
>> End User License Agreements:
Building sources from a TFVC repository requires accepting the Team Explorer Everywhere End User License Agreement. This step is not required for building sources from Git repositories.
A copy of the Team Explorer Everywhere license agreement can be found at:
/home/selfhosted-linuxagent/externals/tee/license.html
Enter (Y/N) Accept the Team Explorer Everywhere license agreement now? (press enter for N) > y
>> Connect:
Enter server URL > https://hello.world.com/
Enter authentication type (press enter for PAT) >
Enter personal access token > *****************
Error reported in diagnostic logs. Please examine the log for more details.
- /home/selfhosted-linuxagent/_diag/Agent_20210308-094413-utc.log
The SSL connection could not be established, see inner exception.
Failed to connect. Try again or ctrl-c to quit
Enter server URL >

The error may indicate the server certificate you used on your TFS server is not trusted by the build machine. Make sure you install your self-signed ssl server certificate into the OS certificate store.
Windows: Windows certificate store
Linux: OpenSSL certificate store
macOS: OpenSSL certificate store for agent version 2.124.0 or below
Keychain for agent version 2.125.0 or above
You can easily verify whether the certificate has been installed correctly by running few commands. You should be good as long as SSL handshake finished correctly even you get a 401 for the request.
Windows: PowerShell Invoke-WebRequest -Uri https://corp.tfs.com/tfs -UseDefaultCredentials
Linux: curl -v https://corp.tfs.com/tfs
macOS: curl -v https://corp.tfs.com/tfs (agent version 2.124.0 or below, curl needs to be built for OpenSSL)
curl -v https://corp.tfs.com/tfs (agent version 2.125.0 or above, curl needs to be built for Secure Transport)
Check the following documentation for more details:
https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/certificate?view=azure-devops-2020

Related

How to extract current version of Windows through KQL in Azure?

We are planning to upgrade all our 2012-R2 Servers to 2019 Server, and to do this we need to get an overview of all our 2012 server in Azure.
We are now using this KQL query to get the information of what version is installed, but we noticed that this is only including the windows version FIRST installed, and not the current installed windows version. Is there any ways to get the current windows version out of an Azure KQL script?
Resources
| where type =~ 'Microsoft.Compute/virtualMachines'
| project resourceGroup, version = properties.storageProfile.imageReference.sku, minorversion=properties.storageProfile.imageReference.exactVersion
| join ResourceContainers on resourceGroup
| project resourceGroup, tags.Description, version, minorversion
I found a solution with below script
| where type =~ 'Microsoft.Compute/virtualMachines'
| project resourceGroup, name, initial_OSVersion = properties.storageProfile.imageReference.sku, current_OS = properties.extended.instanceView.osName, current_OSVersion = properties.extended.instanceView.osVersion
| join ResourceContainers on resourceGroup
| project customer_Name = tags.Description, ComputerName = name, current_OS,initial_OSVersion, current_OSVersion, resourceGroup
| order by tostring(current_OS) asc

Prisma 2 query relation return null

I migrated my project from prisma 1.
Then I added new models relative to my Live model.
I try to query the new models with relation type (one-to-one and one-to-many) but that returns null.
Here is my prisma.schema
Query live.questionnaire{} works but questionnaire.live{} doesn't, and both questionnaire.questionnaireField{} and questionnaireField.questionnaire{} dont't wortk.
Here is an exemple of the playground
live.questionnaire is ok.
questionnaire.live is not.
My schemas
Live schema perview where relation live.questionnaire ok
Each of questionnaire.live and questionnaire.fields and questionnaireField.questionnaire are down
My query resolver where only createdAt works
In prisma studio everything seems to be good...
If someone could help, Thanks
See your resolvers not clear but I will give you a way to build your GraphQL server with Prisma in just minute using Pal.Js CLI you can start new project with my CLI and just put your schema and run one command pal g and you will get everything ready for you with full CRUD system.
Install my CLI
yarn global add #paljs/cli
//or
npm install -g #paljs/cli
Start new project
> pal c
.______ ___ __ __ _______.
| _ \ / \ | | | | / |
| |_) | / ^ \ | | | | | (----`
| ___/ / /_\ \ | | .--. | | \ \
| | / _____ \ | `----.| `--' | .----) |
| _| /__/ \__\ |_______| \______/ |_______/
✔ Please select your start example · apollo-sdl-first
full-stack-nextjs
full-stack-gatsbyjs
apollo-nexus-schema
❯ apollo-sdl-first // select this example
graphql-modules
✔ please enter your project name · great-project
✔ please enter your project description · new NodeJs Prisma GraphQL TypeScript project
✔ please enter your project author · Ahmed Elywa
✔ please enter your project repository · https://github.com/paljs/prisma-tools
✔ please select your package manager · yarn
❯ yarn
npm
✔ Skip package installation · no
❯ yes
no
Now open your project folder and change ./prisam/schema.prisma file with yours
now generate all resolvers
pal g
you have now your graphql server ready
start your server
yarn dev
or
npm run dev
that is it

How do I troubleshoot Azure Linux App Service when logs are not including error messages

I have deployed an Azure Linux App Service that runs a NodeJS app with LoopBack 4 framework for quite some time now, but since last week or so, I'm having troubles deploying a new version of the application using Azure DevOps.
Last week when an app was deployed, it took several restarts for the app to be started. Since yesterday it took around 7 hours before the application was available and today (at the time of writing) it's taking 3 hours.
This is currently only in my development environment (prod will be deployed only on pull request), but I think that the same will happen to my production environment when I deploy a new version for that. Unfortunately, I can't try this at this time.
When I open the log stream, I don't see any errors beside that it Waiting for response to warmup request for container.
I don't know if it can have something to do with a timeout for starting the application, since I'm getting that error message in the "Diagnose & solve problems" screen, but when I run my application om my development machine, it boots in less than 5 seconds.
I tried settings the WEBSITES_CONTAINER_START_TIME_LIMIT setting to 1800 via:
portal > app service > Configuration > Application settings
DevOps job for settings app settings
But this doesn't have the desired result as I'm still seeing the Waiting for response to warup request for container message.
In the "Diagnose & Solve problems" screen in the Azure portal, I also have an error for container crash. I would expect that I would see some kind of error as for why it fails, but all I see is the following output:
Container qusito-core-dev_0_fdc9a431 couldn't be started: Logs = 2020-09-11T13:43:59.410899652Z _____
2020-09-11T13:43:59.410934153Z / _ \ __________ _________ ____
2020-09-11T13:43:59.410938953Z / /_\ \___ / | \_ __ \_/ __ \
2020-09-11T13:43:59.410942753Z / | \/ /| | /| | \/\ ___/
2020-09-11T13:43:59.410946453Z \____|__ /_____ \____/ |__| \___ >
2020-09-11T13:43:59.410950153Z \/ \/ \/
2020-09-11T13:43:59.410953753Z A P P S E R V I C E O N L I N U X
2020-09-11T13:43:59.410957153Z
2020-09-11T13:43:59.410960353Z Documentation: http://aka.ms/webapp-linux
2020-09-11T13:43:59.410963553Z NodeJS quickstart: https://aka.ms/node-qs
2020-09-11T13:43:59.410966853Z NodeJS Version : v10.14.2
2020-09-11T13:43:59.410970153Z Note: Any data outside '/home' is not persisted
2020-09-11T13:43:59.410973453Z
2020-09-11T13:44:00.211504840Z Cound not find build manifest file at '/home/site/wwwroot/oryx-manifest.toml'
2020-09-11T13:44:00.211887043Z Could not find operation ID in manifest. Generating an operation id...
2020-09-11T13:44:00.211897743Z Build Operation ID: 7cf16daf-ccef-4ad1-b496-50778dafc913
2020-09-11T13:44:02.114481171Z Writing output script to '/opt/startup/startup.sh'
2020-09-11T13:44:02.490713708Z Running #!/bin/sh
2020-09-11T13:44:02.491320612Z
2020-09-11T13:44:02.491332412Z # Enter the source directory to make sure the script runs where the user expects
2020-09-11T13:44:02.491336512Z cd "/home/site/wwwroot"
2020-09-11T13:44:02.491340212Z
2020-09-11T13:44:02.491344012Z export NODE_PATH=$(npm root --quiet -g):$NODE_PATH
2020-09-11T13:44:02.491347512Z if [ -z "$PORT" ]; then
2020-09-11T13:44:02.493136724Z export PORT=8080
2020-09-11T13:44:02.493148924Z fi
2020-09-11T13:44:02.493152724Z
2020-09-11T13:44:02.493341325Z PATH="$PATH:/home/site/wwwroot" npm run start
2020-09-11T13:44:06.600726640Z npm info it worked if it ends with ok
2020-09-11T13:44:06.600776740Z npm info using npm#6.9.0
2020-09-11T13:44:06.600875440Z npm info using node#v10.14.2
2020-09-11T13:44:06.868226973Z npm info lifecycle core#1.0.0~prestart: core#1.0.0
2020-09-11T13:44:06.885230583Z
2020-09-11T13:44:06.885248883Z > core#1.0.0 prestart /home/site/wwwroot
2020-09-11T13:44:06.885253583Z > npm run build
2020-09-11T13:44:06.885264583Z
2020-09-11T13:44:07.662776822Z npm info it worked if it ends with ok
2020-09-11T13:44:07.663855429Z npm info using npm#6.9.0
2020-09-11T13:44:07.664656534Z npm info using node#v10.14.2
2020-09-11T13:44:07.823510864Z npm info lifecycle core#1.0.0~prebuild: core#1.0.0
2020-09-11T13:44:07.824905373Z npm info lifecycle core#1.0.0~build: core#1.0.0
2020-09-11T13:44:07.835657242Z
2020-09-11T13:44:07.835673743Z > core#1.0.0 build /home/site/wwwroot
2020-09-11T13:44:07.835678743Z > lb-tsc
2020-09-11T13:44:07.835682343Z
At this time I'm stuck with this issue. I saw a reference somewhere on SO that logging in Linux is not completely supported in the log stream (in Azure portal), but I don't know where to find any other logs.
Any help on how I should move forward is appreciated.
You can manage your App Service through Console or Kudu in Advanced Tools.
As it turn out, I had a typo in my settings: WEBSITE_CONTAINER_START_TIME_LIMIT (Forgot the “S” after WEBSITE).
After chaning this, I didn’t had any problem on deploying. I also noged that the lb-tsc command takes around 5-6 minutes when running. This is what probably went wrong when deploying.

Query result on peer1.org2 is INVALID

All of a sudden latest version 1.1.0-alpha, started throwing errors in bring the Hyperledger Fabric Samples - first-network, while running ./byfc.sh -m up
2018-02-20 10:40:29.991 UTC [main] main -> INFO 008 Exiting.....
!!!!!!!!!!!!!!! Query result on peer1.org2 is INVALID !!!!!!!!!!!!!!!!
================== ERROR !!! FAILED to execute End-2-End Scenario ==================
ERROR !!!! Test failed
Need help.. How to debug?
Updates
I had everything running using Fabric 1.1.0-alpha, when I tried sometime after Jan 26. Recently I wanted to try adding a new org to the network. So thought of re-doing from scratch, but now it's failing. Not able to proceed, which I had done it earlier, couple of times. Not sure what is wrong since yesterday, with latest fabric samples...
Cloned the source from master branch.
Docker version 17.12.0-ce, build c97c6d6
Node version v8.9.4
NPM version 5.6.0
cryptogen version 1.1.0-alpha
configtxlator version 1.1.0-alpha
Removed old binaries (/bin folder) and docker containers and images, to start from scratch, but no luck:
./byfn.sh -m down
docker rm -f $(docker ps -aq)
docker rmi -f $(docker images -q)
docker network prune
I tried running ./byfn.sh, using -m, also without, Same result.
./byfn.sh generate
./byfn.sh up
And,
./byfn.sh -m generate
./byfn.sh -m up
Did you checkout the right fabric-samples repo tag that matches the binaries version? The documentation for this was just updated serveral hours ago, so if you were referring to an earlier version of the documentation you might want to refresh:
https://hyperledger-fabric.readthedocs.io/en/latest/samples.html#download-platform-specific-binaries
Make sure you Checkout to the right tag. eg: after you clone, then cd to that folder, finally you git git checkout v1.1.0-alpha
then when running the byfn.sh script, you might need to use the -m option, e.g. `./byfn.sh -m generate
With v1.1.0-rc1, I am able to execute the first-network successfully.
===================== Query on peer1.org2 on channel 'mychannel' is successful =====================
========= All GOOD, BYFN execution completed ===========
_____ _ _ ____
| ____| | \ | | | _ \
| _| | \| | | | | |
| |___ | |\ | | |_| |
|_____| |_| \_| |____/
I suspect, the error which I faced previously with v1.1.0-alpha, was just due to missing instruction in the tutorial, i.e., git checkout {TAG}. Now this has been updated correctly in the tutorial.
I was facing similar error with Release 1.4.1
100
!!!!!!!!!!!!!!! Query result on peer1.org2 is INVALID !!!!!!!!!!!!!!!!
================== ERROR !!! FAILED to execute End-2-End Scenario ==================
ERROR !!!! Test failed
I resolved it by following steps:
Removed fabric-samples directory
Run command in hyperledger directory
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s -- 1.4.1 1.4.1 0.4.15
./byfn.sh up -l node
It is working fine.
90
===================== Query successful on peer1.org2 on channel 'mychannel' =====================
========= All GOOD, BYFN execution completed ===========

Node application, manage module dependencies

I'm new in node development and I'm doing a little bit of training.
My folder structure looks like this:
node-test
|
|
+---build
| |
| +---node_modules
| |
| +---public
| |
| +---server
| |
| \---main.js
|
|---src
|
+---node_modules
|
+---public
|
+---server
|
|---.gitignore
|
\---main.ts
I'm using Gulp to build source code to build folder maintaining the structure.
I'm facing some problem related Node dependencies.
Initially I used gulp-npm-files to copy required dependencies into build\node_modules using all the examples found on package page but always some dependency is missing. So for the moment gulp copies the entire src\node_modules in build\node_modules. Certainly is not the right way but express works and I can see static HTML.
I've also another problem about dependencies:
this.app.use(express.static(RouterContants.PublicDirectory));
This line sets the only folder that the browser can access, right? OK, then how can I access node_modules?
How dependencies have to been managed correctly?
Any suggestions and advices are welcome.
Thank you

Resources