MongoWaitQueueFullException When Scaling Azure Container Apps with .NET 8.0 API Using Azure Cosmos DB for MongoDB API

Summary:
I'm facing a critical issue where my .NET 8.0 API can handle up to 1,000 RPS on a single container instance without any problems. However, when I enable scaling in Azure Container Apps to handle increased load, I start receiving MongoWaitQueueFullException errors from Azure Cosmos DB for MongoDB API. This occurs even though the per-instance load is significantly less than 1,000 RPS. Reducing the per-instance MaxConnectionPoolSize to manage total connections sometimes resolves the issue but can also lead to these exceptions occurring unpredictably.
Environment:

Azure Services:

Azure Container Apps
Azure Cosmos DB for MongoDB API

Application:

.NET 8.0 API
MongoDB .NET Driver

Configuration:

Single Instance:

CPU: 0.5 cores
Memory: 1 GB RAM
MaxConnectionPoolSize: 112
Throughput: Handles up to 1,000 RPS without issues

Scaled Instances:

Auto-scale based on RPS (e.g., scales when RPS > 500)
Encountering exceptions at loads well below 1,000 RPS per instance

Problem Details:

Dilemma:

Single Container Performance: The application can handle 1,000 RPS on a single container with MaxConnectionPoolSize set to 112.
Scaling Issue: When scaling out to multiple containers, MongoDB reports connection limits and throws MongoWaitQueueFullException errors, even though the per-instance load is lower.
Adjusting MaxConnectionPoolSize: Reducing MaxConnectionPoolSize to 20 or 50 per instance sometimes resolves the issue, but the exceptions still occur unpredictably, and per-instance throughput decreases.

Exception Received:
MongoDB.Driver.MongoWaitQueueFullException: The wait queue for acquiring a connection to server <cosmosdb-endpoint>:10255 is full.

Impact:

The application cannot maintain the same per-instance throughput when scaling out.
Scaling out leads to decreased performance and stability due to connection limitations.
The issue occurs even when per-instance loads are well within the capacity handled by a single instance.

Error Stack Trace:
MongoDB.Driver.MongoWaitQueueFullException: The wait queue for acquiring a connection to server <cosmosdb-endpoint>:10255 is full.
   at MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool.AcquireConnectionHelper.AcquireWaitQueueSlot()
   at MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool.AcquireConnectionHelper.StartCheckingOut()
   at MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool.AcquireConnectionHelper.AcquireConnectionAsync(CancellationToken cancellationToken)
   at MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool.AcquireConnectionAsync(CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Servers.Server.GetChannelAsync(CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Operations.RetryableWriteContext.InitializeAsync(CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Operations.RetryableWriteContext.CreateAsync(IWriteBinding binding, Boolean retryRequested, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Operations.RetryableWriteOperationExecutor.ExecuteAsync[TResult](IRetryableWriteOperation`1 operation, IWriteBinding binding, Boolean retryRequested, CancellationToken cancellationToken)
   at MongoDB.Driver.OperationExecutor.ExecuteWriteOperationAsync[TResult](IWriteBinding binding, IWriteOperation`1 operation, CancellationToken cancellationToken)
   at MongoDB.Driver.MongoCollectionImpl`1.ExecuteWriteOperationAsync[TResult](IClientSessionHandle session, IWriteOperation`1 operation, CancellationToken cancellationToken)
   at MongoDB.Driver.MongoCollectionImpl`1.UsingImplicitSessionAsync[TResult](Func`2 funcAsync, CancellationToken cancellationToken)
   at MyApp.Services.WaitlistService.CreateOrUpdateEntryAsync(WaitlistEntry entry) in /src/Services/WaitlistService.cs:line 41

Steps to Reproduce:

Set Up Environment:

Deploy a .NET 8.0 API to Azure Container Apps.
Configure the API to use Azure Cosmos DB for MongoDB API.
Use the MongoDB .NET Driver with MaxConnectionPoolSize set to 112.

Load Testing with Single Instance:

Run a load test with up to 1,000 RPS.
Observe that the application handles the load without exceptions.

Enable Scaling in Azure Container Apps:

Configure the application to scale out when RPS exceeds a threshold (e.g., 500 RPS).
Deploy the updated configuration.

Load Testing with Scaling Enabled:

Run the same load test.
Observe that MongoWaitQueueFullException errors occur even at per-instance loads well below 1,000 RPS.

Adjust MaxConnectionPoolSize:

Reduce MaxConnectionPoolSize to 20 or 50 per instance to limit total connections when scaling.
Run the load test on a single instance and with scaling enabled.
Sometimes the application works without issue; other times, it throws MongoWaitQueueFullException errors, even at lower RPS.

Expected Behavior:

The application should scale out across multiple instances without encountering MongoWaitQueueFullException errors.
Per-instance throughput should remain consistent when scaling out.
Adjusting MaxConnectionPoolSize should not cause exceptions at lower loads on a single instance or lead to unpredictable behavior.

Actual Behavior:

Scaling out results in MongoWaitQueueFullException errors under load.
Per-instance throughput decreases when MaxConnectionPoolSize is reduced.
Exceptions occur unpredictably, even when per-instance loads are within previously successful thresholds.

Analysis and Attempts to Resolve:

Initial Hypothesis:

The cumulative number of connections from all instances exceeds the Azure Cosmos DB's capacity.
Each instance maintains its own MongoClient with its own connection pool of 112 connections, leading to a high total number of connections when scaling.

Adjusting MaxConnectionPoolSize:

Reduced MaxConnectionPoolSize to 20 or 50 per instance to manage total connections when scaling.
Observed Behavior:

Sometimes the application handles the load without issues.
Other times, MongoWaitQueueFullException errors occur, even at lower per-instance loads (e.g., 500 RPS).
The per-instance throughput is significantly reduced compared to when MaxConnectionPoolSize is 112.

Trade-Off Observed:

Higher MaxConnectionPoolSize (112):

Pros: Single instance handles up to 1,000 RPS without issues.
Cons: Scaling out leads to cumulative connections exceeding database capacity, causing exceptions.

Lower MaxConnectionPoolSize (20 or 50):

Pros: Total connections when scaling are within database capacity.
Cons: Per-instance throughput decreases; exceptions occur unpredictably.

Unpredictable Exceptions:

Even after reducing MaxConnectionPoolSize, the exceptions occur inconsistently, making it difficult to ensure stable performance.

Questions and Concerns:

What is the maximum number of concurrent connections supported by Azure Cosmos DB for MongoDB API?

Unable to find explicit connection limits in the documentation.
Cannot use standard MongoDB commands (e.g., db.serverStatus().connections) in Azure Cosmos DB to check.

How can I balance MaxConnectionPoolSize to support both high per-instance throughput and total connections when scaling?

Why does reducing MaxConnectionPoolSize lead to unpredictable exceptions, even at lower loads?

Is there a recommended approach to manage connections and scaling with Azure Cosmos DB for MongoDB API in a containerized, scaled-out environment?

Relevant Code Snippets:
Program.cs:
builder.Services.AddSingleton<IMongoClient>(sp =>
{
    var mongoConnectionString = builder.Configuration["MongoDB-ConnectionString"];
    if (string.IsNullOrEmpty(mongoConnectionString))
    {
        throw new InvalidOperationException("MongoDB connection string is not set.");
    }

    // Configure MongoDB connection with pool size and timeout settings
    var settings = MongoClientSettings.FromConnectionString(mongoConnectionString);

    // Adjusted MaxConnectionPoolSize
    settings.MaxConnectionPoolSize = 112; // Also tested with 20 and 50
    settings.WaitQueueTimeout = TimeSpan.FromSeconds(30); // Timeout for waiting connections

    // Enable logging of MongoDB connection pool events
    settings.ClusterConfigurator = cb =>
    {
        cb.Subscribe<ConnectionPoolOpenedEvent>(e =>
        {
            Console.WriteLine($"MongoDB Connection Pool Opened: {e.ConnectionPoolSettings.MaxConnections}");
        });
    };

    return new MongoClient(settings);
});

WaitlistService.cs:
public class WaitlistService : IWaitlistService
{
    private readonly IMongoCollection<WaitlistEntry> _waitlistEntries;
    private readonly TelemetryClient _telemetryClient;

    public WaitlistService(IMongoClient mongoClient, TelemetryClient telemetryClient)
    {
        var database = mongoClient.GetDatabase("cmCoreDb");
        _waitlistEntries = database.GetCollection<WaitlistEntry>("cmWaitlist");
        _telemetryClient = telemetryClient;
    }

    public async Task<(WaitlistEntry? Entry, bool IsNewEntry)> CreateOrUpdateEntryAsync(WaitlistEntry entry)
    {
        var startTime = DateTime.UtcNow;
        var success = false;
        try
        {
            var filter = Builders<WaitlistEntry>.Filter.Eq(e => e.Email, entry.Email);
            var update = Builders<WaitlistEntry>.Update
                .Set(e => e.FirstName, entry.FirstName)
                .Set(e => e.LastName, entry.LastName)
                .Set(e => e.CompanyName, entry.CompanyName)
                .Set(e => e.CompanySize, entry.CompanySize)
                .Set(e => e.Country, entry.Country)
                .Set(e => e.Role, entry.Role)
                .Set(e => e.Usage, entry.Usage);

            var options = new FindOneAndUpdateOptions<WaitlistEntry>
            {
                IsUpsert = true,
                ReturnDocument = ReturnDocument.After
            };

            var result = await _waitlistEntries.FindOneAndUpdateAsync(filter, update, options);

            success = true;
            var isNewEntry = result.Id != entry.Id;

            return (result, isNewEntry);
        }
        catch (Exception ex)
        {
            _telemetryClient.TrackException(ex);
            return (null, false);
        }
        finally
        {
            var duration = DateTime.UtcNow - startTime;
            _telemetryClient.TrackDependency("MongoDB", "CreateOrUpdateEntry", "cmCoreDb.cmWaitlist", startTime, duration, success);
        }
    }
}

Request for Assistance:
I'm seeking guidance on the following:

Understanding Azure Cosmos DB for MongoDB API Connection Limits:

Is there a way to determine or estimate the maximum number of concurrent connections supported?
Are there hidden or undocumented limits that could explain this behavior?

Best Practices for Managing Connections in a Scaled-Out Environment:

How can I configure MaxConnectionPoolSize to balance high per-instance throughput and total connections when scaling?
Are there recommended patterns or configurations for using Azure Cosmos DB with scaled-out containerized applications?

Addressing the Unpredictable Exceptions:

Why do exceptions occur unpredictably even after adjusting MaxConnectionPoolSize?
Is there additional configuration or code changes needed to ensure stable performance?

Optimizing for High Throughput with Scaling:

How can I maintain high per-instance throughput (up to 1,000 RPS) while scaling out without hitting connection limits?

Additional Context:

Monitoring and Logging:

Implemented logging for connection pool events.
Monitored Application Insights for exceptions and performance metrics.

Scaling Configuration:

Scaling based on RPS with thresholds set to trigger scaling when RPS exceeds certain values (e.g., 500 RPS).
Scaling leads to multiple instances each with their own MongoClient and connection pool.

Application Insights:

Exceptions occur even when overall load should be manageable based on single-instance performance.
No significant resource constraints observed on the application instances themselves.

Attachments:

Full Program.cs and WaitlistService.cs files.
Application Insights exception logs and performance metrics.
Azure Container Apps scaling configuration.
Load test results demonstrating the issue.

Thank You:
I appreciate any assistance or guidance on resolving this issue. Understanding how to effectively manage connections and scaling with Azure Cosmos DB for MongoDB API is critical for our application's success. Please let me know if any additional information is required.

Note to Maintainers:

Emphasized Point: The core dilemma is that the application can handle up to 1,000 RPS on a single container instance without any issues, but when scaling out to multiple instances, connection limit exceptions occur even though the per-instance load is lower.
Adjusting MaxConnectionPoolSize Doesn't Fully Resolve the Issue:

Reducing MaxConnectionPoolSize per instance helps manage total connections but leads to decreased per-instance throughput and unpredictable exceptions.
There's a need for a solution that allows high per-instance performance while scaling out without hitting connection limits.

Looking forward to your insights and recommendations on this matter.

@yhsparrow this repo is only for CosmosDB SQL API.
Can you please raise ICM to follow-up?

Done.
Raised a Support request on azure.
Is there a repo for CosmosDB Mongo API?


[Device Support Request] Hue Ambiance Gradient Lightstrip

Problem description
The Hue Ambiance Gradient lightstrip currently shows up as a single light, but is configurable to some degree in segments.
Solution description
Something like what deconz and zigbee2mqtt are doing - it would be great to configure the different colours of the strip to get the gradient effect.
Screenshots/Video
No response
Device signature
Device signature
{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4107, maximum_buffer_size=82, maximum_incoming_transfer_size=128, server_mask=11264, maximum_outgoing_transfer_size=128, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
  "endpoints": {
    "11": {
      "profile_id": 260,
      "device_type": "0x010d",
      "in_clusters": [
        "0x0000",
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0006",
        "0x0008",
        "0x0300",
        "0x1000",
        "0xfc01",
        "0xfc03"
      ],
      "out_clusters": [
        "0x0019"
      ]
    },
    "242": {
      "profile_id": 41440,
      "device_type": "0x0061",
      "in_clusters": [],
      "out_clusters": [
        "0x0021"
      ]
    }
  },
  "manufacturer": "Signify Netherlands B.V.",
  "model": "LCX004",
  "class": "zigpy.device.Device"
}

Diagnostic information
Diagnostic information
 "data": {
    "ieee": "**REDACTED**",
    "nwk": 46461,
    "manufacturer": "Signify Netherlands B.V.",
    "model": "LCX004",
    "name": "Signify Netherlands B.V. LCX004",
    "quirk_applied": false,
    "quirk_class": "zigpy.device.Device",
    "manufacturer_code": 4107,
    "power_source": "Mains",
    "lqi": 255,
    "rssi": -56,
    "last_seen": "2023-07-25T18:09:36",
    "available": false,
    "device_type": "Router",
    "signature": {
      "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4107, maximum_buffer_size=82, maximum_incoming_transfer_size=128, server_mask=11264, maximum_outgoing_transfer_size=128, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
      "endpoints": {
        "11": {
          "profile_id": 260,
          "device_type": "0x010d",
          "in_clusters": [
            "0x0000",
            "0x0003",
            "0x0004",
            "0x0005",
            "0x0006",
            "0x0008",
            "0x0300",
            "0x1000",
            "0xfc01",
            "0xfc03"
          ],
          "out_clusters": [
            "0x0019"
          ]
        },
        "242": {
          "profile_id": 41440,
          "device_type": "0x0061",
          "in_clusters": [],
          "out_clusters": [
            "0x0021"
          ]
        }
      }
    },
    "active_coordinator": false,
    "entities": [
      {
        "entity_id": "light.signify_netherlands_b_v_lcx004_huelight",
        "name": "Signify Netherlands B.V. LCX004"
      },
      {
        "entity_id": "select.signify_netherlands_b_v_lcx004_start_up_behavior",
        "name": "Signify Netherlands B.V. LCX004"
      },
      {
        "entity_id": "button.signify_netherlands_b_v_lcx004_identify",
        "name": "Signify Netherlands B.V. LCX004"
      },
      {
        "entity_id": "number.signify_netherlands_b_v_lcx004_start_up_current_level",
        "name": "Signify Netherlands B.V. LCX004"
      },
      {
        "entity_id": "number.signify_netherlands_b_v_lcx004_start_up_color_temperature",
        "name": "Signify Netherlands B.V. LCX004"
      }
    ],
    "neighbors": [
      ...
     ],
    "routes": [
      {
        "dest_nwk": "0x0000",
        "route_status": "Active",
        "memory_constrained": false,
        "many_to_one": true,
        "route_record_required": false,
        "next_hop": "0x0000"
      },
      {
        "dest_nwk": "0x9CE9",
        "route_status": "Active",
        "memory_constrained": false,
        "many_to_one": false,
        "route_record_required": false,
        "next_hop": "0x54D5"
      }
    ],
    "endpoint_names": [
      {
        "name": "EXTENDED_COLOR_LIGHT"
      },
      {
        "name": "unknown 97 device_type of 0xa1e0 profile id"
      }
    ],
    "user_given_name": "hue",
    "device_reg_id": "0fdaad2c92063e6a54dc6c79afd57041",
    "area_id": "0237df7b8e2f17291df8d7c10b7caf47",
    "cluster_details": {
      "11": {
        "device_type": {
          "name": "EXTENDED_COLOR_LIGHT",
          "id": 269
        },
        "profile_id": 260,
        "in_clusters": {
          "0x0000": {
            "endpoint_attribute": "basic",
            "attributes": {
              "0x0004": {
                "attribute_name": "manufacturer",
                "value": "Signify Netherlands B.V."
              },
              "0x0005": {
                "attribute_name": "model",
                "value": "LCX004"
              }
            },
            "unsupported_attributes": {}
          },
          "0x0003": {
            "endpoint_attribute": "identify",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0004": {
            "endpoint_attribute": "groups",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0005": {
            "endpoint_attribute": "scenes",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0006": {
            "endpoint_attribute": "on_off",
            "attributes": {
              "0x0000": {
                "attribute_name": "on_off",
                "value": 0
              },
              "0x4003": {
                "attribute_name": "start_up_on_off",
                "value": 1
              }
            },
            "unsupported_attributes": {}
          },
          "0x0008": {
            "endpoint_attribute": "level",
            "attributes": {
              "0x0000": {
                "attribute_name": "current_level",
                "value": 254
              },
              "0x4000": {
                "attribute_name": "start_up_current_level",
                "value": 254
              }
            },
            "unsupported_attributes": {
              "0x0014": {
                "attribute_name": "default_move_rate"
              },
              "0x0011": {
                "attribute_name": "on_level"
              },
              "0x0010": {
                "attribute_name": "on_off_transition_time"
              },
              "0x0012": {
                "attribute_name": "on_transition_time"
              },
              "0x0013": {
                "attribute_name": "off_transition_time"
              }
            }
          },
          "0x1000": {
            "endpoint_attribute": "lightlink",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0xfc03": {
            "endpoint_attribute": "manufacturer_specific",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0300": {
            "endpoint_attribute": "light_color",
            "attributes": {
              "0x0000": {
                "attribute_name": "current_hue",
                "value": 194
              },
              "0x0001": {
                "attribute_name": "current_saturation",
                "value": 248
              },
              "0x0003": {
                "attribute_name": "current_x",
                "value": 15588
              },
              "0x0004": {
                "attribute_name": "current_y",
                "value": 6143
              },
              "0x0007": {
                "attribute_name": "color_temperature",
                "value": 500
              },
              "0x0008": {
                "attribute_name": "color_mode",
                "value": 1
              },
              "0x000f": {
                "attribute_name": "options",
                "value": 0
              },
              "0x4000": {
                "attribute_name": "enhanced_current_hue",
                "value": 2643
              },
              "0x4002": {
                "attribute_name": "color_loop_active",
                "value": 0
              },
              "0x400a": {
                "attribute_name": "color_capabilities",
                "value": 31
              },
              "0x400b": {
                "attribute_name": "color_temp_physical_min",
                "value": 153
              },
              "0x400c": {
                "attribute_name": "color_temp_physical_max",
                "value": 500
              },
              "0x4010": {
                "attribute_name": "start_up_color_temperature",
                "value": 366
              }
            },
            "unsupported_attributes": {}
          },
          "0xfc01": {
            "endpoint_attribute": "manufacturer_specific",
            "attributes": {},
            "unsupported_attributes": {}
          }
        },
        "out_clusters": {
          "0x0019": {
            "endpoint_attribute": "ota",
            "attributes": {},
            "unsupported_attributes": {}
          }
        }
      },

Logs
Logs

Custom quirk
Custom quirk

Additional information
No response

Just moved to ZHA to realize that this still isn’t solved. In Z2M you can use the Gradient Features and Effects like Flame. In ZHA this expensive light is downgraded to a 10$ lightstrip. Moving back to Z2M

Surprised to find such little activity on this request. Would be great if I didn't have to switch to Z2M...

The missing support for gradient lightstrips and the Tap Switch (Green Power Zigbee) are the only reasons why I can't get rid of my hue bridge.

I got one myself yesterday and the gradient didn't work. I mean no pressure on the devs but I really would appreciate support for this. There's a zigbee2mqtt issue that has been solved. Maybe the solution could help with this?
Either way, I love you devs. That's for your amazing project.

I am too really hoping this Ticket finally finds a way one the roadmap, pleeease :)

just configured 32 lamps into ZHA. signe lamp was last one, I would hate to move now to z2m :(

would also be interested in this working with ZHA


Data pipeline to link SDK estimates with individual transfers

Problem
Using SDK server logs (with additional logged params), create a way to link individual transfers with SDK slippage and amount received estimates.
Impact
We need this data to analyze how often our quotes are incorrect.
Proposed Solution

Filter SDK logs by the transfer's signer
Look up txn hash timestamp via explorer API
Find the best matching SDK estimate for both slippage and relayer fee
Save all details of the matching transfer and the estimate results

Acceptance Criteria

[ ] We can look at any individual transfer and find an SDK estimate for relayer fee and slippages that corresponded to that transfer

Summary of this task:

At best, we can narrow down a potential quote for a transfer given the quote estimate was logged (not avail thru UI transfers)
DD logs only go back 3 days so it's impossible to reference quotes before this
We have done an initial baselining for quote anomalies based on gas price

Next steps for this:

Enable longer logs retention and archive logs
Move UI to sdk-server, so quote logs are sent to DD
Pass on the anomaly detection scripts to Anton to convert into a pipeline


Missing onKeypressEvent Documentation

There doesn't appear to be any documentation for the onKeypressEvent introduced in v0.28.0. Reading through the code, it seems as if the method signature is the same as that of the 'click' events, and appears to be attached to the TimeGridEvent. Does this mean the event is fired when a specific event has focus? Like listing for the 'enter' or 'delete' key or something?

I tried this out in CodeSandbox, and could never get this event to fire.
https://codesandbox.io/s/z2jqpmlr14?file=/src/index.js

Hi @cutterbl,
Here is a forked CodeSandbox showing an implementation of this event:
https://codesandbox.io/s/react-big-calendar-forked-divxo?file=/src/index.js
The onKeyPressEvent callback will return two arguments (event: Object, e: Synthetic event) when the focus is on a specific event and a key is pressed.

@SeandenDrijver98 Thanks for that. Not really using it (yet), but saw it in recent code changes and thought I'd check it out. Still missing in the Docs though.


Index out of range for Yolact model..

I got this error while training on a custom dataset... I've already done changing necessary things in config.py what is the solution for this?
firstly i've change the dataset to this:-
Pothole_dataset = dataset_base.copy({
'name': 'Pothole_dataset',
'train_info': '/content/drive/MyDrive/Road_potholes/train/_annotations.coco.json',
'train_images': '/content/drive/MyDrive/Road_potholes/train/',
'valid_info': '/content/drive/MyDrive/Road_potholes/valid/_annotations.coco.json',
'valid_images': '/content/drive/MyDrive/Road_potholes/valid/',
'class_names': ('Pothole',),
'label_map': { 1:  1 }
})
then in config:
yolact_resnet50_potholes_config = yolact_resnet50_config.copy({
'name': 'yolact_plus_resnet50_potholes',
# Dataset stuff
'dataset': Pothole_dataset,
'num_classes': len(Pothole_dataset.class_names) + 1,
# Image Size
'max_size': 300,
})
please help @dbolya
#Error-----
/content/yolact
loading annotations into memory...
Done (t=0.01s)
creating index...
index created!
loading annotations into memory...
Done (t=0.00s)
creating index...
index created!
Initializing weights...
Begin training!
Traceback (most recent call last):
File "./train.py", line 504, in
train()
File "./train.py", line 270, in train
for datum in data_loader:
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 345, in next
data = self._next_data()
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 856, in _next_data
return self._process_data(data)
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 881, in _process_data
data.reraise()
File "/usr/local/lib/python3.7/dist-packages/torch/_utils.py", line 394, in reraise
raise self.exc_type(msg)
IndexError: Caught IndexError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
data = fetcher.fetch(index)
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/content/yolact/data/coco.py", line 94, in getitem
im, gt, masks, h, w, num_crowds = self.pull_item(index)
File "/content/yolact/data/coco.py", line 148, in pull_item
masks = [self.coco.annToMask(obj).reshape(-1) for obj in target]
File "/content/yolact/data/coco.py", line 148, in
masks = [self.coco.annToMask(obj).reshape(-1) for obj in target]
File "/usr/local/lib/python3.7/dist-packages/pycocotools/coco.py", line 442, in annToMask
rle = self.annToRLE(ann)
File "/usr/local/lib/python3.7/dist-packages/pycocotools/coco.py", line 427, in annToRLE
rles = maskUtils.frPyObjects(segm, h, w)
File "pycocotools/_mask.pyx", line 293, in pycocotools._mask.frPyObjects
IndexError: list index out of range

Hey
Did you find the solution?
I am stuck with the same issue.
Please help

I've experienced the same issue and in my case the bug was in the json annotation file, in particular some segmentation sublist was empty. Actually, looking at https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocotools/_mask.pyx#:~:text=def frPyObjects(pyobj%2C h%2C w) you can see that you must set at least four elements (therefore 2 points) in each sublist of the segmentation field. Check the link to see the complete list of case which throw that exception.

I was able to fix it by fixing the annotation file.
My file had a few empty lists in segmentation which led to this issue.
Removing them helped it to run successfully.


Add action to build dependencies table

Adding a github action to do build HTAN.dependencies.csv from the schematic API endpoints. Fixes #442

We could do it after JSON-LD generation. It might be a useful sniff test. That would require moving this job to be part of the ci-lint-validate-convert action and making it dependent on the JSON-LD creation being successful.

I just added this workflow to ci-lint-validate-convert
Changes:

Added the build-dependencies job, which depends on the convert job.
Integrated the original steps for building the dependencies table into this new job.
Added a "Fetch latest changes" step in the build-dependencies job to ensure it pulls the latest changes from the main branch, including the newly created JSON-LD file.

Let me know if this works!


Reduce dependency on Shelley.Compatibility module

[x] Move estimate{Min, Max}WitnessRequiredPerInput from AddressDerivation.Shared to Write.Tx.Sign module
[x] Remove Write.Tx.Balance dependency on Shelley.Compatibility.fromCardanoTx{In, Out}

Motivation
The new cardano-balance-tx library cannot depend on AddressDerivation.Shared, and it's easier if we avoid depending on Shelley.Compatibility. NB: We will need to bring the Shelley.Compatibility.Ledger along (either to cardano-balance-tx or to primitive).
Issue Number
ADP-3081

thanks @jonathanknowles!


Only unload when loading if unload arg is truthy

Fixes #2648.

Codecov Report

Merging #2649 into master will not change coverage.
The diff coverage is 50%.

@@           Coverage Diff           @@
##           master    #2649   +/-   ##
=======================================
  Coverage   80.14%   80.14%
=======================================
  Files          57       57
  Lines        4518     4518
=======================================
  Hits         3621     3621
  Misses        897      897

Impacted Files
Coverage Δ

src/api.load.js
55.88% <50%> (ø)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b7e869...435182e. Read the comment docs.


The agent presents a revoked verifiable credential

Agent version: 0.7.4
Test:

Holder agent receives 2 identical verifiable credentials
Issuer agent revokes the first verifiable credential
Verifier agent sends proof request to the holder agent
Holder agent (in automatic mode) generates a verifiable presentation and sends it to the verifier agent
Verifier agent gets the record and "verified" is set to false

Desired result: "verified": "true"
I am supposing that the holder is automatically selecting the first credential for generating the verifiable presentation, instead of the second one, although the first one is revoked.
Is there any way to tell the holder to skip the revoked credentials in the generation of the VP?

Thanks, I´ll share the details if I discover anything.


irmin-pack: Rename IO to io_legacy

Codecov Report

Merging #1851 (d413331) into main (97aa166) will not change coverage.
The diff coverage is 89.47%.

:exclamation: Current head d413331 differs from pull request most recent head a85078a. Consider uploading reports for the commit a85078a to get more accurate results

@@           Coverage Diff           @@
##             main    #1851   +/-   ##
=======================================
  Coverage   64.81%   64.81%
=======================================
  Files         120      120
  Lines       14453    14453
=======================================
  Hits         9368     9368
  Misses       5085     5085

Impacted Files
Coverage Δ

src/irmin-pack/atomic_write.ml
75.86% <ø> (ø)

src/irmin-pack/io_legacy.ml
92.59% <ø> (ø)

src/irmin-pack/unix/checks.ml
9.54% <0.00%> (ø)

src/irmin-pack/unix/ext.ml
65.41% <ø> (ø)

src/irmin-pack/unix/io_legacy.ml
80.85% <ø> (ø)

src/irmin-pack/unix/atomic_write.ml
87.25% <92.30%> (ø)

src/irmin-pack/unix/pack_store.ml
85.00% <95.45%> (ø)

src/irmin-pack/unix/dict.ml
92.15% <100.00%> (ø)

src/irmin-pack/unix/pack_dict.ml
100.00% <100.00%> (ø)

src/irmin-pack/unix/snapshot.ml
75.78% <100.00%> (ø)

... and 1 more

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more


ORDER BY not working

The ORDER BY clause in Lasair filters doesn't seem to work. Try this example on the dev box.
It says ORDER BY objects.gmag but when rendered. they're not. The same is true of the JSON and CSV exports.
So I traced things through the code, and the ORDER BY clause is retained in the SQL that is executed, and the table of results comes out in order. But then it gets sent off to the rendering and somehow the results are reordered in decreasing order of objectId.
Maybe the Bootstrap Datatable has a default sorting by the first column?

I think I have a fix in now. The problem was indeed the default ordering of the data table containing the results (javascript code). I have updated the code so that if an 'order by' is found in the SQL query then the sorting of the table is switched off, otherwise it will sort by objectId.
The example with an ORDER BY:
https://lasair-dev.lsst.ac.uk/filters/691/run/
An example without ORDER BY:
https://lasair-dev.lsst.ac.uk/filters/2/run/
All new code is in the hotfix/orderby branch.
https://github.com/lsst-uk/lasair4/compare/main...hotfix/orderby

The ORDER BY works if I SAVE the filter first then RUN.
But if I just type it in and click RUN, it ignores the ORDER BY.

Now fixed also in the filter creation page:


Reverse button in the Text Case Converter and Inspector tool has the same result as the Reverse alphabetize.

Current behavior
Same result as reverse alphabetization.
How to reproduce it (as minimally and precisely as possible)
test data

1 a 2
3 b 4
5 c 6
7 d 8
9 e 0
a j 1
b i 3
c h 5
d g 7
e f 9

Reverse alphabetize
Reverse

Expected behavior
Each press of the button reverses the line.
Screenshots
No response
Workaround
No response
Affected platforms
No response
Affected DevToys kind
DevToys (app with GUI)
DevToys Version
Version <IP_ADDRESS> | X64 | DEBUG | main | 56be3370
Relevant Assets/Logs
No response

Hi,
What you see is the expected result. In this specific scenario, the alphabetical reverse of the test data is the same thing that the reverse of the test data.
@micahmo , perhaps the term reverse is confusing? I admit I can't think of anything better for now though.

I agree, this is working as designed. Maybe @niyari is expecting the contents of each line to be reversed (i.e., at the character level)? I tried to make it clear that all of the new operations were on a per-line bases with the "Sort Lines" heading. Of course, I'm open to ideas for improving clarity!

Hi @niyari, now I understand what you're expecting, thank you for explaining.
On the one hand, I think this is implemented in accordance with the other operations on the page. They are one-way, and if you want to undo the operation, you can press "Original text".
On the other hand, the reason the above is true is because because most of the operations are idempotent. Reverse is not, and you could make an argument that, like Randomize, it should always operate on the current text rather than the original.
I guess I don't have a strong opinion here and will defer to the maintainer or others' opinions.

I think I prefer the way it is currently: doing an operation based on the original text and not what's currently in the text box. Let's keep an eye opened for further feedback though.


Add inspection method to discover what classes are available in transformation factory

Issue description / feature objectives
In some languages inspecting the factory class makes it very obvious what classes are supported. With the methodology define, it may not be as clear.
Define and implement an interface for developers to use to inspect what transformer classes have being registered into the singleton.

This issue has been completed and can be demonstrated in the existing codebase.


Check ig ChatGPT python suggestions can cleanup/optimize the code

it runs locally, will check later if merging is ok.


(BKR-554) Install AIX packages via install repo

This commit adds support for installing AIX 'packages' via the
install repo logic. AIX does not support repository management
and can only install 'RPM' files directly. Since this logic
is contained in the install repo logic in Beaker, we can use
this to install a package that has been mirrored to the standard
repo location.
This assumes that the package is mirrored to the repo location.
In other words, that the following files are the same.

http://builds.delivery.puppetlabs.net/puppet-agent/1214e51d63b84a82df0c55cab99abc2a3f90a597/artifacts/aix/7.1/PC1/ppc/puppet-agent-<IP_ADDRESS>.g1214e51-1.aix7.1.ppc.rpm
http://builds.delivery.puppetlabs.net/puppet-agent/1214e51d63b84a82df0c55cab99abc2a3f90a597/repos/aix/7.1/PC1/ppc/puppet-agent-<IP_ADDRESS>.g1214e51-1.aix7.1.ppc.rpm

It also assumes that the desired package is not defined for AIX
in the acceptance pre-suite for the project.

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/1573/
Test FAILed.

Test failures unrelated to patch.


Closing an editor via ctrl+p hides dirty entries but doesn't close the editor

Repro:

Dirty an editor
Switch tabs
Ctrl/cmd+p
Click the x, it disappears from the list but the editor does close - it should prompt

@Tyriar is this a regression? Did it ever work this way?

Yes it's a regression, I wouldn't say it's particularly important though

Actually works as designed. The behaviour for seeing the close dialog works fine when using the editors picker.

Oh I see now, it's removing the recently opened entry, not closing the file. Ambiguity could be removed here by just removing the ability to remove the item for currently opened editors, since clicking the x doesn't remove it from recently opened as it's currently open.

I am not really convinced this is worth it. I also do not agree with what you are saying, I can remove entries, even when they are opened if e.g. I close editors afterwards:

Given you can have tons of editors open I think a user might not really understand why suddenly some entries in the list cannot be closed while others can. Imho this adds more complexity than being helpful.


[Card in card]

A stand alone component in Storybook. This is a dependency of Cards group variation requested by AEM (previously Featured card group)
This component is being developed by HC team. Ref. Putra., estimated to be 3 points.
Final design spec
Link to design spec Box folder

FA notes

Video should open in Lightbox media viewer
Whole card is clickable, aka hover on image/video would trigger hover state of "inset" text card
Card icon should follow current CTA functionality, allowing multiple icon based on link type (email, external link, link, etc)
Media should be 16x9 on all breakpoints except sm, where it is 4x3
Potentially repurpose CTA - feature https://ibmdotcom-web-components.mybluemix.net/?path=/story/components-cta--feature

Updated the spec file on box to include additional information after the review on 3/1/20:

Interactive states
with grid overlay to see alignment

@shixiedesign @oliviaflory Thanks for updating this ticket to include the FA notes and design spec file.
Here's the JIRA ticket (https://jsw.ibm.com/browse/HC-1647) of this work that the HC team is using to track this contribution work on our end. cc: @RobertaJHahn


styling fixes for quickbook docs

https://github.com/boostorg/boostlook/issues/54

Hey @cdw9 - it seems that the pre-commit hook didn't run based on the CI job.
Run a pre-commit install locally, so next time the hook catches and fixes the errors in the CSS file. Thanks!


[Key Vault] Fix AOT warnings reported in latest version of .NET 8

Library name
Azure.Security.KeyVault.Keys
Please describe the feature.
There have been a lot of updates across the different versions of .NET 8 and its previews. With the official .NET 8 release, some new warnings are being reported in Azure.Security.KeyVault.Keys:

C:\Users\mredding\source\repos\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Keys\src\JsonWebKey.cs(517): Trim analysis warning IL2026: Azure.Security.KeyVault.Keys.JsonWebKey.CreateRSAProvider(RSAParameters): Using member 'System.Security.Cryptography.RSA.Create(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead. [C:\Users\mredding\source\repos\ResolveAOT\ResolveAOT\ResolveAOT.csproj]
C:\Users\mredding\source\repos\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Keys\src\JsonWebKey.cs(517): Trim analysis warning IL2026: Azure.Security.KeyVault.Keys.JsonWebKey.CreateRSAProvider(RSAParameters): Using member 'System.Security.Cryptography.AsymmetricAlgorithm.Create(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead. [C:\Users\mredding\source\repos\ResolveAOT\ResolveAOT\ResolveAOT.csproj]

After a preliminary investigation, it looks like the code is trying to call Create(RSAParameters) not Create(string), so it seems like it may be something that could be suppressed. If that is the case, then it would probably be best to get a review from the .NET team to make sure we're not misunderstanding the context.
To repro, follow the instructions here to make a console app: https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/prepare-libraries-for-trimming?pivots=dotnet-8-0#show-all-warnings-with-test-app
And have this be the .csproj:
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <PublishAot>true</PublishAot>
    <TrimmerSingleWarn>false</TrimmerSingleWarn>
  </PropertyGroup>

  <ItemGroup>
	  <ProjectReference Include="..\..\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Keys\src\Azure.Security.KeyVault.Keys.csproj" />
      <PackageReference Include="Azure.Security.KeyVault.Keys" Version="4.6.0-beta.2" />
	     <TrimmerRootAssembly Include="Azure.Security.KeyVault.Keys" />

    <!-- Update this dependency to its latest, which has all the annotations -->
    <PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="8.0.0-preview.7.23375.6" />
  </ItemGroup>

run dotnet publish with .NET 8

@eerhardt these AOT warnings look errant. We don't call AsymmetricAlgorithm.Create(String) or RSA.Create(String), but do call - via reflection - RSA.Create(RSAParameters): https://github.com/Azure/azure-sdk-for-net/blob/616dbcb604f399545ef170ffc97eb099bd4c8065/sdk/keyvault/Azure.Security.KeyVault.Keys/src/JsonWebKey.cs#L512
Or is the warning conceptually correct, but maybe the warning message itself is erroneous i.e., mentions the String param form when it's pretty much any parameterized call?
I definitely need to be able to create keys using RSAParameters (or ECParameters for ECDsa), but maybe we just need to attribute these and move on. I can see some AOT scenarios needing this functionality, but not sure if there's a better alternative.

@heaths - this looks like a bug in the trimming tools (IMO). The code is clearly only targeting the RSA.Create(RSAParameters) method, but for some reason the trimming tools is complaining (and preserving) all overloads of the RSA.Create method, including the base class. And since the other overloads of the method have RequiresUnreferencedCode on them, it is giving a warning.
Can you open an issue in https://github.com/dotnet/runtime for this? @vitek-karas @agocke and @MichalStrehovsky should be able to advise on if it is a real issue. My assumption is that this behavior is there for a reason - I just don't know what that reason is.
For now, my thought is to suppress the 2 warnings with links to the runtime issue as justificaiton.

Rather than trying to massage the reflection, could we ifdef instead? It looks like this project is already multitargeted.

I think in a perfect world, the trimming tools should be able to tell that this code is only talking about the Create(RSAParameters) overload and not warn (or preserve) the Create(string) overload.

The analysis doesn't look at this because replicating the algorithm that GetMethod uses to find the overload would likely be a bug farm. The original designers of the reflection stack wanted this API to be convenient, so the semantics are not what one would expect.
using System;
using System.Reflection;

var m = typeof(Foo).GetMethod(nameof(Foo.Method), BindingFlags.Public | BindingFlags.Static,
    new Type[] { typeof(byte) });
Console.WriteLine(m);

class Foo
{
    public static void Method(int x) { }
}

Notice this is asking for a method that takes a byte, but reflection logic will just hand out the method that takes an int. The current trimming analysis is conservative, but correct (it may issue unnecessary warnings but it will not produce a broken program without warnings). Matching the overload resolution rules is not entirely trivial.

Rather than trying to massage the reflection, could we ifdef instead? It looks like this project is already multitargeted.

The shipping package targets only netstandard2.0: https://github.com/Azure/azure-sdk-for-net/blob/2de1165621d8594ea70af1befa43ce3d647f31c8/sdk/keyvault/Azure.Security.KeyVault.Keys/src/Azure.Security.KeyVault.Keys.csproj#L11 ($(RequiredTargetFrameworks) is defined only as netstandard2.0 for shipping packages).
I've done an analysis previously and found a large number of TFMs are necessary and #ifdefs still won't cover all cases because the number of methods that are defined in supports runtimes but not declared in .NETStandard, hence all the reflection-based light-up. I'm not sure we want to multi-target just to satisfy an (understandably) errant warning so I'll likely just suppress it.


Background Music

have some nice jams in the background.
But allow player to move sliders to disable volume...

Closed by #61


paper question

Hi author, how is trajectory confidence defined?

Hi microchila. Sorry for the late response. Currently, our research focuses on the confidence score of detection objects, so we have not defined the confidence of the trajectory. Thank you.


Create single product page

reworked single product page, connected both front and back end, should be able to get single component views now. Please approve.


Push to 0.6.1

Merging for 0.6.1

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

0 of 41 (0.0%)  changed or added relevant lines in 3 files are covered.
1 unchanged line in 1 file lost coverage.
Overall coverage decreased (-0.007%) to 6.688%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

brane-cfg/src/secrets.rs
0
5
0.0%

brane-cli/src/test.rs
0
16
0.0%

brane-cli/src/utils.rs
0
20
0.0%

Files with Coverage Reduction
New Missed Lines
%

brane-cli/src/test.rs
1
0%

Totals

Change from base Build<PHONE_NUMBER>:
-0.007%

Covered Lines:
525

Relevant Lines:
7850

💛  - Coveralls


CH340 Receiving 32 bytes and its multiples

The problem is with CH340 chips (tested on few CH340 units) - there is no possibility to receive array which size is multiple of 32 bytes.
I tested this on the demo program with async communication:
sendButton.setOnClickListener(new View.OnClickListener() {
    @Override
     public void onClick(View v) {
         if (usbService != null) {
             byte[] data = new byte[32];
             usbService.write(data);
         }
     }
});

Tx and Rx lines are shorted for echo functionality, so if I send 32 bytes I should get exacly the same 32 bytes, but nothing comes from buffer..
Changing the size from 32 to any other value which isn't 32 multiple (like 31 or 33) causes that everything works just fine.
The problem also occurs for 64, 96, 128, 160, e.t.c. bytes.
The problem doesn't occur on PL2303, FT232, CDC (Arduino) chips.

Hi,
Will you have time to look at this problem?
BR


I installed Prometheus for metrics and envoy restarting in a loop.

Logs....
[2024-09-16 12:45:32.137][6][info][main] [source/server/server.cc:432]   envoy.http.header_validators: envoy.http.header_validators.envoy_default
[2024-09-16 12:45:32.137][6][info][main] [source/server/server.cc:432]   envoy.quic.connection_id_generator: envoy.quic.deterministic_connection_id_generator
[2024-09-16 12:45:32.137][6][info][main] [source/server/server.cc:432]   envoy.http.early_header_mutation: envoy.http.early_header_mutation.header_mutation
[2024-09-16 12:45:32.137][6][info][main] [source/server/server.cc:432]   envoy.retry_priorities: envoy.retry_priorities.previous_priorities
[2024-09-16 12:45:32.137][6][info][main] [source/server/server.cc:432]   envoy.regex_engines: envoy.regex_engines.google_re2
[2024-09-16 12:45:32.148][6][info][main] [source/server/server.cc:486] HTTP header map info:
[2024-09-16 12:45:32.149][6][info][main] [source/server/server.cc:489]   request header map: 664 bytes: :authority,:method,:path,:protocol,:scheme,accept,accept-encoding,access-control-request-headers,access-control-request-method,access-control-request-private-network,authentication,authorization,cache-control,cdn-loop,connection,content-encoding,content-length,content-type,expect,grpc-accept-encoding,grpc-timeout,if-match,if-modified-since,if-none-match,if-range,if-unmodified-since,keep-alive,origin,pragma,proxy-connection,proxy-status,referer,te,transfer-encoding,upgrade,user-agent,via,x-client-trace-id,x-envoy-attempt-count,x-envoy-decorator-operation,x-envoy-downstream-service-cluster,x-envoy-downstream-service-node,x-envoy-expected-rq-timeout-ms,x-envoy-external-address,x-envoy-force-trace,x-envoy-hedge-on-per-try-timeout,x-envoy-internal,x-envoy-ip-tags,x-envoy-is-timeout-retry,x-envoy-max-retries,x-envoy-original-path,x-envoy-original-url,x-envoy-retriable-header-names,x-envoy-retriable-status-codes,x-envoy-retry-grpc-on,x-envoy-retry-on,x-envoy-upstream-alt-stat-name,x-envoy-upstream-rq-per-try-timeout-ms,x-envoy-upstream-rq-timeout-alt-response,x-envoy-upstream-rq-timeout-ms,x-envoy-upstream-stream-duration-ms,x-forwarded-client-cert,x-forwarded-for,x-forwarded-host,x-forwarded-port,x-forwarded-proto,x-ot-span-context,x-request-id
[2024-09-16 12:45:32.149][6][info][main] [source/server/server.cc:489]   request trailer map: 120 bytes:
[2024-09-16 12:45:32.149][6][info][main] [source/server/server.cc:489]   response header map: 432 bytes: :status,access-control-allow-credentials,access-control-allow-headers,access-control-allow-methods,access-control-allow-origin,access-control-allow-private-network,access-control-expose-headers,access-control-max-age,age,cache-control,connection,content-encoding,content-length,content-type,date,etag,expires,grpc-message,grpc-status,keep-alive,last-modified,location,proxy-connection,proxy-status,server,transfer-encoding,upgrade,vary,via,x-envoy-attempt-count,x-envoy-decorator-operation,x-envoy-degraded,x-envoy-immediate-health-check-fail,x-envoy-ratelimited,x-envoy-upstream-canary,x-envoy-upstream-healthchecked-cluster,x-envoy-upstream-service-time,x-request-id
[2024-09-16 12:45:32.149][6][info][main] [source/server/server.cc:489]   response trailer map: 144 bytes: grpc-message,grpc-status
[2024-09-16 12:45:32.160][6][info][main] [source/server/server.cc:861] runtime: {}
[2024-09-16 12:45:32.160][6][info][main] [source/server/server.cc:721] No admin address given, so no admin HTTP server started.
[2024-09-16 12:45:32.160][6][info][config] [source/server/configuration_impl.cc:168] loading tracing configuration
[2024-09-16 12:45:32.160][6][info][config] [source/server/configuration_impl.cc:124] loading 0 static secret(s)
[2024-09-16 12:45:32.160][6][info][config] [source/server/configuration_impl.cc:130] loading 5 cluster(s)
[2024-09-16 12:45:32.165][6][info][config] [source/server/configuration_impl.cc:138] loading 2 listener(s)
[2024-09-16 12:45:32.183][6][info][config] [source/server/configuration_impl.cc:168] loading tracing configuration
[2024-09-16 12:45:32.183][6][info][config] [source/server/configuration_impl.cc:124] loading 0 static secret(s)
[2024-09-16 12:45:32.183][6][info][config] [source/server/configuration_impl.cc:130] loading 5 cluster(s)
[2024-09-16 12:45:32.192][6][info][config] [source/server/configuration_impl.cc:138] loading 2 listener(s)
[2024-09-16 12:45:32.195][6][critical][main] [source/server/server.cc:414] error initializing config '  /etc/envoy/envoy.yaml': route: unknown cluster 'admin'
[2024-09-16 12:45:32.196][6][info][main] [source/server/server.cc:1029] exiting

Adding "dashmate config set platform.gateway.admin.enabled true" solves the issue.

That was a workaround for the current version. Here is an actual fix https://github.com/dashpay/platform/pull/2132

Actually this is wrong. Cluster looks at admin so it won't work until admin is enabled. So yes, the only solution is enable admin and I would prefer if a user does it explicitly.


Mongo.Ecto.truncate is not working

I have spent the past day attempting to debug controller tests that were returning errors. These controller tests were generated as part of executing the following command:
mix phoenix.gen.html

This creates a number of files, of course, one being a controller and controller test. When running these tests without any alteration, I was receiving several errors, most of them similar to the following:
$ mix test test/controllers/car_controller_test.exs
Compiled test/support/conn_case.ex
......
  1) test updates chosen resource and redirects when data is valid (Shrek.CarControllerTest)
     test/controllers/car_controller_test.exs:47
     ** (Ecto.MultipleResultsError) expected at most one result but got 3 in query:

     from c in Shrek.Car,
       where: c.make == ^"some content",
       where: c.model == ^"some content",
       where: c.year == ^42

     stacktrace:
       (ecto) lib/ecto/repo/queryable.ex:47: Ecto.Repo.Queryable.one/4
       test/controllers/car_controller_test.exs:51

After several hours determining which tests were causing problems, all of the tests which failed were doing so because there were multiple objects in the database that were matching query criteria, when it was only expecting one (hence the error message above). This was fairly confusing, as in the conn_case.ex file, the following line should have been executing:
      Mongo.Ecto.truncate(Shrek.Repo, [])

After repeated tests, I finally constructed a test case which did nothing but that one line of code, and the result is that this line is not truncating the database. That makes sense -- subsequent tests are choking on the data that previous tests have inserted into the database.
How do I get the truncate to work, or is this a bug? Thx...

What version of MongoDB are you on?
Possible duplicate of https://github.com/michalmuskala/mongodb_ecto/issues/64

I'm on MongoDB v3.2.0 -- it appears that this is the same issue as #64. Do I need to move back to < 3.2, or is this an easy fix?

I'm closing this issue in favour of the other one.


post: js-ipfs blog post

@lgierth applied all your CR. Wanna merge and publish? :D

@mishmosh @lgierth applied both CR. Good to merge and publish?

Yes!
On Thu, May 25, 2017 at 11:56 AM David Dias<EMAIL_ADDRESS>wrote:

@mishmosh https://github.com/mishmosh @lgierth
https://github.com/lgierth applied both CR. Good to merge and publish?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ipfs/blog/pull/103#issuecomment-304047329, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABPtpGba-Y9x0A6oxeOsrhYwWAXhDIRUks5r9aSygaJpZM4NmUBT
.

It's live https://ipfs.io/blog/26-js-ipfs-0-24/


Expose CodeAction "Disable for this line" for non-autofixable errors

Currently the CodeAction "Disable for this line" is only present if the error is flagged as autofix-able, but I'd like to have it for non-autofixable errors too.
It's a very minor convenience boost :-)
Thanks for a great plugin!
Magnus

I have added this feature in #35, can you pull and test this feature @magnuslarsen ?

I can confirm that is works - thanks you so much!

Great, I will merge and publish this in the upcoming release after #36 is solved!


Assume Role issue - when using Assume Role in Console application inside EC2 instance it is able to retrieve temporary credentials using metadata Service. but not able to connect to metadata service when same code used inside windows Service

Describe the bug
Assume Role issue - when using Assume Role in Console application inside EC2 instance it is able to retrieve temporary credentials using metadata Service. but not able to connect to metadata service when same code used inside windows Service , it again was able to connect to metadata service when fiddler was open. Please let me know what might be the issue . Below are the error and inner errors which is thrown when using inside windows service.
One or more errors occurred. Amazon.Runtime.AmazonServiceException: Unable to get IAM security credentials from EC2 Instance Metadata Service. at Amazon.Runtime.DefaultInstanceProfileAWSCredentials.FetchCredentials() at Amazon.Runtime.DefaultInstanceProfileAWSCredentials.GetCredentials() at Amazon.Runtime.DefaultInstanceProfileAWSCredentials.GetCredentialsAsync() at Amazon.Runtime.Internal.CredentialsRetriever.d__71.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Amazon.Runtime.Internal.RetryHandler.d__101.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Amazon.Runtime.Internal.RetryHandler.d__101.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Amazon.Runtime.Internal.CallbackHandler.d__91.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Amazon.Runtime.Internal.CallbackHandler.d__91.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Amazon.Runtime.Internal.ErrorCallbackHandler.d__51.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Amazon.Runtime.Internal.MetricsHandler
Expected Behavior
My use case is retrieving AWS Temporary Credentials using Metadata service inside EC2 instance . which is also the expected behaviour.
Current Behavior
Not able to retrieve Temporary Credentials when code is run inside windows service , but works completely fine when run in a Console Application . or able to run inside windows service when fiddler is open and running .
Reproduction Steps
AmazonSecurityTokenServiceClient client = new AmazonSecurityTokenServiceClient();
var response = client.AssumeRoleAsync(new AssumeRoleRequest
{
RoleArn = "rolearn",
RoleSessionName = "sessionname"
});
Amazon.SecurityToken.Model.Credentials credentials = response.Result.Credentials;
Possible Solution
No response
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
AWSSDK.SecurityToken
AWSSDK..Core
Targeted .NET Platform
.NET Framework 4.8
Operating System and version
Windows 10

@APTest01 Good afternoon. Unfortunately, I'm unable to reproduce the issue. Below are the reproduction steps.

Using Visual Studio 2022, created a new Windows Service (.NET Framework) project named TestWindowsService.

In Designer, added a new EventLog control named eventLogInstance from toolbox.
Renamed the service code file to TestAwsWindowsService.cs and opened code view for the service to modify the code to below:

using Amazon.S3;
using System;
using System.Diagnostics;
using System.ServiceProcess;
using System.Timers;

namespace TestWindowsService
{
    public partial class TestAwsWindowsService : ServiceBase
    {
        private int eventId = 1;

        public TestAwsWindowsService()
        {
            InitializeComponent();

            eventLogInstance = new EventLog();
            if (!EventLog.SourceExists("TestAwsWindowsServiceSource"))
            {
                EventLog.CreateEventSource("TestAwsWindowsServiceSource", "TestAwsWindowsServiceLog");
            }
            eventLogInstance.Source = "TestAwsWindowsServiceSource";
            eventLogInstance.Log = "TestAwsWindowsServiceLog";

        }

        protected override void OnStart(string[] args)
        {
            eventLogInstance.WriteEntry("In OnStart.");

            // Set up a timer that triggers every minute.
            Timer timer = new Timer
            {
                Interval = 60000 // 60 seconds
            };
            timer.Elapsed += new ElapsedEventHandler(this.OnTimer);
            timer.Start();

        }

        private void OnTimer(object sender, ElapsedEventArgs e)
        {
            eventLogInstance.WriteEntry("Monitoring AWS buckets", EventLogEntryType.Information, eventId++);
            try
            {
                using (AmazonS3Client client = new AmazonS3Client())
                {
                    eventLogInstance.WriteEntry("Listing buckets...");
                    var response = client.ListBuckets();
                    foreach (var bucket in response.Buckets)
                    {
                        eventLogInstance.WriteEntry(bucket.BucketName);
                    }
                }
            }
            catch (Exception ex)
            {
                eventLogInstance.WriteEntry("Exception occurred: " + ex.Message);
                eventLogInstance.WriteEntry(ex.StackTrace);
                var tempEx = ex;

                while (ex.InnerException != null)
                {
                    tempEx = ex.InnerException;
                    eventLogInstance.WriteEntry("Exception occurred: " + tempEx.Message);
                    eventLogInstance.WriteEntry(tempEx.StackTrace);
                }
            }
        }

        protected override void OnStop()
        {
            eventLogInstance.WriteEntry("In OnStop.");
        }
    }
}

Rebuild the project.
Launched a new Windows EC2 instance:

Ensured that IMDS is enabled (default setting).
Attached IAM role with the following permission policy AmazonS3ReadOnlyAccess.
Attached Key Pair at launch so that Windows Administrator password could be decrypted for connecting via remote desktop.

Connected to EC2 instance using Remote Desktop.

Installed PowerShell 7.x on the EC2 instance.
Copied the Debug or Release folder build for the Windows service project to EC2 instance.
Opened PowerShell 7 prompt.

Installed new service using the command New-Service -Name TestWindowsSevice -BinaryPathName <<absolute-path-to-windows-service-exe>>\Debug\TestWindowsService.exe. This installs service to be executed under Local System account.

Started the Windows service using Windows Services console.
Opened Event Viewer and navigated to Applications and Services Logs > TestAwsWindowsServiceLog.
RESULT: Diagnostic logging is logged mentioning successful listing of S3 buckets.

Please check:

If you have IMDS enabled for your EC2 instance and attached proper permissions.
I'm unsure why your service would work when Fiddler is running. It might also be a worthwhile checking the service run as user account, might be it is different from Local System account and has some restrictions to make HTTP calls. My hunch is that Fiddler is a web proxy that intercepts the HTTP requests. So when it is launched, it's intercepting AWS HTTP calls which run under current logged on user account (not the service run as user account).

Thanks,
Ashish


ref: document dvc exp clean

You may disregard these recommendations if you used the Edit on GitHub button from dvc.org to improve a doc in place.

❗ Please read the guidelines in the Contributing to the Documentation list if you make any substantial changes to the documentation or JS engine.
🐛 Please make sure to mention Fix #issue (if applicable) in the description of the PR. This causes GitHub to close it automatically when the PR is merged.
Please choose to allow us to edit your branch when creating the PR.
Thank you for the contribution - we'll try to review it as soon as possible. 🙏
Docs PR for https://github.com/iterative/dvc/pull/9090

do we need anything to do to enable syntax highlight for the new command?

https://github.com/iterative/gatsby-theme-iterative/blob/main/packages/gatsby-theme-iterative/config/prismjs/dvc-commands.js
We need to add the command to this list on the theme.

Added https://github.com/iterative/gatsby-theme-iterative/pull/182. We'll need to bump the theme later.


Error: Forbidden at Request.http (node_modules/@sendgrid/client/src/classes/client.js:124)

Issue Summary
We are not receiving email consistently, in GCP error report I see Forbidden Request.
Exception/Log
Error: Forbidden
at Request.http (node_modules/@sendgrid/client/src/classes/client.js:124)
at Request.self.callback (request.js:185)
at Request.emit (events.js:198)
at Request.EventEmitter.emit (domain.js:466)
at Request.<anonymous> (node_modules/request/request.js:1161)
at Request.emit (events.js:198)
at Request.EventEmitter.emit (domain.js:466)
at IncomingMessage.<anonymous> (node_modules/request/request.js:1083)
at Object.onceWrapper (events.js:286)
at IncomingMessage.emit (events.js:203)
at IncomingMessage.EventEmitter.emit (domain.js:466)
at endReadableNT (_stream_readable.js:1145)
at process._tickCallback (next_tick.js:63)

May need to add credit card details to make 3rd party API calls in GCP.

Still no one knows what is the issue?

@monsam you need first to verify your domain (Domain Authentication) or to set single sender (Single Sender Verification)


@thirdweb/react not compatible with the recent version of wagmi

I open this issue because I recently encounter an issue with the react package of thirdweb. This is the issue and the response from wagmi:
https://github.com/wagmi-dev/wagmi/issues/1858#issuecomment-1431699318

Hey @theArtechnology since you're using wagmi directly you're likely going to be best off using our "react-core" package which lets you use your own version of wagmi for all wallet level actions and you then just pass the signer directly to the

as an example this should work:
initialize wagmi (per their docs):
import { WagmiConfig, createClient } from 'wagmi'
import { getDefaultProvider } from 'ethers'

const client = createClient({
 autoConnect: true,
 provider: getDefaultProvider(),
})

function App() {
 return (
   <WagmiConfig client={client}>
     <WrappedThirdwebProvider />
   </WagmiConfig>
 )
}

wrapped inside the <WagmiConfig> somewhere you can then do
import { ThirdwebSDKProvider } from '@thirdweb-dev/react-core'
import { useSigner } from 'wagmi'

function WrappedThirdwebProvider(){
  const { data: signer } = useSigner()

  return (
    <ThirdwebSDKProvider
      {/* pass the signer from wagmi as a prop */}
      signer={signer}
      {/* other provider options */}
    >
      <TheRestOfYourApp />
    </ThirdwebSDKProvider>
  )
}


Open channel with insufficient ETH balance behaves awkward

Steps to Reproduce
Preparation in the dApp:

Attempt to add new token
Use the mint token button

Become mad in MetaMask:
3. Transfer the full balance (use MAX button) to another account (you
hopefully control)
Create error on SDK

Call openChannel on the SDK for the token just minted initial balance and an active partner (basically make sure that everything on this request is fine)

Expected Result

SDK responds/throws error
SDK detects the issue (maybe ahead?)
SDK does not create the channel object

Actual Result

No response/error
SDK logs internally error of failing transaction by EthersJS
SDK has open channel object what actually can't be used and is a zombie (my interpretation)

Additional Infos (Optional)
This is the log of the SDK:
 action     {
  type: 'token/monitored',
  payload: {
    token: '0x0f84DB873066d53379eC99048609d51b6239c409',
    tokenNetwork: '0xb3bd0c1D08346070662d4181f5837F95bf62FB01',
    fromBlock: 2114501
  }
}
 action     {
  type: 'channel/open/request',
  payload: { settleTimeout: undefined, deposit: BigNumber { _hex: '0x01' } },
  meta: {
    tokenNetwork: '0xb3bd0c1D08346070662d4181f5837F95bf62FB01',
    partner: '0x1F916ab5cf1B30B22f24Ebf435f53Ee665344Acf'
  }
}
 action     { type: 'block/new', payload: { blockNumber: 2877405 } }
 action     { type: 'block/new', payload: { blockNumber: 2877406 } }
 action     {
  type: 'channel/open/success',
  payload: {
    id: 7,
    token: '0x0f84DB873066d53379eC99048609d51b6239c409',
    settleTimeout: 500,
    isFirstParticipant: true,
    txHash: '0x163212e97c89f15c2230613a3395b6739d7fb08e630e5035d48d6548cd676c45',
    txBlock: 2877406,
    confirmed: undefined
  },
  meta: {
    tokenNetwork: '0xb3bd0c1D08346070662d4181f5837F95bf62FB01',
    partner: '0x1F916ab5cf1B30B22f24Ebf435f53Ee665344Acf'
  }
}
 action     {
  type: 'channel/deposit/failure',
  payload: Error: gas required exceeds allowance (8000000) or always failing transaction
      at getResult (/home/thore/projects/brainbot-projects/repositories/raiden/light-client/raiden-ts/node_modules/ethers/providers/json-rpc-provider.js:40:21)
      at exports.XMLHttpRequest.request.onreadystatechange (/home/thore/projects/brainbot-projects/repositories/raiden/light-client/raiden-ts/node_modules/ethers/utils/we
b.js:111:30)
      at exports.XMLHttpRequest.dispatchEvent (/home/thore/projects/brainbot-projects/repositories/raiden/light-client/raiden-ts/node_modules/xmlhttprequest/lib/XMLHttpRe
quest.js:591:25)
      at setState (/home/thore/projects/brainbot-projects/repositories/raiden/light-client/raiden-ts/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:610:14)
      at IncomingMessage.<anonymous> (/home/thore/projects/brainbot-projects/repositories/raiden/light-client/raiden-ts/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:
447:13)
      at IncomingMessage.emit (events.js:327:22)
      at endReadableNT (_stream_readable.js:1221:12)
      at processTicksAndRejections (internal/process/task_queues.js:84:21) {
    code: -32000,
    data: undefined,
    url: 'https://goerli.infura.io/v3/a23320bce0ea4ddfb6bb6f9f2240e99d',
    body: '{"method":"eth_estimateGas","params":[{"gasPrice":"0x77359400","from":"0xA1a663837b8E53E9d3Da9Eb4A010a5D43B0C31a1","to":"0xb3bd0c1D08346070662d4181f5837F95bf62
FB01","data":"0x63ea01430000000000000000000000000000000000000000000000000000000000000007000000000000000000000000a1a663837b8e53e9d3da9eb4a010a5d43b0c31a1000000000000000000
00000000000000000000000000000000000000000000010000000000000000000000001f916ab5cf1b30b22f24ebf435f53ee665344acf"}],"id":370,"jsonrpc":"2.0"}',
    responseText: '{"jsonrpc":"2.0","id":370,"error":{"code":-32000,"message":"gas required exceeds allowance (8000000) or always failing transaction"}}'
  },
  meta: {
    tokenNetwork: '0xb3bd0c1D08346070662d4181f5837F95bf62FB01',
    partner: '0x1F916ab5cf1B30B22f24Ebf435f53Ee665344Acf'
  },
  error: true
}

From what I can see in the logs the channel opening transaction was successful, only the deposit failed. These are two different smart contract calls. In general, opening a channel without depositing is still acceptable as far as Raiden is concerned.
Opening a channel with zero deposit won't fail. I would not say the channel is zombie or unusable because you can still receive on even if you have 0 deposit. And as soon as you receive you can also send.

Okay this is awkward. How could the channel have been created?

So I checked Etherscan. There is no other transaction after the one sending the whole balance.

I can redo this again and again for new tokens also with 0 deposit.

And importantly: I don't get a response.

Okay, first things first. I was a big unorganized and mixed my both accounts
I used to transfer the ETH. So I was using the wrong account to do the test. So if there is not enough ETH to pay, I get a valid error. The issue is now only about insufficient token funds. This is what the log above is actually about. I'll adjust the issue tile and description.

So as I understood it now (@andrevmatos please correct) me is the actual issue that the SDK does catch and reject() on a failing gas estimation for the first transfer to open the channel, but not for the deposit one.

Yes, the failure channel/deposit/failure you saw is expected (since you didn't have the funds), but since the channel/open/success action went through, it should not prevent your API call to resolve successufully. This happened because the error happened before sending the tx, on estimateGas (which is good, since it saves gas from a tx that would fail anyway), while I catch/handle the failure only for the recipe, i.e. when the transaction is sent but fails on-chain. I'll fix by ensuring we handle both errors and doesn't impact the rest of the chain.
Thank you for the report though, this is some very specific edge condition.


Implement Vec in storage, potentially starting with a new type StorageVec

Vec<T> cannot be used in storage today because its data is heap data. Ideally, we would be able to have a type Vec<T> that behaves differently depending on whether it's declared inside a storage block or outside it.

If declared outside a storage block, then Vec<T> and its methods would behave exactly as they do today.
If declared inside a storage block, then Vec<T> and its methods would store and access its data from storage instead of the heap.

A good starting point however is to implement StorageVec<T> with the same API as Vec<T>, but uses persistent storage instead of the heap.

I would like to start implementing a seperate StorageVec type right now

#2048


🔥 [FEATURE] Ability to use it in page transition

Is it possible to use it in page transition or in AnimatedSwitcher widget?

Is it possible to use it in page transition or in AnimatedSwitcher widget?
Hello,

I will take a close look at this case and write back ASAP.

Is it possible to use it in page transition or in AnimatedSwitcher widget?

Currently, It is working for both AnimatedSwitcher and page transitions.
You may try for AnimatedSwitch (don't forget to use keys in widgets for correct switch animation):
import 'package:animated_glitch/animated_glitch.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Animated Glitch Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  bool _showGlitched = true;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: AnimatedSwitcher(
        duration: const Duration(seconds: 1),
        child: _showGlitched
            ? const _Glitched(
                key: Key('asset'),
                image: AssetImage(
                  'assets/cyberpunk.jpg',
                ),
              )
            : const _Glitched(
                key: Key('network'),
                image: NetworkImage(
                  'https://images.immediate.co.uk/production/volatile/sites/3/2022/09/Edgerunners-connect-to-Cyberpunk-2077-timeline-b233bcb.jpg?quality=90&resize=980,654',
                ),
              ),
      ),
      floatingActionButton: FloatingActionButton.large(
        onPressed: () {
          setState(() {
            _showGlitched = !_showGlitched;
          });
        },
        child: const Text(
          'switch',
          textAlign: TextAlign.center,
        ),
      ),
    );
  }
}

class _Glitched extends StatefulWidget {
  final ImageProvider image;

  const _Glitched({
    required this.image,
    super.key,
  });

  @override
  State<_Glitched> createState() => _GlitchedState();
}

class _GlitchedState extends State<_Glitched> {
  final _controller = AnimatedGlitchController(
    frequency: const Duration(milliseconds: 200),
  );

  @override
  Widget build(BuildContext context) {
    return AnimatedGlitch(
      controller: _controller,
      child: Image(
        image: widget.image,
        fit: BoxFit.cover,
        height: double.infinity,
        width: double.infinity,
      ),
    );
  }
}

Output:

And for page transitions:
import 'package:animated_glitch/animated_glitch.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Animated Glitch Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: const _Glitched(
        key: Key('asset'),
        image: AssetImage(
          'assets/cyberpunk.jpg',
        ),
      ),
      floatingActionButton: FloatingActionButton.large(
        onPressed: () {
          Navigator.of(context).push(
            _FadeRoute(
              child: const _SecondPage(),
            ),
          );
        },
        child: const Text(
          'open',
          textAlign: TextAlign.center,
        ),
      ),
    );
  }
}

