Thank you for visiting the Rackspace Community
The Community is live! Post new content or topics so our teams can assist.

Please contact your support team if you have a question or need assistance for any Rackspace products, services, or articles.

.Net integration (openstack.net) The service rate limit has been reached

This question is not answered.

Hi all,

We received an error 'The service rate limit has been reached. Either request a service limit increase or wait until the limit resets.' from openstack.net dll used in our project to integrate with Cloud Files.

Can you please advice hot to handle it correctly or where the limits can be seen (i found information about 100 request per second, is it valid)?

Thanks,

Andrey

All Replies
  • Hey Andrey -

    Could you include a bit more information for us? Do you know which request is returning this error? Can you provide a code sample (with any identifiable info, i.e. passwords, api keys, etc - removed)?

    The Cloud Files API has some absolute limits (as noted here), along with some account-specific limits. If we know which limit is being reached, we can potentially find a way around that limit.

    Thanks

    Alan Bush
    Technical Community Manager
    Rackspace Cloud

  • Hi Alan,

    I will try to provide as much information as i can) Below is a sample code we use for storing files in Rackspace Cloud Files storage:

    public void StoreDocument(byte[] document, Guid documentId)
    {

    var rackspaceCloudFilesProvider = GetRackspaceProviderWithCheck();
    using (var stream = new MemoryStream(document))
    {
    rackspaceCloudFilesProvider.CreateObject(ContainerName, stream, documentId.ToString());
    }
    }

    private CloudFilesProvider GetRackspaceProviderWithCheck()
    {
    var tempRackspaceFix = new ProtocolViolationHandlingJsonRestServices();
    var rackspaceCloudFilesProvider = new CloudFilesProvider(CloudIdentity, tempRackspaceFix);
    CheckContainer(rackspaceCloudFilesProvider);
    return rackspaceCloudFilesProvider;
    }

    private CloudIdentity CloudIdentity

    {
    get
    {
    if (_cloudIdentity == null)
    _cloudIdentity = GetCloudIndentity();
    return _cloudIdentity;
    }
    }

    We do not log the exact requests as integration is used via openstack.net dll. It was the first time we received this error and it was during urgent maintaince from Rackspace side (5/14/2015 10:19:08 PM - 5/14/2015 10:19:08 PM PST time). May be it was the main reason. I will be very thanksfull you can verify that.

    In fact, i just woudl like to clarify what is the best way to check how long we are from the limits and how to handle such error situations. The main idea for me know - is just to retry file uploading in a minute, but it seemed not be correct.

  • We use openstack version 1.3.2.1, may be it would be helpfull. Below is a part of stackrace for the issue:

    "

    Target site: Void Validate(JSIStudios.SimpleRESTServices.Client.Response)

    net.openstack.Core.Exceptions.Response.ServiceLimitReachedException: The service rate limit has been reached. Either request a service limit increase or wait until the limit resets.

    at net.openstack.Providers.Rackspace.Validators.HttpResponseCodeValidator.Validate(Response response)

    at net.openstack.Providers.Rackspace.ProviderBase`1.ExecuteRESTRequest[T](CloudIdentity identity, Uri absoluteUri, HttpMethod method, Object body, Dictionary`2 queryStringParameter, Dictionary`2 headers, Boolean isRetry, Boolean isTokenRequest, RequestSettings requestSettings, Func`7 callback)

    at net.openstack.Providers.Rackspace.CloudIdentityProvider.<>c__DisplayClass43.<GetUserAccess>b__42()

    at net.openstack.Core.Caching.UserAccessCache.<>c__DisplayClassc.<Get>b__5(String k, UserAccess existing)

    at System.Collections.Concurrent.ConcurrentDictionary`2.AddOrUpdate(TKey key, Func`2 addValueFactory, Func`3 updateValueFactory)

    at net.openstack.Core.Caching.UserAccessCache.Get(String key, Func`1 refreshCallback, Boolean forceCacheRefresh)

    at net.openstack.Providers.Rackspace.CloudIdentityProvider.GetUserAccess(CloudIdentity identity, Boolean forceCacheRefresh)

    at net.openstack.Providers.Rackspace.ProviderBase`1.GetServiceEndpoint(CloudIdentity identity, String serviceType, String serviceName, String region)

    at net.openstack.Providers.Rackspace.CloudFilesProvider.ListContainers(Nullable`1 limit, String marker, String markerEnd, String region, Boolean useInternalUrl, CloudIdentity identity)

    "

    We get some errors yesterday and today with message 'An existing connection was forcibly closed by the remote host', can you please advise where to look first?

    Below is a part of stacktrace

    "

    Target site: Int32 Read(Byte[], Int32, Int32)

    System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

    at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)

    --- End of inner exception stack trace ---

    at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)

    at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)

    at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)

    at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)

    at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)

    at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)

    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

    at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)

    at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)

    at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)

    at System.Net.ConnectStream.WriteHeaders(Boolean async)

    --- End of inner exception stack trace ---

    at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)

    at System.Net.HttpWebRequest.GetRequestStream()

    at JSIStudios.SimpleRESTServices.Client.RestServiceBase.<>c__DisplayClass1.<Execute>b__0(HttpWebRequest req)

    at JSIStudios.SimpleRESTServices.Client.RestServiceBase.<>c__DisplayClass7.<ExecuteRequest>b__6()

    at JSIStudios.SimpleRESTServices.Client.RequestRetryLogic.Execute(Func`1 callback, IEnumerable`1 non200SuccessCodes, Int32 retryCount, Nullable`1 retryDelay)

    at JSIStudios.SimpleRESTServices.Client.RestServiceBase.ExecuteRequest(Uri url, HttpMethod method, Func`3 responseBuilderCallback, Dictionary`2 headers, Dictionary`2 queryStringParameters, RequestSettings settings, Func`2 executeCallback)

    at JSIStudios.SimpleRESTServices.Client.RestServiceBase.Execute[T](Uri url, HttpMethod method, String body, Dictionary`2 headers, Dictionary`2 queryStringParameters, RequestSettings settings)

    at net.openstack.Providers.Rackspace.ProviderBase`1.ExecuteRESTRequest[T](CloudIdentity identity, Uri absoluteUri, HttpMethod method, Object body, Dictionary`2 queryStringParameter, Dictionary`2 headers, Boolean isRetry, Boolean isTokenRequest, RequestSettings requestSettings, Func`7 callback)

    at net.openstack.Providers.Rackspace.CloudIdentityProvider.<>c__DisplayClass43.<GetUserAccess>b__42()

    at net.openstack.Core.Caching.UserAccessCache.<>c__DisplayClassc.<Get>b__4(String k)

    at System.Collections.Concurrent.ConcurrentDictionary`2.AddOrUpdate(TKey key, Func`2 addValueFactory, Func`3 updateValueFactory)

    at net.openstack.Core.Caching.UserAccessCache.Get(String key, Func`1 refreshCallback, Boolean forceCacheRefresh)

    at net.openstack.Providers.Rackspace.CloudIdentityProvider.GetUserAccess(CloudIdentity identity, Boolean forceCacheRefresh)

    at net.openstack.Providers.Rackspace.ProviderBase`1.GetServiceEndpoint(CloudIdentity identity, String serviceType, String serviceName, String region)

    at net.openstack.Providers.Rackspace.CloudFilesProvider.ListContainers(Nullable`1 limit, String marker, String markerEnd, String region, Boolean useInternalUrl, CloudIdentity identity)

    "