[SOLVED] GraphQL - Error trying to resolve iv


#1

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:


#2

I guess your fields are not localizable?


#3

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


#4

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


#5

Do you have more fields?


#6

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
		}
	  }
	}
  }
}

#7

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


#8

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


#9

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


#10

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


#11

Wow that was fast, thanks Sebastian :slight_smile:


#12

Have you seen something in the logs?


#13

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


#14

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


#15

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

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


#16

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


#17

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.


#18

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


#19

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


#20

It should also be faster I hope.