-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different behaviors for cosmos db linux emulator on unbuntu 18 vs 20 image #5036
Comments
Hi @DOMZE . |
Hello @DOMZE your repro yml fails on all environments (not only on Ubuntu 20) since it incorrectly creates docker container for CosmosDB. Please use this one guideline to correctly create container. These steps work for me. |
How does it incorrectly creates the docker container? docker create and docker start is just docker run split in 2 commands (docker run = docker create + docker start)... So to go back to my last point on Azure Devops (not github actions...), doing the command as you showed (docker run, results in the following error from docker): which makes sense considering there's no TTY... So just want to know, how can one work (in my azure devops agent) using ubuntu 18 and not in ubuntu 20? the SAME exact pipeline YAML? |
@nikolai-frolov trigger: none
pool:
name: Azure Pipelines
vmImage: 'ubuntu-18.04'
resources:
containers:
- container: azure-cosmosdb-emulator
image: mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator
ports:
- "8081:8081"
- "10251:10251"
- "10252:10252"
- "10253:10253"
- "10254:10254"
options: --name azure-cosmosdb-emulator -m 3g --cpus=2.0 -e AZURE_COSMOS_EMULATOR_PARTITION_COUNT=20 -e AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE=false -e AZURE_COSMOS_EMULATOR_IP_ADDRESS_OVERRIDE=127.0.0.1
jobs:
- job: Job
displayName: 'Job'
services:
azure-cosmosdb-emulator: azure-cosmosdb-emulator
steps:
- task: PowerShell@2
name: startCosmosDb
displayName: 'Wait for Cosmos'
inputs:
pwsh: true
targetType: inline
script: |
$isStarted = $false
while ($isStarted -eq $false) {
$logs = (docker logs azure-cosmosdb-emulator)
if ($logs.Contains('Started')) {
Write-Output "Container $containerId started."
$isStarted = $true
break;
}
Write-Output "Waiting for container azure-cosmosdb-emulator to start"
Write-Output ($logs | Out-String)
Start-Sleep -Seconds 5
}
|
At the first of all, they use
Please double check parameters which are passed during container creation and provide the build link if it still doesn't work for you. |
Hi @nikolai-frolov could you give the yaml code I posted a try? It's pretty clear from there that the container is stopping (and the pipeline won't complete) An additional note, running |
@soenneker it works fine on 20.04 ADO after adding of endpoint to your infinite cycle:
|
Well, seems issue is reproducible not at all 100% cases. I will investigate this deeply. |
@milismsft does mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator image create logs somewhere? I can't find a reason why this container stops just after the start on ubuntu 20.04 (docker client is identical with 18.04 and it seems like compatibility issue for now)... |
@nikolai-frolov did you try to execute that workload locally on a Ubuntu 20.04 Linux VM or local machine? The only issue that I'm aware of is when using the Azure DevOps pipeline configured with Ubuntu 20.04 (seems that 18.04 works just fine), and will recommend opening a support ticket with the respective Azure team. There are no extra logs that can be retrieved at this time. The error seems to be coming from the initial setup which initializes the Windows sandbox we run the emulator under. There must be some policies or similar that are in the way of it, unfortunately without a local repro it will be a very hard thing to investigate. |
One more thing, the script above that checks for the emulator if it's started, that is incorrect actually. Just because the container is started/running, it does not translate into the emulator being ready to service requests. Please see our public documentation of how to verify that emulator is truly ready (i.e. check through the emulator's "explorer" link if the PEM public certificate key is available). |
I tried to reproduce the issue locally on VM with ubuntu-20.04 image, but without luck: every time it successfully starts a container. I used the following:
When I tried to execute the same in the ADO pipeline it also passes (at least 5 pipelines pass in a row):
On the other hand, issue still occurs during usage of azure container:
Continuing an investigation... |
Issue definitely don't related to Azure DevOps since the same issue occurs in the GitHub Actions which uses its own GitHub Runner for execution.
|
I've additionally compared the output of "lscpu" command for Ubuntu 20.04 machines where pipeline passed and failed (see failed and passed) and machines look similar. |
@milismsft @DOMZE could you please reopen related issue (Azure/azure-cosmos-dotnet-v3#3010) for tracking? We are going to close this issue since it looks unrelated to image generation and should be investigated on the owners side. Feel free to contact us for assistance. |
@DOMZE I opened Azure/azure-cosmos-db-emulator-docker#45 for tracking purposes. |
@milismsft we discussed with you that it's not related to machines. Also issue occurs on both Azure Agents and GitHub Runners which use different services. Your ticket to Azure team without logs and links will not take affect... |
Description
Copied from Azure/azure-cosmos-dotnet-v3#3010
Describe the bug
Using Azure DevOps and a ubuntu-latest hosted agent, when starting the container, the container returns right away the following:
Additional context
Can't use older images (tags) to see if the code has changes since, as it fails the evaluation time check
Is there something I can add as environment variable to get more logs out to diagnose the problem?
Virtual environments affected
Image version and build link
Agent name: 'Hosted Agent'
Agent machine name: 'fv-az31-196'
Current agent version: '2.198.2'
Operating System
Virtual Environment
Virtual Environment Provisioner
Current image version: '20220131.1'
Agent running as: 'vsts'
Is it regression?
No response
Expected behavior
The container should create the partitions and return "Started" at some point
Actual behavior
The container exits and the logs shows
Repro steps
Create an Azure DevOps pipeline with the following:
The text was updated successfully, but these errors were encountered: