USB CDC crashes when sending data too fast

I have the problem that when I send too much data via USB CDC without delay, it happens that data is lost or the entire connection crashes. Apparently I also can not query if the buffer is full to send, so I could wait until I send more data. Apart from inserting delays, I don't have a solution to my problem.
The baud rate for the USB CDC connection does not seem to affect the problem. So the picture is the same at 2MBoud as well as 9600 baud. The Mircocontroller (ESP-S2) does not crash every time.
Code:
#include <Arduino.h>
#include "FFat.h"
#include "SD.h" //only because of a copiler error
#include "cdcusb.h"
CDCusb USBSerial;

bool MyUSBconnect = false;
class MyUSBCallbacks : public CDCCallbacks {
  void onCodingChange(cdc_line_coding_t const *p_line_coding)  {
    USBSerial.flush();
    int bitrate = USBSerial.getBitrate();
    log_d("new bitrate: %d\n", bitrate);
  }

  bool onConnect(bool dtr, bool rts)  {
    if (dtr & rts)
      MyUSBconnect = true;
    else
      MyUSBconnect = false;
    log_d("connection state changed, dtr: %d, rts: %d\n", dtr, rts);
    return true; // allow to persist reset, when Arduino IDE is trying to enter bootloader mode
  }
};

void setup() {
  Serial.begin(115200);

  USBSerial.setCallbacks(new MyUSBCallbacks());
  if (!USBSerial.begin())
    Serial.println("Failed to start CDC USB stack");
}

void loop() {
  if (MyUSBconnect)  {
    for (int i = 01; i <= 20; i++)  {
      USBSerial.print(i);
      USBSerial.write(' ');
    }
    Serial.print("+");
  }
}

Output USB CDC:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 1314 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18K]
???j??
h"?@?0??
#????XL? ?xV`4T ?

Output UART:
ESP-ROM:esp32s2-rc4-20191025<\r><\n>
Build:Oct 25 2019<\r><\n>
rst:0x1 (POWERON),boot:0x9 (SPI_FAST_FLASH_BOOT)<\r><\n>
SPIWP:0xee<\r><\n>
mode:DIO, clock div:1<\r><\n>
load:0x3ffe6100,len:0x524<\r><\n>
load:0x4004c000,len:0xa50<\r><\n>
load:0x40050000,len:0x28cc<\r><\n>
entry 0x4004c18c<\r><\n>
[   498][D][usb_descriptors.cpp:45] getConfigurationDescriptor(): descriptor length: 75<\r><\n>
<\r><\n>
[   498][D][esptinyusb.cpp:53] esptinyusbtask(): [esptinyusbtask] USB tud_task created<\r><\n>
[  1220][D][main.cpp:18] onCodingChange(): new bitrate: 9600<\r><\n>
<\r><\n>
[  5080][D][main.cpp:27] onConnect(): connection state changed, dtr: 1, rts: 1<\r><\n>
<\r><\n>
+++[  5084][D][main.cpp:18] onCodingChange(): new bitrate: 115200<\r><\n>
<\r><\n>
Guru Meditation Error: Core  0 panic'ed (LoadStoreError).
Im not sure, but try to not call USBSerial.flush(); from withing callback.

Hi thank you for the extremely fast feedback. Unfortunately it makes no difference if I call USBSerial.flush(); or not. Even if I don't define any callbacks myself the behavior is the same. I have tried to isolate the problem.
Using USBSerial.print(i); causes the ESP32-S2 to crash. USBSerial.print((char)i); as well as USBSerial.write(i); work as expected.
#include <Arduino.h>
#include "FFat.h"
#include "SD.h" //only because of a copiler error
#include "cdcusb.h"
CDCusb USBSerial;

void setup()
{
  if (!USBSerial.begin())
    return;
}

void loop() {
  for (int i = 48; i <= 90; i++)
  {
    // USBSerial.print((char)i); // is working good
    // USBSerial.print(i); // crash the ESP32-S2
    USBSerial.write(i); // is working good
  }
  USBSerial.write('\n');
}

Output USB CDC:
0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ
012345678VWXYZ
0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789:;<=>?@ABCDEFGH;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVZ
0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ
DEFGHIJKLMNOPQRSTUVWXYZ
0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW
0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ

Unfortunately I do not know how to solve the problem with the non-transmitted characters.

As a small addition:
USBSerial.printf("%c", i); works very well in the output. There are not even missing characters in the output. The speed is also only about 60000 characters per second (before about twice as high). But only if a single character is to be output. If three or more characters are to be output USBSerial.printf("%c%c%c", i, i, i); there are considerable problems.

USBSerial.write(i); is returning value, if its 0 then its not sent. Maybe try to check return value.

The CDC class inherit from Stream:
class EspTinyUSB : public Stream
but i never been testing it actually, i just assumed it should works. It is possible that print, printf and other functions from Stream may cause the problems or slow down USB.
I would suggest to use write() and to check return value.

Thank you for the wonderful tip. I will have to find a better solution but it works without errors and lost characters. The speed is about 128000 characters per second.
#include <Arduino.h>
#include "FFat.h"
#include "SD.h" //only because of a copiler error
#include "cdcusb.h"
CDCusb USBSerial;

void setup()
{
  if (!USBSerial.begin())
    return;
}

inline void USBSerial_write(int c) { while (!USBSerial.write(c)); }

void loop()
{
  for (int i = 48; i <= 90; i++)
  {
    // USBSerial.print((char)i);     // works but characters are lost
    // USBSerial.print(i);           // crash the ESP32-S2
    // USBSerial.write(i);           // works but characters are lost
    // USBSerial.printf("%c", i);    // works
    // USBSerial.printf("%c%c%c", i);// crash the ESP32-S2
    USBSerial_write(i); // works best
  }
  USBSerial_write('\n');
}

To prevent others from using my solution you should use the following function instead of USBSerial.write(c);:
USBSerial.write(&i, 1);
The function is much safer to use because it checks if a serial connection exists and makes sure that the data is sent. What happens if the connection is disconnected while the data is being sent I don't know.
What I wonder now, however, if when using .write(c) the data is written into a buffer and only if too much data is written in is it also overwritten. Or what is probably the reason for the disappearance of the characters?

Sorry, i am not working with USB for very long time now (over 12-18 months i think), so i cant answer your questions, especially that original tinyusb library is still evolving.
I am wondering why you are sending only 1 byte at the time (i hope it is for tests purpose only), because with more bytes per transaction you will get higher bitrate.

Thanks in any case for the help. But there seems to be a problem that I can't output so many characters (more than 4). My actual code also outputs several characters directly and not just one.
  uint8_t test[] = "\n0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  USBSerial.write(test, 4);           // working good
  USBSerial.write(test, 5);           // crash the ESP32-S2
  USBSerial.write(test, sizeof(test) - 1); // crash the ESP32-S2

https://github.com/espressif/arduino-esp32#decoding-exceptions

  #0  0x4001aca2:0x3ffcaf80 in ?? ??:0
  #1  0x4008ca3f:0x3ffcaf90 in _ff_push_n at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/components/arduino_tinyusb/tinyusb/src/common/tusb_fifo.c:183
      (inlined by) _tu_fifo_write_n at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/components/arduino_tinyusb/tinyusb/src/common/tusb_fifo.c:488
  #2  0x4008cbd5:0x3ffcafd0 in _tu_fifo_write_n at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/components/arduino_tinyusb/tinyusb/src/common/tusb_fifo.c:461
      (inlined by) tu_fifo_write_n at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/components/arduino_tinyusb/tinyusb/src/common/tusb_fifo.c:784
  #3  0x4008c3fb:0x3ffcaff0 in tud_cdc_n_write at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/components/arduino_tinyusb/tinyusb/src/class/cdc/cdc_device.c:171
  #4  0x40081540:0x3ffcb010 in CDCusb::write(unsigned char const*, unsigned int) at .pio/libdeps/esp32-s2-saola-1/ESP32TinyUSB/src/device/cdc/cdcusb.cpp:115 (discriminator 4)
  #5  0x40081473:0x3ffcb030 in loop() at src/main.cpp:18
  #6  0x400831d0:0x3ffcb050 in loopTask(void*) at /home/steffen/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:50

Well, its not very helpful, but you could try to add delay(1) after this line:
https://github.com/chegewara/EspTinyUSB/blob/master/src/device/cdc/cdcusb.cpp#L107

With the delay, the error does not occur.

Sorry, that was probably written too quickly. The error is less frequent but the message is the same.

The following clearly shows the error. It seems that the limitation of the length does not work.
Code:
uint8_t test[] = "\n0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ please don't show!";
USBSerial.write(test, 37); // crash the ESP32-S2