class _Glitched extends StatefulWidget {
  final ImageProvider image;

  const _Glitched({
    required this.image,
    super.key,
  });

  @override
  State<_Glitched> createState() => _GlitchedState();
}

class _GlitchedState extends State<_Glitched> {
  final _controller = AnimatedGlitchController(
    frequency: const Duration(milliseconds: 200),
  );

  @override
  Widget build(BuildContext context) {
    return AnimatedGlitch(
      controller: _controller,
      child: Image(
        image: widget.image,
        fit: BoxFit.cover,
        height: double.infinity,
        width: double.infinity,
      ),
    );
  }
}

class _FadeRoute extends PageRouteBuilder {
  _FadeRoute({required Widget child})
      : super(
          pageBuilder: (_, animation, ___) => FadeTransition(
            opacity: animation,
            child: child,
          ),
        );
}

class _SecondPage extends StatelessWidget {
  const _SecondPage();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      extendBodyBehindAppBar: true,
      appBar: AppBar(
        automaticallyImplyLeading: true,
        backgroundColor: Colors.transparent,
      ),
      body: const _Glitched(
        key: Key('network'),
        image: NetworkImage(
          'https://images.immediate.co.uk/production/volatile/sites/3/2022/09/Edgerunners-connect-to-Cyberpunk-2077-timeline-b233bcb.jpg?quality=90&resize=980,654',
        ),
      ),
    );
  }
}

