[SOLVED] GraphQL - Error trying to resolve iv

I have…

  • [ ] Checked the logs and have provided uploaded a log file and provided a link because I found something suspicious there.

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [X] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

Intermittently getting errors when querying contents

Here is an example query:

queryCategoryContents {
  data {
    name { iv }
    slug { iv }
    image { iv { url } }
  }
}

When the bug happens I get these errors in the response

errors: [
  {
    locations: [
      {
       column: 15        
       line: 10        
      }
    ]
   message: "Error trying to resolve iv."      
  }
  {
     locations: [
       {
         column: 14        
         line: 13        
       }
     ]
   message: "Error trying to resolve iv."      
  }
]

Environment

  • [X] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: dev

Browser: N/A

Others:

I guess your fields are not localizable?

Hi Sebastian, no they’re not. It also doesn’t happen 100% of the time on the same query

Mhm, very strange. Cannot reproduce it in the cloud version yet.

Do you have more fields?

Yes, it’s actually on this query where it happens more often:

{
  queryPodcastContents {
	data {
	  slug {
		iv
	  }
	  playlistId {
		iv
	  }
	  name {
		iv
	  }
	  heroImage {
		iv {
		  url
		}
	  }
	  heroImageMobile {
		iv {
		  url
		}
	  }
	  promoImage {
		iv {
		  url
		}
	  }
	  seoImage {
		iv {
		  url
		}
	  }
	  sharingImage {
		iv {
		  url
		}
	  }
	  creators {
		iv {
		  data {
			name {
			  iv
			}
			slug {
			  iv
			}
			description {
			  iv
			}
			image {
			  iv {
				url
			  }
			}
		  }
		}
	  }
	  categories {
		iv {
		  data {
			name {
			  iv
			}
			slug {
			  iv
			}
			heroImage {
			  iv {
				url
			  }
			}
			colour {
			  iv
			}
		  }
		}
	  }
	  previewImage {
		iv {
		  url
		}
	  }
	}
  }
}

Can you narrow it down? e.g. if it happens on a specific field or field like (like assets or reference)?

I am adding and testing a resolver middleware to log the problems.

Thanks Sebastian, it’s really hard to reproduce.

Some info I could add:

There’s 62 podcast items in the CMS at the moment (2 of them not published)

I have another query which is the same as the above (except this other query has a filter), and the problem does not happen there

The build is running: https://build.squidex.io/Squidex/squidex/2459/1/2

Wow that was fast, thanks Sebastian :slight_smile:

Have you seen something in the logs?

Hi Sebastian,

Thanks for that build. I’m not sure if related but I’ve noticed these this morning:

{
  "logLevel": "Warning",
   "action": "reolveField",
   "status": "failed",
   "field": "iv",
   "exception": {
      "type": "MongoDB.Driver.MongoWaitQueueFullException",
      "message": "The wait queue for acquiring a connection to server [**IP_ADDRESS**]:27017 is full.",
      "stackTrace": " at MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool.AcquireConnectionHelper.CheckingOutConnection()\n at MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool.AcquireConnectionAsync(CancellationToken cancellationToken)\n at MongoDB.Driver.Core.Servers.Server.GetChannelAsync(CancellationToken cancellationToken)\n at MongoDB.Driver.Core.Operations.CountDocumentsOperation.ExecuteAsync(IReadBinding binding, CancellationToken cancellationToken)\n at MongoDB.Driver.OperationExecutor.ExecuteReadOperationAsync[TResult](IReadBinding binding, IReadOperation`1 operation, CancellationToken cancellationToken)\n at MongoDB.Driver.MongoCollectionImpl`1.ExecuteReadOperationAsync[TResult](IClientSessionHandle session, IReadOperation`1 operation, ReadPreference readPreference, CancellationToken cancellationToken)\n at MongoDB.Driver.MongoCollectionImpl`1.UsingImplicitSessionAsync[TResult](Func`2 funcAsync, CancellationToken cancellationToken)\n at Squidex.Domain.Apps.Entities.MongoDb.Assets.MongoAssetRepository.QueryAsync(Guid appId, HashSet`1 ids) in /src/src/Squidex.Domain.Apps.Entities.MongoDb/Assets/MongoAssetRepository.cs:line 125\n at Squidex.Domain.Apps.Entities.Assets.AssetQueryService.QueryAsync(QueryContext context, Q query) in /src/src/Squidex.Domain.Apps.Entities/Assets/AssetQueryService.cs:line 85\n at Squidex.Domain.Apps.Entities.Contents.QueryExecutionContext.GetReferencedAssetsAsync(ICollection`1 ids) in /src/src/Squidex.Domain.Apps.Entities/Contents/QueryExecutionContext.cs:line 103\n at GraphQL.Instrumentation.MiddlewareResolver.Resolve(ResolveFieldContext context)\n at Squidex.Domain.Apps.Entities.Contents.GraphQL.LoggingMiddleware.<>c__DisplayClass0_1.<<Create>b__1>d.MoveNext() in /src/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/LoggingMiddleware.cs:line 27"
    }
}

Maybe it is related to assets? We do save them in MongoDb as well, on the same instance

This is from the new code. You have to increase the connection pool size.

GraphQL Dotnet supports DataLoader now. Might be an option for further optimizations.

https://graphql-dotnet.github.io/docs/guides/dataloader/

I have pushed a change with the dataloader. Should be faster.

I also pushed a change with MongoDB optimizations. In some cases I made 2 queries, even though only one was necessary. I have fixed that.

Thanks! I’ll try the new release and let you know how it goes

I haven’t seen the error since using v.2.1.0. No changes in max pool size or connection timeout

1 Like

It should also be faster I hope.