Ouput:
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ please don't show!:0K??0??@@????@??A??x?d????
?l??????@?@?A??@?@@A?@@|	@??4o@4o@y@D:?@4o@4o@4o@4o@4o@E@p?$p@4o@`@4o@

I think I have found the error in the code.
(size - d) > 0  this is always true when size > 0. Both are types of uint and the result is therefore also positive. In tud_cdc_n_write I have not been able to trace the set buffer size. In my opinion it must be (size - d).
https://github.com/chegewara/EspTinyUSB/blob/master/src/device/cdc/cdcusb.cpp#L106-L108
do {
  d += tud_cdc_n_write(_itf, buffer + d, size - d);
} while ((int)(size - d) > 0 || d == 0);


Add OpenAI multimodal prompting

Allow for passing in multimodal objects into OpenAI or AzureOpenAI APIs.

See https://platform.openai.com/docs/guides/vision


Cannot write commands to Azure CLI Image

I am using the Azure CLI Docker Image with the Docker.DotNet.
I would like to pass command line commands to the CLI and get the response.
Code So Far
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Docker.DotNet;
using Docker.DotNet.Models;
using Docker.Services;

namespace Docker
{
    class Program
    {
        const string deamonUrl = "tcp://localhost:2375";
        private static DockerClient _client;

        static async Task Main(string[] args)
        {

            _client = new DockerClientConfiguration(
                new Uri(deamonUrl))
                .CreateClient();

            var imageName = "mcr.microsoft.com/azure-cli:latest";
            var images = new Images(_client);
                Console.WriteLine($"Create Image {imageName}");
                await images.CreateImage(imageName);

            var createContainerParams = new CreateContainerParameters
            {
                Image = imageName,
                ArgsEscaped = true,
                AttachStderr = true,
                AttachStdin = true,
                AttachStdout = true,
                OpenStdin = true,
                Entrypoint = new []{"bash"}
            };

            Console.WriteLine($"Create Container {imageName}");
            var container = await _client.Containers.CreateContainerAsync(createContainerParams);

            Console.WriteLine($"Container ID: ${container.ID}");
            if (container.Warnings.Any())
                foreach (var warning in container.Warnings)
                    Console.WriteLine($"Warning (${container.ID}): ${warning} ");

            Console.WriteLine($"Start Container {container.ID}");
            var containerStarted =
                await _client.Containers.StartContainerAsync(container.ID, new ContainerStartParameters());

            Console.WriteLine($"Container {container.ID} Started ${containerStarted}");

            const string appUser = "";
            const string appPassword = "";
            const string appTenant = "";
            var servicePrincipalSignIn =
                $"az login --service-principal -u {appUser} -p {appPassword} --tenant {appTenant}";
            var servicePrincipalSignInCommands = servicePrincipalSignIn.Split(" ").ToList();
                Console.WriteLine(" ------  LOGIN ------ ");
                await WriteExec(container.ID, servicePrincipalSignInCommands );

              var userScript = $"az account list{Environment.NewLine}rgName=\"nancytest\" {Environment.NewLine} vmlist=$(az account list) {Environment.NewLine} echo $vmlist {Environment.NewLine} echo 'script has run'";
                var userCommands = userScript.Split(Environment.NewLine).ToList();
                var bashCommands = new List<string>{"bash"};
                Console.WriteLine(" ------  WRITE STREAM ------ ");
                await dockerExec.WriteExec(containerId, bashCommands,"",userScript);
                Console.WriteLine(" ------  WRITE COMMAND ------ ");
                await dockerExec.WriteExec(containerId, userCommands);

    }

    private static async Task WriteExec(string containerId, List<string> commands, string commandStr = "")
        {
            var containerExecCreate = new ContainerExecCreateParameters
            {
                AttachStderr = true,
                AttachStdin = true,
                AttachStdout = true,
                Cmd = commands,
                Detach = true,
                Tty = true,
                Privileged = true
            };
            var execCreateResponse = await _client.Exec.ExecCreateContainerAsync(containerId, containerExecCreate);

            using var multiplexedStream = await _client.Exec.StartWithConfigContainerExecAsync(execCreateResponse.ID,
                new ContainerExecStartParameters { Detach=false,Tty=false});

            if (!string.IsNullOrEmpty(commandStr))
                await WriteCommandToStream(multiplexedStream, commandStr);

            await ReadOutputAsync(multiplexedStream);

            multiplexedStream.CloseWrite();
            multiplexedStream.Dispose();
        }

    private static async Task WriteCommandToStream(MultiplexedStream multiplexedStream, string command, CancellationToken cancellationToken = default)
        {
            Console.WriteLine("Write Command");
            var wsBuffer = Encoding.UTF8.GetBytes(command);
            await multiplexedStream.WriteAsync(wsBuffer.Concat(Encoding.ASCII.GetBytes(Environment.NewLine)).ToArray(), 0, wsBuffer.Length, default);
        }

    private static async Task ReadOutputAsync(MultiplexedStream multiplexedStream, CancellationToken cancellationToken = default)
        {
            Console.WriteLine("Read OutPut");

            var dockerBuffer = System.Buffers.ArrayPool<byte>.Shared.Rent(81920);
            try
            {
                while (true)
                {
                    // Clear buffer
                    Array.Clear(dockerBuffer, 0, dockerBuffer.Length);
                    var dockerReadResult = await multiplexedStream.ReadOutputAsync(dockerBuffer, 0, dockerBuffer.Length, cancellationToken);

                    if (dockerReadResult.EOF)
                        break;

                    if (dockerReadResult.Count > 0)
                    {
                        var responseLine = Encoding.Default.GetString(dockerBuffer, 0, dockerReadResult.Count);
                        responseLine = responseLine
                            .Replace(@"\?\[0m", "")
                            .Replace("?[m", "")
                            .Replace("?[1;34", "");
                        Console.WriteLine(responseLine);
                    }
                    else
                        break;
                }
            }
            catch (Exception ex)
            {
                //_logger.LogError(ex, "Failure during Read from Docker Exec to WebSocket");
            }
            System.Buffers.ArrayPool<byte>.Shared.Return(dockerBuffer);
        }
}
}

Output of dotnet --info:
.NET SDK (reflecting any global.json):
 Version:   5.0.101
 Commit:    d05174dc5a

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.18363
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\5.0.101\

Host (useful for support):
  Version: 5.0.1
  Commit:  b02e13abab

.NET SDKs installed:
  2.1.511 [C:\Program Files\dotnet\sdk]
  3.1.101 [C:\Program Files\dotnet\sdk]
  3.1.102 [C:\Program Files\dotnet\sdk]
  3.1.301 [C:\Program Files\dotnet\sdk]
  5.0.101 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

What version of Docker.DotNet?:
 Version=<IP_ADDRESS>

Steps to reproduce the issue:

run the code above (sorry if can't copy/paste to run I have it in a larger project)

What actually happened?:
The WRITE COMMAND failed as below
 ------ LOGIN -----
Read OutPut
[
  {
    "cloudName": "AzureCloud",
    "homeTenantId": "00000-a490-4728-00000-1d1446b68e5e",
    "id": "00000-1e7c-408e-00000-eee54781a586",
    "isDefault": true,
    "managedByTenants": [],
    "name": "Development",
    "state": "Enabled",
    "tenantId": "00000-a490-4728-00000-1d1446b68e5e",
    "user": {
      "name": "00000-1143-4d84-00000-d792cda35e29",
      "type": "servicePrincipal"
    }
  }
]

?[0m

 ------  WRITE COMMAND ------
Read OutPut
OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "$Accounts=$(ac account list)": executable file not found in $PATH: unknown

The WRITE STREAM fails as it stops after the last command in the ReadOutputAsync and no breakpoints in the method get hit after running this and the program does not complete.
What did you expect to happen?:
It to run each command given to it.
Additional information:

Out of curiosity I tried to execute what you are trying to do.
Is there any way to validate command execution within an azure-cli container without having to log in?

Out of curiosity I tried to execute what you are trying to do.
Is there any way to validate command execution within an azure-cli container without having to log in?

Sorry my code is getting a mess trying everything.

Out of curiosity I tried to execute what you are trying to do.
Is there any way to validate command execution within an azure-cli container without having to log in?

If I pass in the below to the CMD of the ExecCreateContainerAsync parameters.
az acount list

I get
OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "az account list": executable file not found in $PATH: unknown

If i pass it to the WriteAsync in the method WriteCommandToStream it does run the commands, but it gets stuck in the ReadOutputAsync after the last command.
The console does nothing and the breakpoints never get hit.
I have updated the code to show what is happenning better

Sorry my code is getting a mess trying everything.

Out of curiosity I tried to execute what you are trying to do.
Is there any way to validate command execution within an azure-cli container without having to log in?

If I pass in the below to the CMD of the ExecCreateContainerAsync parameters.
az acount list

I get
OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "az account list": executable file not found in $PATH: unknown

If i pass it to the WriteAsync in the method WriteCommandToStream it does run the commands, but it gets stuck in the ReadOutputAsync after the last command.
The console does nothing and the breakpoints never get hit.
I have updated the code to show what is happenning better

I'll give it a go to the updated code
I found OCI runtime exec failed: exec failed: container_linux.go:370 has many search results, it may help you
https://www.google.com/search?q="OCI+runtime+exec+failed%3A+exec+failed%3A+container_linux.go%3A370"

I'll give it a go to the updated code
I found OCI runtime exec failed: exec failed: container_linux.go:370 has many search results, it may help you
https://www.google.com/search?q="OCI+runtime+exec+failed%3A+exec+failed%3A+container_linux.go%3A370"

I have hunted around a lot of them but they are mostly about versions,
direct docker cli commands or configuring the image like Linux. However, as
I am using the latest versions, Docker.DotNet and a simple CLI image they
don’t relate. I have also ran the image with a simple docker run -i and
everything worked fine.
Therefore, the issue needs to be how I’m getting the command in or reading
it out but cannot nail down where it is(could be Friday brain haha)
On Fri, 22 Jan 2021 at 17:52, David García Vives<EMAIL_ADDRESS>wrote:

I'll give it a go to the updated code
I found OCI runtime exec failed: exec failed: container_linux.go:370 has
many search results, it may help you
https://www.google.com/search?q="OCI+runtime+exec+failed%3A+exec+failed%3A+container_linux.go%3A370"
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/dotnet/Docker.DotNet/issues/484#issuecomment-765583481,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AC5VQD65UCHPRKTOHJOMPTLS3G3PJANCNFSM4WOXJHYQ
.

--
Christopher Pateman
PR Code - Digital Solutions
m:07772410091 |<EMAIL_ADDRESS>|
w: prcode.co.uk

I have hunted around a lot of them but they are mostly about versions,
direct docker cli commands or configuring the image like Linux. However, as
I am using the latest versions, Docker.DotNet and a simple CLI image they
don’t relate. I have also ran the image with a simple docker run -i and
everything worked fine.
Therefore, the issue needs to be how I’m getting the command in or reading
it out but cannot nail down where it is(could be Friday brain haha)
On Fri, 22 Jan 2021 at 17:52, David García Vives<EMAIL_ADDRESS>wrote:

I'll give it a go to the updated code
I found OCI runtime exec failed: exec failed: container_linux.go:370 has
many search results, it may help you
https://www.google.com/search?q="OCI+runtime+exec+failed%3A+exec+failed%3A+container_linux.go%3A370"
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/dotnet/Docker.DotNet/issues/484#issuecomment-765583481,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AC5VQD65UCHPRKTOHJOMPTLS3G3PJANCNFSM4WOXJHYQ
.

--
Christopher Pateman
PR Code - Digital Solutions
m:07772410091 |<EMAIL_ADDRESS>|
w: prcode.co.uk

From here: https://stackoverflow.com/questions/65351951/docker-how-do-i-format-a-cmd-entrypoint-to-run-my-client-and-server-in-the-same
await WriteExec(container.ID, new List<string> { "az", "find", "secret" });

await WriteExec(container.ID, new List<string> { "az find secret" });

First way works, second one fails. Looks familiar?

From here: https://stackoverflow.com/questions/65351951/docker-how-do-i-format-a-cmd-entrypoint-to-run-my-client-and-server-in-the-same
await WriteExec(container.ID, new List<string> { "az", "find", "secret" });

await WriteExec(container.ID, new List<string> { "az find secret" });

First way works, second one fails. Looks familiar?

From here: https://stackoverflow.com/questions/65351951/docker-how-do-i-format-a-cmd-entrypoint-to-run-my-client-and-server-in-the-same
await WriteExec(container.ID, new List<string> { "az", "find", "secret" });

await WriteExec(container.ID, new List<string> { "az find secret" });

First way works, second one fails. Looks familiar?
edit
It definitely has something to do with how commands are specified. Keep in mind this library is just a wrapper around docker api
https://docs.docker.com/engine/api/v1.41/#operation/ContainerExec

The issue is I am expecting a string of commands into this program, so the only way I would get that to work would be to split by space, but then if anyone uses $(az account list) for example they it breaks it up and fails.
This is why I tried to get it to work by writing to the stream.
This:
Console.WriteLine(" ------  WRITE COMMAND ------ ");
                var userScript = $"az account list{Environment.NewLine}rgName='nancytest'{Environment.NewLine}vmlist=$(az account list) {Environment.NewLine} echo $vmlist {Environment.NewLine} echo 'script has run'";
                var eachCommand = userScript.Split(Environment.NewLine).ToList();
                foreach (var command in eachCommand)
                {
                    await WriteExec(container.ID, command.Split(" ").ToList());
                }

Results to this:
OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "rgName='nancytest'": executable file not found in $PATH: unknown
OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "vmlist=$(az": executable file not found in $PATH: unknown
OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "": executable file not found in $PATH: unknown
OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "": executable file not found in $PATH: unknown

From here: https://stackoverflow.com/questions/65351951/docker-how-do-i-format-a-cmd-entrypoint-to-run-my-client-and-server-in-the-same
await WriteExec(container.ID, new List<string> { "az", "find", "secret" });

await WriteExec(container.ID, new List<string> { "az find secret" });

First way works, second one fails. Looks familiar?
edit
It definitely has something to do with how commands are specified. Keep in mind this library is just a wrapper around docker api
https://docs.docker.com/engine/api/v1.41/#operation/ContainerExec

The issue is I am expecting a string of commands into this program, so the only way I would get that to work would be to split by space, but then if anyone uses $(az account list) for example they it breaks it up and fails.
This is why I tried to get it to work by writing to the stream.
This:
Console.WriteLine(" ------  WRITE COMMAND ------ ");
                var userScript = $"az account list{Environment.NewLine}rgName='nancytest'{Environment.NewLine}vmlist=$(az account list) {Environment.NewLine} echo $vmlist {Environment.NewLine} echo 'script has run'";
                var eachCommand = userScript.Split(Environment.NewLine).ToList();
                foreach (var command in eachCommand)
                {
                    await WriteExec(container.ID, command.Split(" ").ToList());
                }

Results to this:
OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "rgName='nancytest'": executable file not found in $PATH: unknown
OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "vmlist=$(az": executable file not found in $PATH: unknown
OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "": executable file not found in $PATH: unknown
OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "": executable file not found in $PATH: unknown

I have now tried to get the script over as a file instead, but the commands will not work:
Console.WriteLine(" ------  WRITE COMMAND ------ ");
                var dockerExec = new DockerExec(_client);
                var touchCommand = new List<string>
                {
                    $"touch", fileName
                };
                await dockerExec.WriteExec(containerId, touchCommand);
                var echoCommand = new List<string>
                {
                    "echo", $"\"{scriptContent}\"" ,">",fileName
                };
                await dockerExec.WriteExec(containerId, echoCommand);
                var permisionsCommand = new List<string>
                {
                    $"[\"chmod\", \"+x\", \"{fileName}\"]"
                };
                await dockerExec.WriteExec(containerId, permisionsCommand);

Results in
Read OutPut
Read OutPut
"rgName='nascent'??vmlist=$(az account list)??echo $vmlist??echo 'script has run'" > touchfilev2.sh

Read OutPut
OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "[\"chmod\", \"+x\", \"touchfilev2.sh\"]": executable file not found in $PATH
: unknown

I then thought about if I put this all in a Dockerfile and pass the script in as a build Arg. I could the create the image per request and then run the image.
However, I cannot figure out how to either create a new Image from a Dockerfile, clone a docker image or pass the script in via variables?
I tried to archive the Dockerfile into a tar file then:
var fileName = "docker.tar";
var tags= new List<string>
                {
                    imageTag
                };
var buildArgs = new Dictionary<string, string>
                {
                    {"UserScripts", scriptContent}
                }
return await  _client.Images.BuildImageFromDockerfileAsync(new FileStream(fileName, FileMode.Open),
                new ImageBuildParameters
                {
                    Remove = false,
                    Tags = tags,
                    BuildArgs = buildArgs
                });

This runs with no errors, but there is also no Image created.

I have now tried to get the script over as a file instead, but the commands will not work:
Console.WriteLine(" ------  WRITE COMMAND ------ ");
                var dockerExec = new DockerExec(_client);
                var touchCommand = new List<string>
                {
                    $"touch", fileName
                };
                await dockerExec.WriteExec(containerId, touchCommand);
                var echoCommand = new List<string>
                {
                    "echo", $"\"{scriptContent}\"" ,">",fileName
                };
                await dockerExec.WriteExec(containerId, echoCommand);
                var permisionsCommand = new List<string>
                {
                    $"[\"chmod\", \"+x\", \"{fileName}\"]"
                };
                await dockerExec.WriteExec(containerId, permisionsCommand);

Results in
Read OutPut
Read OutPut
"rgName='nascent'??vmlist=$(az account list)??echo $vmlist??echo 'script has run'" > touchfilev2.sh

Read OutPut
OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "[\"chmod\", \"+x\", \"touchfilev2.sh\"]": executable file not found in $PATH
: unknown

I then thought about if I put this all in a Dockerfile and pass the script in as a build Arg. I could the create the image per request and then run the image.
However, I cannot figure out how to either create a new Image from a Dockerfile, clone a docker image or pass the script in via variables?
I tried to archive the Dockerfile into a tar file then:
var fileName = "docker.tar";
var tags= new List<string>
                {
                    imageTag
                };
var buildArgs = new Dictionary<string, string>
                {
                    {"UserScripts", scriptContent}
                }
return await  _client.Images.BuildImageFromDockerfileAsync(new FileStream(fileName, FileMode.Open),
                new ImageBuildParameters
                {
                    Remove = false,
                    Tags = tags,
                    BuildArgs = buildArgs
                });

This runs with no errors, but there is also no Image created.

@PureRandom I would suggest you build a custom image on top of Azure CLI but adding a sshd daemon, create a container based on that image, and connect to the container using some ssh library.
That way you would be able to execute any command and get the output.
I've never tried to interact with a docker container the way you are doing, but I can tell you I had success with a custom database image using this approach.
https://github.com/dgvives/base-mysql-windows-docker

@PureRandom I would suggest you build a custom image on top of Azure CLI but adding a sshd daemon, create a container based on that image, and connect to the container using some ssh library.
That way you would be able to execute any command and get the output.
I've never tried to interact with a docker container the way you are doing, but I can tell you I had success with a custom database image using this approach.
https://github.com/dgvives/base-mysql-windows-docker

@PureRandom I would suggest you build a custom image on top of Azure CLI but adding a sshd daemon, create a container based on that image, and connect to the container using some ssh library.
That way you would be able to execute any command and get the output.
I've never tried to interact with a docker container the way you are doing, but I can tell you I had success with a custom database image using this approach.
https://github.com/dgvives/base-mysql-windows-docker

This is an option I will explore, but I would have thought there would be a way with the Docker API to send bigger commands or even send a file over.
I think I could do it if I could even create the file through creating the docker image but that doesn't work.

@PureRandom I would suggest you build a custom image on top of Azure CLI but adding a sshd daemon, create a container based on that image, and connect to the container using some ssh library.
That way you would be able to execute any command and get the output.
I've never tried to interact with a docker container the way you are doing, but I can tell you I had success with a custom database image using this approach.
https://github.com/dgvives/base-mysql-windows-docker

This is an option I will explore, but I would have thought there would be a way with the Docker API to send bigger commands or even send a file over.
I think I could do it if I could even create the file through creating the docker image but that doesn't work.

@PureRandom I would suggest you build a custom image on top of Azure CLI but adding a sshd daemon, create a container based on that image, and connect to the container using some ssh library.
That way you would be able to execute any command and get the output.
I've never tried to interact with a docker container the way you are doing, but I can tell you I had success with a custom database image using this approach.
https://github.com/dgvives/base-mysql-windows-docker

This is an option I will explore, but I would have thought there would be a way with the Docker API to send bigger commands or even send a file over.
I think I could do it if I could even create the file through creating the docker image but that doesn't work.

I have got it all working over SSH, but I would like to keep this ticket open for if someone knows how I would either:

Able to run a script from client to docker container
Send script file from client to docker container
Create Docker Image from Dockerfile

If I can get it working like one of the above then I remove the requirement for SSH, which shrinks the image size, build time and security concerns.

@PureRandom I would suggest you build a custom image on top of Azure CLI but adding a sshd daemon, create a container based on that image, and connect to the container using some ssh library.
That way you would be able to execute any command and get the output.
I've never tried to interact with a docker container the way you are doing, but I can tell you I had success with a custom database image using this approach.
https://github.com/dgvives/base-mysql-windows-docker

This is an option I will explore, but I would have thought there would be a way with the Docker API to send bigger commands or even send a file over.
I think I could do it if I could even create the file through creating the docker image but that doesn't work.

I have got it all working over SSH, but I would like to keep this ticket open for if someone knows how I would either:

Able to run a script from client to docker container
Send script file from client to docker container
Create Docker Image from Dockerfile

If I can get it working like one of the above then I remove the requirement for SSH, which shrinks the image size, build time and security concerns.

For point 3, I know they are creating containers from dockerfile in https://github.com/Deffiss/testenvironment-docker
However, these are questions about how to use docker api and not issues, don't you agree?

For point 3, I know they are creating containers from dockerfile in https://github.com/Deffiss/testenvironment-docker
However, these are questions about how to use docker api and not issues, don't you agree?

For point 3, I know they are creating containers from dockerfile in https://github.com/Deffiss/testenvironment-docker
However, these are questions about how to use docker api and not issues, don't you agree?

That link might be very helpful for how I do things so thank you.
I do in part agree that this is just a method of using the Docker API, but that is sort of what I am looking for.
How do I use this Docker.DotNet to do what I require?
I would have thought/hoped someone would know how even point 2 would be possible.

For point 3, I know they are creating containers from dockerfile in https://github.com/Deffiss/testenvironment-docker
However, these are questions about how to use docker api and not issues, don't you agree?

That link might be very helpful for how I do things so thank you.
I do in part agree that this is just a method of using the Docker API, but that is sort of what I am looking for.
How do I use this Docker.DotNet to do what I require?
I would have thought/hoped someone would know how even point 2 would be possible.


az vm format-secret fails with error Parameter ‘resource_group_name’ can not be None.

Environment summary
Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
Docker:
docker run -v ${HOME}:/root -it azuresdk/azure-cli-python:latest
CLI Version: What version of the CLI and modules are installed? (Use az --version)
azure-cli (2.0.2+dev)
acr (2.0.0+dev)
acs (2.0.2+dev)
appservice (0.1.2+dev)
batch (2.0.0+dev)
cloud (2.0.0+dev)
component (2.0.0+dev)
configure (2.0.2+dev)
container (0.1.2+dev)
core (2.0.2+dev)
dla (0.0.1+dev)
dls (0.0.1+dev)
documentdb (0.1.2+dev)
feedback (2.0.0+dev)
find (0.0.1b1+dev)
iot (0.1.2+dev)
keyvault (2.0.0+dev)
lab (0.0.1+dev)
monitor (0.0.1+dev)
network (2.0.2+dev)
nspkg (2.0.0+dev)
profile (2.0.2+dev)
redis (0.1.1b3+dev)
resource (2.0.2+dev)
role (2.0.1+dev)
sql (2.0.0+dev)
storage (2.0.2+dev)
taskhelp (0.1.1b4+dev)
vm (2.0.2+dev)
Python (Linux) 3.5.2 (default, Dec 27 2016, 21:33:11)
[GCC 5.3.0]
OS Version: What OS and version are you using?
Alpine 3.4.6
Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
GNU bash, version 4.3.42(1)-release (x86_64-alpine-linux-musl)

Description
I'm following through the steps add a secret from Key Vault when creating a VM. The steps as indicated in various parts of the CLI help and ref content should be:
az keyvault create --resource-group resourcegroupname --name vaultname --enabled-for-deployment

az keyvault certificate create --vault-name vaultname -n cert1 \
    -p "$(az keyvault certificate get-default-policy)"

secrets=$(az keyvault secret list-versions --vault-name vaultname \
    -n cert1 --query "[?attributes.enabled].id" -o tsv)

vm_secrets=$(az vm format-secret -s "$secrets")

az vm create -g group-name -n vm-name --admin-username deploy  \
    --image debian --secrets "$vm_secrets"

When it comes to az vm format-secret, I receive the error: Parameter ‘resource_group_name’ can not be None.. I can't see anything in the commands that have me define a resource group, other than when you first create the Key Vault.
$secrets is defined:
echo $secrets
https://mykeyvault9780.vault.azure.net/secrets/myCert/5e7e56fa361a45b1bdb7bfb61c8b2d0b

Full debug output:
bash-4.3# az vm format-secret --secrets $secrets --debug
Command arguments [‘vm’, ‘format-secret’, ‘--secrets’, ’https://mykeyvault9780.vault.azure.net/secrets/myCert/5e7e56fa361a45b1bdb7bfb61c8b2d0b']
Current active cloud ‘AzureCloud’
{‘active_directory’: ‘https://login.microsoftonline.com’,
 ‘active_directory_graph_resource_id’: ‘https://graph.windows.net/’,
 ‘active_directory_resource_id’: ‘https://management.core.windows.net/’,
 ‘batch_resource_id’: None,
 ‘gallery’: ‘https://gallery.azure.com/’,
 ‘management’: ‘https://management.core.windows.net/’,
 ‘resource_manager’: ‘https://management.azure.com/’,
 ‘sql_management’: ‘https://management.core.windows.net:8443/’}
{‘azure_datalake_analytics_catalog_and_job_endpoint’: ‘azuredatalakeanalytics.net’,
 ‘azure_datalake_store_file_system_endpoint’: ‘azuredatalakestore.net’,
 ‘keyvault_dns’: ‘.vault.azure.net’,
 ‘sql_server_hostname’: ‘.database.windows.net’,
 ‘storage_endpoint’: ‘core.windows.net’}
Registered application event handler ‘CommandTableParams.Loaded’ at <function add_id_parameters at 0x7f5b4c539f28>
Registered application event handler ‘CommandTable.Loaded’ at <function add_id_parameters at 0x7f5b4c539f28>
Successfully loaded command table from module ‘vm’.
Application event ‘CommandTable.Loaded’ with event data {‘command_table’: {‘vm format-secret’: <azure.cli.core.commands.CliCommand object at 0x7f5b4c52ba20>}}
Application event ‘CommandParser.Loaded’ with event data {‘parser’: AzCliCommandParser(prog=‘az’, usage=None, description=None, formatter_class=<class ‘argparse.HelpFormatter’>, conflict_handler=‘error’, add_help=True)}
Application event ‘CommandTableParams.Loaded’ with event data {‘command_table’: {‘vm format-secret’: <azure.cli.core.commands.CliCommand object at 0x7f5b4c52ba20>}}
Application event ‘CommandParser.Parsed’ with event data {‘command’: ‘vm format-secret’, ‘args’: Namespace(_command_package=‘vm’, _jmespath_query=None, _log_verbosity_debug=False, _log_verbosity_verbose=False, _output_format=‘json’, _parser=AzCliCommandParser(prog=‘az vm format-secret’, usage=None, description=‘Format secrets to be used in `az vm create --secrets`’, formatter_class=<class ‘argparse.HelpFormatter’>, conflict_handler=‘error’, add_help=True), _validators=[], certificate_store=None, command=‘vm format-secret’, func=<function create_ [...]
Getting management service client client_type=KeyVaultManagementClient
msrest.pipeline : Adding ‘log_request’ callback before event: ‘request’
msrest.pipeline : Callback to overwrite original call: False
msrest.pipeline : Adding ‘log_response’ callback after event: ‘response’
msrest.pipeline : Callback to overwrite original call: False
Getting management service client client_type=KeyVaultManagementClient
msrest.pipeline : Adding ‘log_request’ callback before event: ‘request’
msrest.pipeline : Callback to overwrite original call: False
msrest.pipeline : Adding ‘log_response’ callback after event: ‘response’
msrest.pipeline : Callback to overwrite original call: False
adal-python : 41f7dd6a-7e13-458a-9461-32437bfbd54f - Authority:Performing instance discovery: https://login.microsoftonline.com/a4442dcc-ce0e-4940-a367-3029b469f0e5
adal-python : 41f7dd6a-7e13-458a-9461-32437bfbd54f - Authority:Performing static instance discovery
adal-python : 41f7dd6a-7e13-458a-9461-32437bfbd54f - Authority:Authority validated via static instance discovery
adal-python : 41f7dd6a-7e13-458a-9461-32437bfbd54f - TokenRequest:Getting token from cache with refresh if necessary.
adal-python : 41f7dd6a-7e13-458a-9461-32437bfbd54f - OAuth2Client:finding with query: {“userId”<EMAIL_ADDRESS>“_clientId”: “04b07795-8ddb-461a-bbee-02f9e1bf7b46"}
adal-python : 41f7dd6a-7e13-458a-9461-32437bfbd54f - OAuth2Client:Looking for potential cache entries:
adal-python : 41f7dd6a-7e13-458a-9461-32437bfbd54f - OAuth2Client:{“userId”<EMAIL_ADDRESS>“_clientId”: “04b07795-8ddb-461a-bbee-02f9e1bf7b46"}
adal-python : 41f7dd6a-7e13-458a-9461-32437bfbd54f - OAuth2Client:Found 4 potential entries.
adal-python : 41f7dd6a-7e13-458a-9461-32437bfbd54f - OAuth2Client:Resource specific token found.
adal-python : 41f7dd6a-7e13-458a-9461-32437bfbd54f - OAuth2Client:Returning token from cache lookup, AccessTokenId: b’MqjdOlWQCE29wpKQ75otCiN7o7SUEQhrU7T08BSJa8M=‘, RefreshTokenId: b’vTxz8td408Z0YP/0aj1wL3IR3kOXlwZW0DxqD5KnrUs=’
msrest.pipeline : Configuring request: timeout=100, verify=True, cert=None
msrest.pipeline : Configuring redirects: allow=True, max=30
msrest.pipeline : Configuring proxies: ‘’
msrest.pipeline : Evaluate proxies against ENV settings: True
msrest.pipeline : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
msrest.http_logger : Request URL: ‘https://management.azure.com/subscriptions/<snip>/resources?$filter=resourceType%20eq%20%27Microsoft.KeyVault%2Fvaults%27&api-version=2015-11-01’
msrest.http_logger : Request method: ‘GET’
msrest.http_logger : Request headers:
msrest.http_logger :     ‘User-Agent’: ‘python/3.5.2 (Linux-4.9.12-moby-x86_64-with) requests/2.13.0 msrest/0.4.7 msrest_azure/0.4.7 keyvaultmanagementclient/0.30.0 Azure-SDK-For-Python AZURECLI/2.0.2+dev’
msrest.http_logger :     ‘Connection’: ‘keep-alive’
msrest.http_logger :     ‘Accept-Encoding’: ‘gzip, deflate’
msrest.http_logger :     ‘Accept’: ‘application/json’
msrest.http_logger :     ‘Authorization’: ‘*****’
msrest.http_logger :     ‘x-ms-client-request-id’: ‘d8127b9e-1ef2-11e7-bbd5-0242ac110002’
msrest.http_logger :     ‘CommandName’: ‘vm format-secret’
msrest.http_logger :     ‘Content-Type’: ‘application/json; charset=utf-8’
msrest.http_logger :     ‘accept-language’: ‘en-US’
msrest.http_logger : Request body:
msrest.http_logger : None
requests.packages.urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com
requests.packages.urllib3.connectionpool : https://management.azure.com:443 “GET /subscriptions/<snip>/resources?$filter=resourceType%20eq%20%27Microsoft.KeyVault%2Fvaults%27&api-version=2015-11-01 HTTP/1.1” 200 305
msrest.http_logger : Response status: 200
msrest.http_logger : Response headers:
msrest.http_logger :     ‘Cache-Control’: ‘no-cache’
msrest.http_logger :     ‘Pragma’: ‘no-cache’
msrest.http_logger :     ‘Content-Type’: ‘application/json; charset=utf-8’
msrest.http_logger :     ‘Content-Encoding’: ‘gzip’
msrest.http_logger :     ‘Expires’: ‘-1’
msrest.http_logger :     ‘Vary’: ‘Accept-Encoding’
msrest.http_logger :     ‘x-ms-ratelimit-remaining-subscription-reads’: ‘14999’
msrest.http_logger :     ‘x-ms-request-id’: ‘fd5a10bc-04a6-4185-a915-8bc6a89d8221’
msrest.http_logger :     ‘x-ms-correlation-request-id’: ‘fd5a10bc-04a6-4185-a915-8bc6a89d8221’
msrest.http_logger :     ‘x-ms-routing-request-id’: ‘WESTUS:20170411T201002Z:fd5a10bc-04a6-4185-a915-8bc6a89d8221’
msrest.http_logger :     ‘Strict-Transport-Security’: ‘max-age=31536000; includeSubDomains’
msrest.http_logger :     ‘Date’: ‘Tue, 11 Apr 2017 20:10:02 GMT’
msrest.http_logger :     ‘Content-Length’: ‘305’
msrest.http_logger : Response content:
msrest.http_logger : b’{“value”:[{“id”:“/subscriptions/<snip>/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myKeyVault18265",“name”:“myKeyVault18265",“type”:“Microsoft.KeyVault/vaults”,“location”:“westus”,“tags”:{}},{“id”:“/subscriptions/<snip>/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myKeyVault9780”,“name”:“myKeyVault9780”,“type”:“Microsoft.KeyVault/vaults”,“location”:“westus”,“tags”:{}}]}'
msrest.exceptions : Parameter ‘resource_group_name’ can not be None.
Parameter ‘resource_group_name’ can not be None.

This behavior also replicates on another machine that was installed from latest interactive script rather than Docker image:
'User-Agent': 'python/2.7.6 (Linux-3.4.0+-x86_64-with-Ubuntu-14.04-trusty) requests/2.13.0 msrest/0.4.7 msrest_azure/0.4.7 keyvaultmanagementclient/0.30.0 Azure-SDK-For-Python AZURECLI/2.0.2'

@devigned can you take a look?  The "regular" keyvault commands look up the resource group from the keyvault name.  It may be that one of the code paths ends up not doing this?

@tjprescott just ran the same thing against master and it worked... Hmm, what's going on?

Furthermore: shall I file an issue for this? The help does not say what is done with whatever is passed here. THEN in addition, there's a vm format-secret that does something FOR This argument, but WHAT is done is not described.
    --secrets                          : One or many Key Vault secrets as JSON strings or files via
                                         '@<file path>' containing '[{ "sourceVault": { "id":
                                         "value" }, "vaultCertificates": [{ "certificateUrl":
                                         "value", "certificateStore": "cert store name (only on
                                         windows)"}] }]'.

Okay, there's something in capitalization in resources. If I just go with straight all-lowercase names, this works (I appended my initials to the vault name to make it unique):
az keyvault create --resource-group resourcegroupname --name vaultnameikf --enabled-for-deployment

az keyvault certificate create --vault-name vaultnameikf -n cert1 \
   -p “$(az keyvault certificate get-default-policy)”

secrets=$(az keyvault secret list-versions --vault-name vaultnameikf \
   -n cert1 --query “[?attributes.enabled].id” -o tsv)

vm_secrets=$(az vm format-secret -s “$secrets”)

By twist of fate, we have naming conventions in our docs that typically uses camel-casing. As such, the following fails with the error initially noted:
az keyvault create --resource-group myResourceGroup --name myVaultIKF --enabled-for-deployment

az keyvault certificate create --vault-name myVaultIKF -n cert1 \
   -p “$(az keyvault certificate get-default-policy)”

secrets=$(az keyvault secret list-versions --vault-name myVaultIKF \
   -n cert1 --query “[?attributes.enabled].id” -o tsv)

vm_secrets=$(az vm format-secret -s “$secrets”)

So yes, it does work, but it seems case sensitive. Does this help narrow things down at all?

case-sensitive is considered BAD, as nothing else in the resource system is case-sensitive: resource groups, image names, vm names, whatever casing you pass is preserved for usage, but whatever you ASK for is given to you insensitively.
BTW, @iainfoulds, what do you mean, "work"? What happens? Where do these values end up on the VM?

@squillace Secrets are dropped in to /var/lib/waagent on the VM. For this example, you get a .crt and .prv placed there.

to what end? what happens?

I'm just going on what the help says: nothing. one, doesn't say what's going to happen. Two, doesn't say what you should do with them there. Three, doesn't say anything about any other kind of secrets.

Beyond placing the secrets on the VM? Nothing.
One scenario I'm looking to build out is drop a cert on the VM during deployment, then apply that cert to NGINX site. So, rather than baking certs in to the image, you would pull them from Key Vault. If the cert needs to be renewed or rolled, you don't have to update an entire image to accommodate.
But, back to original issue - yes, case sensitivity isn't great. Hopefully that gives some pointers as to where to look for a fix.

@squillace I like to use this flow to provision an identity onto the machine so that I can access Azure resources like DocumentDb keys or Storage keys via config management tools.

@iainfoulds perhaps, we should be run a to_lower on any incoming string to find the resource group.
Thank you for the details!

@squillace It would be really nice if you could provide a name to the secret, so you could reference the cert by name instead of by fingerprint. It would make rolling the certificate so much easier.

So, is the idea here that it drops "something" on the machine, and cloud-init (in the Linux case) does something with it? What? How do you process these "things" once they get there? I'm waiting to understand how this is not merely customscript, with which I can also pull things.... (ignoring that with that I have to pull the secret in the cli first and then push it with customscript to do something....)

@squillace the point is that you'd have to push this in a custom script. When you do that you have to access to the secret and pull it down to semi secure environment (your dev or deployment machine). In the vm-secrets model, fabric puts the secret onto the machine, so it never touches the outside world.

Still no fix available for this ? I ran into this problem with Azure CLI version 2.0.20.

close stable issue. feel free to create new issue if any error met. thanks.


Import/export parameter data to SSV

Export model parameters to System Structure Parameter Values (SSV)
Import model parameters from SSV
Units are automatically converted whenever possible
Added SI-unit exponentials to all default base units in Hopsan, according to SSP and FMI standards.

Did you forget to push the changes?

Sorry, I thought I pushed it by my internet connection was a little unstable yesterday. Now all changes should be up-to-date.


Please use metadata.Labels in nse-composition example

We should use there
https://github.com/networkservicemesh/deployments-k8s/blob/main/examples/features/nse-composition/passthrough-1.yaml#L25 a ref to https://github.com/networkservicemesh/deployments-k8s/blob/main/examples/features/nse-composition/passthrough-1.yaml#L13-L14
Solution

Add to NSM_LABELS ref to  https://github.com/networkservicemesh/deployments-k8s/blob/main/examples/features/nse-composition/passthrough-1.yaml#L13-L14 // See at ref example https://github.com/networkservicemesh/deployments-k8s/blob/main/examples/features/nse-composition/passthrough-1.yaml#L29-L32
Replace app label to https://github.com/networkservicemesh/deployments-k8s/blob/main/examples/features/nse-composition/passthrough-1.yaml#L15 "passthrough-1"

Defenition of done
Check all places where is using labels and make sure that every place is using labels from the metadata.

Initial solution was not working, so reverted it. Use downwardAPI to fix it

I'm a bit confused as to what we are doing here and why.  It looks like we are trying to pull from the Pod labels into the NSM_LABELS... but I don't understand why we are trying to do that.
@denis-tingaikin Could you explain?

Could you explain?

In my mind, it can look for users more simply than adding additional labels via env.

@edwarnicke I'm fine if you're ok with the current separated labels list.

We don't need this for now. Closing.


--cluster-name flag is not working

Previouis issue closed: https://github.com/kubescape/kubescape/issues/861
@dwertent
Scan does not start.

kubescape scan framework nsa --verbose --cluster-name my-cluster1-0-0
{"level":"info","ts":"2022-12-02T11:53:03Z","msg":"Kubescape scanner starting"}
{"level":"warn","ts":"2022-12-02T11:53:04Z","msg":"Kubernetes cluster nodes scanning is disabled. This is required to collect valuable data for certain controls. You can enable it using  the --enable-host-scan flag"}
{"level":"info","ts":"2022-12-02T11:53:08Z","msg":"Downloading/Loading policy definitions"}
{"level":"info","ts":"2022-12-02T11:53:08Z","msg":"Downloaded/Loaded policy"}
{"level":"error","ts":"2022-12-02T11:53:08Z","msg":"failed to discover API server information","error":"Get "https://<IP_ADDRESS>:44/version?timeout=32s\": dial tcp <IP_ADDRESS>:44: connect: connection refused"}
{"level":"info","ts":"2022-12-02T11:53:08Z","msg":"Accessing Kubernetes objects"}
{"level":"fatal","ts":"2022-12-02T11:53:08Z","msg":"failed to get resource: /v1,

Hi @biacharj , can you please verify you have a running Kubernetes cluster and that the kubeconfig file is in the default path?

Closed because I did not receive a response .


update tests to ES 7.16.x, fix most warnings

@vvanholl , @lukas-vlcek It seems tests are not being run for time now. This PR should help?

@vvanholl , @lukas-vlcek rebased. Any chance getting this looked at? Tx!


Link in form-control-feedback can't be clicked in 3.3.5

I was using links in form-control-feedback span to perform a save or cancel since 3.1.1. I'm trying to upgrading to 3.3.5, but the behavior for the form-control-feedback changed.
Please refer to the jsfiddle:
3.1.1-Work https://jsfiddle.net/yuezhao1989/jm7z8gaw/1/
3.3.5-Not work https://jsfiddle.net/yuezhao1989/zL470g8y/1/
I checked, there is a z-index:2 added in 3.3.5. I tried to override it by setting to a higher number, but it doesn't work. Do you have any thoughts to make it work again?
Thanks!

Hi @YueZhaoDreams!
You appear to have posted a live example (https://fiddle.jshell.net/yuezhao1989/jm7z8gaw/1/show/light/), which is always a good first step. However, according to the HTML5 validator, your example has some validation errors, which might potentially be causing your issue:

line 71, column 59 thru line 73, column 35: Start tag a seen but an element of the same type was already open.

You'll need to fix these errors and post a revised example before we can proceed further.
Thanks!
(Please note that this is a fully automated comment.)

Hi @YueZhaoDreams!
You appear to have posted a live example (https://fiddle.jshell.net/yuezhao1989/zL470g8y/1/show/light/), which is always a good first step. However, according to the HTML5 validator, your example has some validation errors, which might potentially be causing your issue:

line 71, column 59 thru line 73, column 35: Start tag a seen but an element of the same type was already open.

You'll need to fix these errors and post a revised example before we can proceed further.
Thanks!
(Please note that this is a fully automated comment.)

For how-to/personal support questions, please StackOverflow or similar https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#using-the-issue-tracker
for what it's worth, your input is overlapping the "Cancel" link, which means it's swalling click events.


[Bug report] Git delta hook unknown option and light value issues

Describe the bug
@bezhermoso I've noticed 2 issues with the new git delta hook:

The -g option doesn't exist for me
The is_light_theme variable has either the values 0 or 01 which causes the light value to give an error: (eval):9: command not found: 01

Screenshots
These screenshots are with the removal of the -g option for bc command on line 19.
Works correctly when setting a dark theme

Does not work correctly when setting a light theme (notice # is_light_theme =  01 on line 18)

System
Operating system: Pop!Os (Linux)
Terminal: Alacritty

I've created a PR to fix this, @bezhermoso maybe you can do a quick review? https://github.com/tinted-theming/base16-shell/pull/33

This issue has been fixed. Look at the merged PR for more details https://github.com/tinted-theming/base16-shell/pull/33


remove redundant string conversions

string variables dont need to be wrapped in '

@SimonCropp : Thanks for your contribution! The author, @mikejo5000, has been notified to review your proposed change.

@SimonCropp Looks good. Thanks!

Reverted as part of #4474

...in the private repo


afterPrint from the latest patch doesn't work

repro: https://github.com/Zamiell/tstl-bug

Some investigation:
The issue arises when using bundles. The bundle uses processed file's sourceMapNode instead of code, so a change to code in the plugin is lost.
We should either change this behavior, or document that sourceMapNode should be modified instead of
code in plugins, when bundle is enabled. Or, we should remove the code field/make it readonly to avoid this confusion/inconsistency.


Feature request: Textlint

TextLint is a natural-language linter for markdown, txt and (optionally) html files.  It would be great to support this tool in syntastic.

Interesting stuff, thank you for the link.  Commit 9f766ea.
Textlint still has a few rough edges, and that translates to some shortcomings for syntastic.  F.i. it isn't possible to query the list of installed plugins, and a missing plugin doesn't trigger any useful exit code.  Consequently, there is no way for syntastic to tell whether the HTML plugin is installed, and when it isn't the checks will fail silently.  The fact that there is no way to debug what's going on doesn't help, either.  Still, the modular architecture of textlint might allow syntastic to interface with linters that it couldn't support otherwise.  Good find.


Main directory is not visible in Torrent.Files

Hi.
If you have a .torrent with some files in a directory, something like that :

Directory1

File1
File2
Directory2

File3

Directory3

File4

Torrent.Files will look like this :
File1
File2
Directory2/File3
Directory3/File4
On torrenteditor, i can't see it too, but i have a meta-data called "Directory".
Can you do something about it ?

Can you include a torrent which shows the issue?


Chore: Fix script to generate reference page of custom resources in docs

What this PR does / why we need it:

Fixes the script to generate reference page of custom resources in the docs repo.
create docs PR job run on the branch: https://github.com/Kong/kubernetes-ingress-controller/actions/runs/6977712012
Which issue this PR fixes:

Special notes for your reviewer:

PR Readiness Checklist:
Complete these before marking the PR as ready to review:
~- [ ] the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR~

Why change from include to inlcude_cached? I recently changed that to include to match manual edits on docs.konghq.com side (I believe they were made for a reason there, not sure though what was it exactly).

Why change from include to inlcude_cached? I recently changed that to include to match manual edits on docs.konghq.com side (I believe they were made for a reason there, not sure though what was it exactly).

It was just a revert of the original change in #5094. According to the README in docs repo https://github.com/Kong/docs.konghq.com/blob/main/README.md#include-check, The include_cache is only required when referencing page variables in _include files, so it is OK to use include.

New job here: https://github.com/Kong/kubernetes-ingress-controller/actions/runs/6978241095 and PR here: https://github.com/Kong/docs.konghq.com/pull/6555


Resource dnacenter_pnp_device_site_claim generates wrong POST BODY when multiple config_parameterssections are present

Prerequisites

[x] Have you tested the operation in the API directly?
[x] Do you have the latest Terraform provider version?
[x] Review the compatibility matrix before opening an issue.

Describe the bug
When using multiple config_parameters in resource configuration, only the first section is reflected in POST BODY, remaining ones are ignored. It used to work correct with v.1.0.19-beta. Here is resource configuration:
resource "dnacenter_pnp_device_site_claim" "this" {
  parameters {
    site_id   = "f1188cff-6110-45a3-946c-4831d62a3cd4"
    device_id = "645b9623e0a25d5fbb063d9b"

    type = "Default" # Default means switch. Available values: Default, StackSwitch, AccessPoint, Sensor, CatalystWLC, MobilityExpress
    image_info {
      skip = true # TODO: don't skip this
    }
    config_info {
      config_id = "d6456fd2-a0b8-4c7c-9fea-f00b12f69b64"
      config_parameters {
        key   = "HOSTNAME"
        value = "labhf-osl-bn-2"
      }
      config_parameters {
        key   = "LOOPBACK0"
        value = "<IP_ADDRESS>"
      }
      config_parameters {
        key   = "BORDER-AS"
        value = "65002"
      }
    }
  }
}

And here is the resulting POST payload:
~~~ REQUEST ~~~
POST  /dna/intent/api/v1/onboarding/pnp-device/site-claim  HTTP/1.1
HOST   : <IP_ADDRESS>
HEADERS:
	Accept: application/json
	Content-Type: application/json
	User-Agent: go-resty/2.7.0 (https://github.com/go-resty/resty)
	X-Auth-Token: ***
BODY   :
{
   "deviceId": "645b9623e0a25d5fbb063d9b",
   "siteId": "f1188cff-6110-45a3-946c-4831d62a3cd4",
   "type": "Default",
   "imageInfo": {
      "imageId": "",
      "skip": true
   },
   "configInfo": [
      {
         "configId": "d6456fd2-a0b8-4c7c-9fea-f00b12f69b64",
         "configParameters": {
            "key": "HOSTNAME",
            "value": "labhf-osl-bn-2"
         }
      }
   ]
}

Expected behavior
Expected POST BODY(generated by v1.0.19-beta):
BODY   :
{
   "deviceId": "645b9623e0a25d5fbb063d9b",
   "siteId": "f1188cff-6110-45a3-946c-4831d62a3cd4",
   "type": "Default",
   "imageInfo": {
      "imageId": "",
      "skip": true
   },
   "configInfo": {
      "configId": "d6456fd2-a0b8-4c7c-9fea-f00b12f69b64",
      "configParameters": [
         {
            "key": "HOSTNAME",
            "value": "labhf-osl-bn-2"
         },
         {
            "key": "LOOPBACK0",
            "value": "<IP_ADDRESS>"
         },
         {
            "key": "BORDER-AS",
            "value": "65002"
         }
      ]
   }
}

Environment (please complete the following information):

Cisco DNA Center version and patch: <IP_ADDRESS>-70194
Terraform version: 1.3.6
Cisco DNA Center provider version: 1.1.6-beta
OS Version: Ubuntu 20.04

@mschedrin  you can test it now. Let us know if it works for you.

@fmunozmiranda multiple config_parameters are now generated right in POST BODY, however there is still an issue with the request body. Here is what v1.1.7-beta generates:
BODY   :
{
   "deviceId": "641b1dc0134e44286265c85d",
   "siteId": "5394e86b-e349-4e37-99c3-69690e73b510",
   "type": "Default",
   "imageInfo": {
      "imageId": "",
      "skip": true
   },
   "configInfo": [
      {
         "configId": "a90c8002-581f-462a-80dd-848d850d6c14",
         "configParameters": [
            {
               "key": "HOSTNAME",
               "value": "OSL_bn2"
            },
            {
               "key": "LOOPBACK0",
               "value": "<IP_ADDRESS>"
            },
            {
               "key": "BORDER-AS",
               "value": "65003"
            }
         ]
      }
   ]
}

confgInfo here is supposed to be JSON object and not JSON array with single element. The correct BODY for the request should be:
BODY   :
{
   "deviceId": "641b1dc0134e44286265c85d",
   "siteId": "5394e86b-e349-4e37-99c3-69690e73b510",
   "type": "Default",
   "imageInfo": {
      "imageId": "",
      "skip": true
   },
   "configInfo": {
      "configId": "d6456fd2-a0b8-4c7c-9fea-f00b12f69b64",
      "configParameters": [
         {
            "key": "HOSTNAME",
            "value": "OSL_bn2"
         },
         {
            "key": "LOOPBACK0",
            "value": "<IP_ADDRESS>"
         },
         {
            "key": "BORDER-AS",
            "value": "65003"
         }
      ]
   }
}

Hi @mschedrin configInfo was changed to object not array in new version, please try it and let us know how does it go

The resource still does not work correct in version 1.1.8-beta, @fmunozmiranda 😭
Resource configuration:
resource "dnacenter_pnp_device_site_claim" "this" {
  # depends_on = [dnacenter_pnp_device_import.this, data.dnacenter_pnp_device.this, dnacenter_site.floor]

  # for_each = var.sda_border_devices

  parameters {
    site_id   = "f1188cff-6110-45a3-946c-4831d62a3cd4"
    device_id = "645b9623e0a25d5fbb063d9b"

    type = "Default" # Default means switch. Available values: Default, StackSwitch, AccessPoint, Sensor, CatalystWLC, MobilityExpress
    image_info {
      skip = true
    }
    config_info {
      config_id = "dfe7bc74c-b923-4060-b41b-a327ad4266ed"
      config_parameters {
        key   = "HOSTNAME"
        value = "labhf-osl-bn-2"
      }
      config_parameters {
        key   = "LOOPBACK0"
        value = "<IP_ADDRESS>"
      }
      config_parameters {
        key   = "BORDER-AS"
        value = "65002"
      }
    }
  }
}

POST BODY generated by the provider is missing configInfo parameters:
==============================================================================
~~~ REQUEST ~~~
POST  /dna/intent/api/v1/onboarding/pnp-device/site-claim  HTTP/1.1
HOST   : <IP_ADDRESS>
HEADERS:
	Accept: application/json
	Content-Type: application/json
	User-Agent: go-resty/2.7.0 (https://github.com/go-resty/resty)
	X-Auth-Token: ***
BODY   :
{
   "deviceId": "645b9623e0a25d5fbb063d9b",
   "siteId": "f1188cff-6110-45a3-946c-4831d62a3cd4",
   "type": "Default",
   "imageInfo": {
      "imageId": "",
      "skip": true
   },
   "configInfo": {
      "configId": "",
      "configParameters": null
   }
}
------------------------------------------------------------------------------

Please fix.

@mschedrin  please try with new version and update me.

Yes, now it works as expected.


[Go Live][May 17]

Push to live

Docs Build status updates of commit df927a8:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

msteams-platform/assets/icons/gear-icon.png
:white_check_mark:Succeeded
View

msteams-platform/assets/images/apple-id.png
:white_check_mark:Succeeded
View

msteams-platform/concepts/deploy-and-publish/appsource/prepare/create-partner-center-dev-account.md
:white_check_mark:Succeeded
View

For more details, please refer to the build report.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
For any questions, please:Try searching the docs.microsoft.com contributor guidesPost your question in the Docs support channel


Unable to login - No relevant user found

Checklist

Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?

Yes

Are you sure you're not using someone else's docker image?

Yes

Have you searched for similar issues (both open and closed)?

Yes

Describe the bug

So out of nowhere, I am unable to log in. It was working fine a couple days ago. Nothing has changed at all in last two days.
The error is: No relevant user found
Nginx Proxy Manager Version

2.11.2. The latest docker image.
jc21/nginx-proxy-manager
To Reproduce
Steps to reproduce the behavior:

Go to '...' Homeage
Click on '....' Login
Scroll down to '....'
See error: No relevant user found

Expected behavior

Screenshots

Operating System

Ubuntu 24 and Casa OS installed on top of it.
Additional context

I looked up the database and realised I had used an incorrect email address. Anyway, it took me down a rabithole and I found a solution to reset the password (this solution is not available anywhere else).
The database in 2.11.2 is located at /data/datbase.sqlite

Log into your container.
docker exec -it nginxproxymanager /bin/sh

Then connect to the sqlite db:
sqlite3 /data/database.sqlite
(If it reads sqlite3 command is not found, do this: apt update && apt install sqlite3 -y)

Then run this to show all details of your user such as userid, email, password hash etc. :
select * from user; (grab your email from here)
select * from auth; (notice the password hash in here)

Now run this to set your password to: changeme

UPDATE auth
SET secret = '$2b$13$X.7n1og.RCdKg/p/ZRUIj.gGlFPmoeSK29DTcF58tBzS6d1fZNJNu'
WHERE id = 1;

Note: You can generate another password hash here. Make sure you use type 2b and 13 log rounds. - Online Bcrypt Hash Generator and Checker Tool | Developer Tool-kit

Exit out of the DB
.quit


MicroProfile and JavaEE @ es~conference (Mexico)

Sorry for the late submission, I didnt knew about this until today...
Conference Name: Es-Conference Mexico 2019
Conference website and social media links:
http://www.javaup.org.mx/
@Javaup
Talks Links
http://www.javaup.org.mx/session/microprofile-for-the-busy-developer/
Session Name: MicroProfile benefits for monolithic applications
Date and hour: Friday, April 26th. 2019 (16:30 am - 17:30 am)
Speaker name: Jorge Cajas
Speaker twitter handle: @cajasmota
Description
Join @cajasmota at @Javaup to discuss and learn how could you take advantage of the @MicroProfileIO API's on your existing applications without refactoring them into microservices - Friday, April 26th More info: http://www.javaup.org.mx/session/microprofile-y-sus-beneficios-para-aplicaciones-monoliticas/
#OpenSource #OSS

This might not make the cut, i have pushed it to priority yet it might not be possible for the team to own it. FYI, still thanks for submitting, even if late- it is ok to be disciplined with filing issues for everything MP sharing fun via events. :) #LatinArmada

@Motojo Sorry but this snuck by me and I was not able to get it out.
Please next time its best to give us a bit more time to prepare it.
Next time :) Thanks
Ryan


fix(subject listing): hide new content

Description

hide new content on subject listing page

How to test

Go to https://deploy-preview-1825--oak-web-application.netlify.thenational.academy/beta/teachers/key-stages/ks3/subjects
You should see no new content

Screenshots

Happy that this solves the first part of the problem - there will be no obvious UX that enables the content to be found.
Content is still available by direct search:
e.g., https://deploy-preview-1825--oak-web-application.netlify.thenational.academy/beta/teachers-2023/programmes/music-secondary-ks3/units
Suggest we tackle that as second phase of work?

Have also created some weirdness on the selection boxes particularly at KS3 and KS4:

Suggest priority is to merge and tidy up design/UI bugs afterwards

:tada: This PR is included in version 1.229.3 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


Update PK accessibility statement after TDT fixes

Fixes #53 (Remove references to accessibility issues in Frontend Docs from accessibility statement [before 31 March]).
The most recent update to the Tech Docs Template has fixed some accessibility issues. For example, users of assistive tech will now no longer be able to focus elements that should remain hidden on pages. So, we now need to update our accessibility statement to say that our Kit-training-docs site is fully compliant with the WCAG 2.1 AA standard.
This PR also contains:

an updated review date for the accessibility statement
deletions of outdated information (about WCAG only being partly met because of issues with the Template)

@36degrees Do we need to remove this content from the end of the page?

@EoinShaughnessy yes, I think so.
You can do that by tweaking the last_reviewed_on date in the frontmatter at the top of the file.

@36degrees Thanks - have tweaked last_reviewed_on date. I think it's in the right IS0 8601 format (year-month-day).


[ADP-2389] add specifications for submissions store

This PR is adding .lean specifications for the new submissions store

[x] add specifications for primitives operations
[x] add specifications for API operations

Comments

Issue Number
ADP-2389

Just a note. I assume we want those .lean files to be syntactically correct with Lean?
After installing lean4 extension

Ooh. Yes, we do want .lean files to be syntactically correct Lean — but Lean 3, not Lean 4. The whole thing is still cutting edge and the version matters, sorry for not mentioning this.
Having a CI check for this would nice. "For all files in /spec, check that lean3 ${file}.lean compiles"? 🤔

PS: Paolo had trouble switching to Lean 3 after installing and removing the Lean 4 extension. You may have to uninstall the lean 4 executable that got added to your PATH.

Yes, we do want .lean files to be syntactically correct Lean — but Lean 3, not Lean 4.

Ok, I was mislead by the fact that Lean3 repository is now archived, but now I see that there's a community fork of Lean3 that is actively maintained (https://github.com/leanprover-community/lean).

Having a CI check for this would nice. "For all files in /spec, check that lean3 ${file}.lean compiles"? thinking

:point_up_2: :heavy_plus_sign:
Perhaps we can have all lean files in the designated subdir, like ./specifications/lean and then we could enable CI check only if there are changes made in this subdir, similarily as it is done for rubocop linter (https://github.com/input-output-hk/cardano-wallet/actions/runs/3542857092/workflow#L9)

Perhaps it would be also valuable to add some information around usage/guidelines for utilizing lean into https://input-output-hk.github.io/cardano-wallet/contributing. (Not necessarily as part of this PR.)

Perhaps it would be also valuable to add some information around usage/guidelines for utilizing lean into https://input-output-hk.github.io/cardano-wallet/contributing. (Not necessarily as part of this PR.)

Yes, that's a great suggestion! I'll add a file to that extend in a separate PR (soon).

bors r+

bors retry


Navigator operation requested with a context that does not include a Navigator

import 'package:firstapp/page.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return MyAppState();
  }
}

class MyAppState extends State<MyApp> {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          backgroundColor: Colors.white,
          appBar: AppBar(
            title: Text('NotiApp'),
            backgroundColor: Colors.deepOrange,
          ),
          body:
              Container(
                child: RaisedButton(
                  child: Text('Iniciar sesión'),
                  onPressed: (){
                        Navigator.push(context, MaterialPageRoute(builder: (context) => Page()));
                     }
       ),
    ),
 );

import 'package:flutter/material.dart';

class Page extends StatefulWidget {
  @override
  PageState createState() => PageState();
}

class PageState extends State<Page> {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Center(
        child: RaisedButton(
          child: Text('Volver'),
          onPressed: (){

          },
        ),
      ),
    );
  }
}

Hello @Meinuel !
Thank you for posting an issue.
Can you please also provide the flutter doctor -v command output?

Move MaterialApp outside MyApp:
void main() => runApp(MaterialApp(home: MyApp()));

class MyApp extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return MyAppState();
  }
}

class MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: Colors.white,
        appBar: AppBar(
          title: Text('NotiApp'),
          backgroundColor: Colors.deepOrange,
        ),
        body: Container(
          child: RaisedButton(
            child: Text('Iniciar sesión'),
            onPressed: () {
                Navigator.push(context, MaterialPageRoute(builder: (context) => Page()));
            }
        ),
     );
  }
}

MaterialApp creates a Navigator internally, so the context of MyAppState.build does not include Navigator because it is outside MaterialApp.

@najeira - That's correct. This point is covered in the last paragraph in the Navigator API doc https://api.flutter.dev/flutter/widgets/Navigator-class.html

Given your last message I feel safe to close this issue,
if you disagree please write in the comments
and I will reopen it.
Thank you


feat(savers): deposit maxish sends / mempool seen safety

Description

Notice

[ ] Have you followed the guidelines in our Contributing guide?
[ ] Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Pull Request Type

[ ] :bug: Bug fix (Non-breaking Change: Fixes an issue)
[ ] :hammer_and_wrench: Chore (Non-breaking Change: Doc updates, pkg upgrades, typos, etc..)
[ ] :nail_care: New Feature (Breaking/Non-breaking Change)

Issue (if applicable)

closes #
Risk

Testing

Engineering

Operations

Screenshots (if applicable)

Current dependencies on/for this PR:

develop

PR #3682   👈

This comment was auto-generated by Graphite.


help_link_widget: Replace blue with inherit color on hover in dark mode.

This is a follow up commit to 2f1ea2fe4eda04cc755e9d357eb98c171d703d1b, for dark mode. The previously mentioned commit fixed the issue of help link widget turning to blue instead of inheriting the color in light mode only.

Fixes: https://github.com/zulip/zulip/pull/27919#issuecomment-1839803236

Screenshots and screen captures:

Self-review checklist

[x] Self-reviewed the changes for clarity and maintainability
(variable names, code reuse, readability, etc.).

Communicate decisions, questions, and potential concerns.

[x] Explains differences from previous plans (e.g., issue description).
[x] Highlights technical choices and bugs encountered.
[ ] Calls out remaining decisions and concerns.
[ ] Automated tests verify logic where appropriate.

Individual commits are ready for review (see commit discipline).

[x] Each commit is a coherent idea.
[x] Commit message(s) explain reasoning and motivation for changes.

Completed manual review and testing of the following:

[x] Visual appearance of the changes.
[ ] Responsiveness and internationalization.
[ ] Strings and tooltips.
[ ] End-to-end functionality of buttons, interactions and flows.
[x] Corner cases, error conditions, and easily imagined bugs.

Merged, thanks @sayamsamal!


Refactor: simplify file request handling

... after several approaches I'd switch back to your initial implementation :neutral_face:
If you like, I can modify this PR to do so in addition to the tests + usual file naming (.gz and .br).

If you like, I can modify this PR to do so in addition to the tests + usual file naming (.gz and .br).

It would be nice :) Thanks!

done :)

...and some more small refactoring ;-)


Not authorized to perform AddCustomAttributes, but nothing changed, backend build failing

Having a super weird bug with my build has introduced itself even though no code changes...
The backend build of my hosted app is failing.
In the logs can see that
UPDATE_FAILED               UserPool                                                       AWS::Cognito::UserPool
amplifyconsole-backend-role/BuildSession is not authorized to perform: cognito-idp:AddCustomAttributes on resource
I have nothing that should be trying to add custom attributes, and no code changes to backend from the last time it built correctly without errors and now.
If I do amplify pull, select that I want to modify backend, and make any minor change (eg. changing SMS verification message content) and then do amplify push, my backend builds without errors, but then if I try to redeploy my app as a whole (which triggers backend redeployment) the backend build fails with the error above ^
I'm aware more information will probably be needed on this, please let me know what you need to help!

                             UPDATE_FAILED               UserPool                                                       AWS::Cognito::UserPool     Fri Jan 14 2022 02:00:51 GMT+0000 (Coordinated Universal Time) User: arn:aws:sts::563698952256:assumed-role/amplifyconsole-backend-role/BuildSession is not authorized to perform: cognito-idp:AddCustomAttributes on resource: arn:aws:cognito-idp:ap-southeast-2:563698952256:userpool/ap-southeast-2_u6vGT83tu because no identity-based policy allows the cognito-idp:AddCustomAttributes action (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: AccessDeniedException; Request ID: 2ab3e997-5496-4663-b13f-7948b149614d; Proxy: null)
                             UPDATE_ROLLBACK_IN_PROGRESS amplify-textbeerpwa-aigneis-01742-authtextbeerpwa-S5N3SMYIF8BA AWS::CloudFormation::Stack Fri Jan 14 2022 02:00:52 GMT+0000 (Coordinated Universal Time) The following resource(s) failed to update: [UserPool].

2022-01-14T02:00:58.008Z [INFO]:
2022-01-14T02:00:58.012Z [INFO]: UPDATE_FAILED               authtextbeerpwa                   AWS::CloudFormation::Stack Fri Jan 14 2022 02:00:53 GMT+0000 (Coordinated Universal Time) Embedded stack arn:aws:cloudformation:ap-southeast-2:563698952256:stack/amplify-textbeerpwa-aigneis-01742-authtextbeerpwa-S5N3SMYIF8BA/949fdcb0-3142-11ec-b9f6-0a44c1f6bcd4 was not successfully updated. Currently in UPDATE_ROLLBACK_IN_PROGRESS with reason: The following resource(s) failed to update: [UserPool].
UPDATE_ROLLBACK_IN_PROGRESS amplify-textbeerpwa-aigneis-01742 AWS::CloudFormation::Stack Fri Jan 14 2022 02:00:54 GMT+0000 (Coordinated Universal Time) The following resource(s) failed to update: [authtextbeerpwa].
2022-01-14T02:01:08.037Z [INFO]:
2022-01-14T02:01:08.039Z [INFO]: UPDATE_IN_PROGRESS authtextbeerpwa                           AWS::CloudFormation::Stack Fri Jan 14 2022 02:01:04 GMT+0000 (Coordinated Universal Time)
UPDATE_IN_PROGRESS storages3textbeerpwastoraged1u8w6exf42dms AWS::CloudFormation::Stack Fri Jan 14 2022 02:01:04 GMT+0000 (Coordinated Universal Time)
UPDATE_COMPLETE    storages3textbeerpwastoraged1u8w6exf42dms AWS::CloudFormation::Stack Fri Jan 14 2022 02:01:04 GMT+0000 (Coordinated Universal Time)
2022-01-14T02:01:13.134Z [INFO]:
2022-01-14T02:01:13.135Z [INFO]: UPDATE_COMPLETE UserPool AWS::Cognito::UserPool Fri Jan 14 2022 02:01:08 GMT+0000 (Coordinated Universal Time)


Include src folder in bower installation

Right now only the minified version of the js and the compiled css are included in the bower package. When people want to customize the package or automate the integration (with gulp, Grunt etc.) of the package into their application it is easier to do from the source files.
solution: remove src from the ignore array in bower.json

Agreed! Just updated it with commit 71229ce390 and v0.3.16 in bower. Thanks for the feedback!


Automatic download files via poltergeist

We are able to download files using selenium driver and I can specify download directory with Capybara Driver like below but the same is not available with poltergeist.
Could you please help me resolving the issue
Capybara.register_driver :selenium_chrome do|app|
prefs = {"download" => {"default_directory" => 'C:\Downloads'}}
@session_1=Capybara::Selenium::Driver.new(app, :browser => :chrome, :prefs => prefs, :detach => :unspecified)
end
Capybara.default_driver=:selenium_chrome
Capybara.register_driver :poltergeist_debug do |app|
Capybara::Poltergeist::Driver.new(app, :inspector => true)
end
Capybara.javascript_driver = :poltergeist

It's not supported, and is dependent on PhantomJS adding support (which isn't likely).


[BUG] - Cannot use svg icons.

Checks

[X] I have searched the existing issues for a similar bug and it does not exist!

Environment

Operating System: Windows_NT
Node Version:     v16.17.0
Nuxt Version:     3.5.2
Nitro Version:    2.4.1
Package Manager<EMAIL_ADDRESS>Builder:          vite
User Config:      modules, i18n, quasar, css, components, vite
Runtime Modules<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>Build Modules:    -

Quasar version
v2.12.0
Browsers
Google Chrome
Description
Hi! First of all I want to say that you have done a great job, thank you.
Faced with the problem of using svg icons.
I see that there is no way to take the icons directly into quasar. Only through @quasar/extras. Although quasar itself provides for importing svg icons.

Reproduction steps
Just try to import svg icons

Screenshots
No response
Logs
No response

Closed by #57 (3503262, 5d5109b)


Allow the user to request an unscaled X axis on the LineChart

Hello,
[Category: Question]
As I mentioned before - fantastic work so far! One thing I found might be missing would be a way to get the width of the lineChart for when you implement scrolling behavior.
I see some functions under Container which might be helpful, is there a way to return the effective width of the linechart itself (the piece where braille gets drawn to the screen [the canvas])? Right now I use a hacky method where the ui.TerminalDimensions() function is called from the termUI library to take the 85 percent of the total terminal width (because the linechart container takes up 85 percent plus another 15 percent for the text box). I'd like to remove the termUI dependency entirely and somehow find the width of the canvas.
termWidth, termHeight := ui.TerminalDimensions()
termWidth = int((float64(termWidth)*float64(0.85)))

Thanks!
Keith

Thank you very much for your support @keithknott26. Please don't hesitate to open feature requests for stuff you would find useful. It will be best for the project when it gets shaped around customer use cases.
We can easily expose the terminal size or the size of the linechart graph. Sounds like you need the latter so we probably want to do that inside the linechart widget itself. We can give you an exact size so there is no need for the 85% calculation.
Before we do that, can you help me understand what do you need the size for? I just want to make sure we have an opportunity to solve the right problem, rather than a "Y problem" (ref from http://xyproblem.info/).
What will you use the size for? I see that the original title was about flickering - is that related? Basically would you mind explaining the problem that you will be able to solve once you have the size?

Sure - Forgive the confusion I ended up sorting the flickering problem with the Text boxes, turns out the t.Reset() needed to be called closer to the t.Write() function so there was a minor delay in updating the text box content after the reset, resulting in screen flickering.
So I use the width of the line chart to determine how many data points I need in order to fill the canvas, so that when I "scroll" the X values series to the left there are is no unused portions of the canvas.
I only display a small portion of the complete series at any one time, so assuming the width of the line chart is 100 I would retrieve the LAST 100 data elements from a circular ring buffer and use those values to update the series giving the perception of scrolling from right to left when in reality only the last 100 records and labels are being displayed and new records are being added in behind the old ones. Records are added at an interval to the ring buffer in a different function. When there are no more records to add to the Buffer , "scrolling" stops. If I were to underestimate the size, the scrolling would take place only on a fraction of the screen: [-----     ] vs [-------]
I'd really like to remove the first two lines, keep in mind the termHeight isn't actually used anywhere.
Code example:
//retrieve termWidth from termUI library
termWidth, termHeight := ui.TerminalDimensions()
//set termWidth to actual width of linechart (85% of screen)
termWidth = int((float64(termWidth) * float64(0.85)))
lc := linechart.New(
linechart.AxesCellOpts(cell.FgColor(cell.ColorNumber(GraphAxes))),
linechart.YLabelCellOpts(cell.FgColor(cell.ColorNumber(GraphYLabels))),
linechart.XLabelCellOpts(cell.FgColor(cell.ColorNumber(GraphXLabels))),
)
go periodic(ctx, time.Duration(100*time.Millisecond), func() error {
var inputs []float64
var inputLabels []string
             //retrieve lineChart width num of elements from the data buffer
	inputs = buffer.Last(termHeight, termWidth)

             //retrieve lineChart width num of elements from the data labels buffer
	inputLabels = buffer.LastLabels(termHeight, termWidth)
	var labelMap = map[int]string{}
	for i, x := range inputLabels {
		labelMap[i] = x
	}
           if err := lc.Series("first", inputs,
		linechart.SeriesCellOpts(cell.FgColor(cell.ColorNumber(GraphLineOne))),
		linechart.SeriesXLabels(labelMap),
	); err != nil {
		return err
	}

	return nil
})
return lc

}
Maybe you know a better way to accomplish the scrolling behavior? If there were a function to append records to the end of a series and then shift the contents of the canvas left I'd use that instead. Right now, if you add records to the end of the series it will compress the linegraph continually until all of the data fits (as it should). Effectively if you push one value to the beginning, one value is removed off the end making it nice for streaming realtime stats - it becomes hard to see small variances in data when the graph gets "too compressed"[the series has a high count of values].

Thanks again @keithknott26, I know writing detailed response like this takes a lot of time. This helps a lot however, much appreciated.
Regarding the text widget - I believe we should add the ability to atomically Reset+Write - tracking this in #124.
As for the linechart, I understand the problem now. You probably know this - the line charts actually fits two values per each cell of width, because it uses the braille canvas (each cell is two pixels wide):
https://github.com/mum4k/termdash/blob/34fe013ca66df93df75868f43386db104c9f1700/canvas/braille/braille.go#L32
We could expose a method that would report the LineChart's capacity so the caller knows how many values are needed to "fill" the linechart, but that would be similarly racy as the problem you encountered regarding the Reset+Write on the text widget. The caller might determine the capacity, then a terminal resize would happen, then the caller fills an incorrect number of values.
Therefore I am more inclined towards providing this functionality on the LineChart itself. The simplest way would be to add a new Option:
https://github.com/mum4k/termdash/blob/34fe013ca66df93df75868f43386db104c9f1700/widgets/linechart/options.go#L25
Say an option defined like this:
// UnscaledX when provided, stops the LineChart from rescaling the X axis when it
// can't fit all the values, instead the LineCharts only displays the last n values that
// fit into its width. This results in hiding some values from the beginning of the
// series that didn't fit completely.
// The default behavior is to rescale the X axis to display all the values.
// This option takes no effect if all the values on the series fit into the
// LineChart area.
func UnscaledX() Option { ... }

Now this has the obvious problem that the caller won't have any idea how many values should be maintained in the values slice and it probably isn't practical to let the values slice just grow forever. For that purpose we could add a LineChart method as follows.
// ValueCapacity returns the number of values that can be fit onto the X axis without
// a need to rescale the axis. This is essentially the number of available pixels based
// on the current width of the LineChart.
// Note that this value changes each time the terminal resizes so there is
// no guarantee this remains the same next time Draw is called. Should be used as a
// hint only.
func (lc *LineChart) ValueCapacity() int { ... }

Please let me know what you think.

This takes care of both the graph scaling when the slice is being populated with data and the size/capacity function. Perfect! This is exactly what I had in mind thank you.

Great, thanks for confirming. I will look into implementing this shortly.

This will be pushed to the devel branch shortly. I would appreciate if you could test it and report any issues.

@mum4k - Im having trouble figuring out how to use the Options of the line chart.  I was trying something like this:
lc := linechart.New(linechart.
linechart.AxesCellOpts(cell.FgColor(cell.ColorNumber(GraphAxes))),
linechart.YLabelCellOpts(cell.FgColor(cell.ColorNumber(GraphYLabels))),
linechart.XLabelCellOpts(cell.FgColor(cell.ColorNumber(GraphXLabels))),
linechart.YAxisCustomScale(0, 100),
)
I must be doing it wrong and not using the Options interface correctly

Considering the context of this issue, you probably want the new X axis option:
https://github.com/mum4k/termdash/blob/66599a4d12f0c32c5a8bc8439282951967fa051c/widgets/linechart/options.go#L166
If that doesn't do what you wanted, can you help me by describing the expected behavior and the one observed?

@mum4k ,
I finally had a chance to test this out with a large dataset and it looks like it's scrolling as expected! When the X-Axis fills up with enough values it starts removing values ( and the labels) from the front of the graph.
I've included a screenshot showing both scenarios (XAxisUnscaled on Top, w/out that option on Bottom). In the top graph you can observe the labels/data scrolling by while the bottom one continues to compress its data onto the X-Axis.:

Also I've confirmed that the vertical labels display correctly when the XaxisUnscaled option is used.
Feature confirmed, Nice one!

That looks really good @keithknott26, thank you again for taking the time, testing the features and confirming.
Out of curiosity - how are you aligning the text in the two containers containing the statistics? If that is a plain Text widget - this is going to become easier for you once we will have the planned Table widget mentioned #5 implemented.

@mum4k  - I'm using a mixture of tabs and spaces, it works well enough as long as the numbers don't grow too large.
I was thinking of raising an enhancement to add the ability to draw a data average line across the linechart canvas. It can be achieved outside the linechart as well by adding another series and changing the line color - or is functionality something you'd prefer to keep outside of the linechart code? For streaming data in particular it would be helpful to see an average line (of all values) when the graph has scrolled left. I'm planning to add that feature next and thought I'd mention it.
Thanks again for all your hard work, if anything else comes to mind I'll be sure to run it by you.

My first instinct is to conclude that this is something that doesn't need to be on the LineChart widget itself. As you noted - given that the caller controls the data, it is trivial to calculate this outside. So I am not sure what value we would add by implementing it here.
Please do open a feature request if you will encounter any issues implementing this, in which case we can look into enhancing the widget.

I tend to agree, given how easy it was to implement outside the Linechart it doesn't make much sense to include it in the lower level code.
Happy to hear you added support for zooming I'll test that next!