Output:

Is it possible to only animate while switching not all the time?

Is it possible to only animate while switching not all the time?

Do you mean using that effect exactly as a transition?

Yeah, like only glitch when its transitioning

Yeah, like only glitch when its transitioning, like instead of FadeTransition()

Got it. I will think about that over the weekend.

Thank you, it'll be cool to use it with animated_glitch I'm trying to achieve cyberpunk aesthetic like futuristic look and feel.


[TF 2.0 API Docs] tf.audio

Docs update for https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/audio
Needs high level description & usage example
I plan to submit a PR for this issue, please assign to me

Found this question on stack overflow - https://stackoverflow.com/questions/48675097/from-audio-to-tensor-back-to-audio-in-tensorflow

I plan to submit a PR for this issue

Git log history of tf.audio
RELEASE.md:* Replace tf.scalar_summary, tf.histogram_summary, tf.audio_summary, tf.image_summary with tf.summary.scalar, tf.summary.histogram, tf.summary.audio, tf.summary.image, respectively. The new summary ops take name rather than tag as their first argument, meaning summary ops now respect TensorFlow name scopes.
tensorflow/contrib/deprecated/__init__.py:tf.audio_summary -> tf.compat.v1.summary.audio
tensorflow/contrib/ffmpeg/README.md:tf.audio.decode_audio accepts MP3, WAV, and OGG file formats.
tensorflow/tools/compatibility/testdata/test_file_v0_11.py:          tf.audio_summary("sin_wave", audio, sampling_frequency),
tensorflow/tools/compatibility/tf_upgrade.py:        "tf.audio_summary": "tf.summary.audio",

Updated description

Tryna find where the api interface is implemented & what code it's pointing to
➜  python_api git:(master) ls | grep Audio
api_def_AudioSpectrogram.pbtxt
api_def_AudioSummary.pbtxt
api_def_AudioSummaryV2.pbtxt
api_def_WriteAudioSummary.pbtxt

Asked for help in Gitter - tensorflow/sig-io
Augustina Ragwitz @missaugustina 12:54
I'm working on updating the tf.audio docs & I was wondering if anyone here had a moment to talk to me about TF's audio encoding implementation? I'm seeing fragments littered throughout the code base & I'm not quite sure how it ties into the api interface.
my guess is the implementation lives here but something else i found suggested it would be moved to the IO repo... but I haven't found it there (or don't know where to look) contrib/ffmpeg/
Augustina Ragwitz @missaugustina 13:06
Context: here is the parent api doc for the namespace tf.audio - https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/audio/
when i started looking for encode_audio & decode_audio this is what i found - https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/ffmpeg

touched base with the sig-io folks -
Augustina Ragwitz @missaugustina 12:54
I'm working on updating the tf.audio docs & I was wondering if anyone here had a moment to talk to me about TF's audio encoding implementation? I'm seeing fragments littered throughout the code base & I'm not quite sure how it ties into the api interface.
my guess is the implementation lives here but something else i found suggested it would be moved to the IO repo... but I haven't found it there (or don't know where to look) contrib/ffmpeg/
Augustina Ragwitz @missaugustina 13:06
GH issue - tensorflow/tensorflow#28236
Augustina Ragwitz @missaugustina 13:16
i also feel like this is missing something, encode/decode_wav are the only functions listed but it should support other formats based on the implementation i'm looking at
Yong Tang @yongtang 14:56
@missaugustina Thanks for the interests!
The tf.contrib.ffmpeg is being moved to tensorflow-io, with tensorflow_io.video supporting video file formats. The audio functionalities of tf.contrib.ffmpeg has not been moved yet (I was planning to do so but haven't had time yet).
The WAV dataset (implemented as tf.data.Dataset) is being added in the PR: tensorflow/io#134
One thing to note is that there are some subtle differences between tensorflow_io.video and tf.contrib.ffmpeg. tf.contrib.ffmpeg will spawn an outside process and use the command line ffmpeg to capture the stdout/stderr. The tensorflow_io.video link with ffmpeg (dynamically) and calls ffmpeg's API directly. Also, tensorflow_io.video renders tf.data.Dataset so you could use the dataset directly with tf.keras. For tf.contrib.ffmpeg you could not use it with tf.keras directly.
Let me know if you have any questions, or encounter any issues. (I am out of the office today/tomorrow so reply might be a little slow).

Yong Tang @yongtang 15:09
@missaugustina There is an email thread about tensorflow_io.video and how to use it with tf.keras for easy feature extraction and classification:
https://groups.google.com/a/tensorflow.org/forum/#!topic/io/ctHeERQj5nw
Think it might help in using Dataset with tf.keras.
The AudioDataset in tensorflow-io (Have been trying to find some time to implement it, but haven't had time yet -- will try to speed up) will likely follow the similar format as video, and will be easily integrated with tf.keras.
Augustina Ragwitz @missaugustina 15:10
OK great thanks @yongtang ! Let me know if I can help with it in anyway, even if it's just small busywork stuff like test coverage

The  Module: tf.audio gives the detail about the functions available under that module, for usage example you can check the link specified for each functions here. Thanks!


Just small changes

Just small changes to make it work for me (Some things didn't work for me on Windows 11 Professional and Visual Studo 2022).
(Pull or wait and i'll add the other stuff to this request later)

This was the result of a missing Set-ExecutionPolicy Unrestricted xd


Add language tag to code blocks and correct indented code block

Add language tag (like xml, json) to Markdown code blocks, so the code syntax will be properly highlighted in the document
Fix indent of a code block nested inside a numbered list
Fix other Markdown lint warnings. Like removing end-of-line trailing spaces and ensuring a blank line before and after a heading.

Thank you for detailed suggestions. I have updated them accordingly.

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 66.85%. Comparing base (acc6ab3) to head (ba9dc58).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #770      +/-   ##
==========================================
- Coverage   70.13%   66.85%   -3.28%
==========================================
  Files         277      277
  Lines        8651     8651
  Branches     1006     1006
==========================================
- Hits         6067     5784     -283
- Misses       2065     2356     +291
+ Partials      519      511       -8

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.