question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unknown error occur after query

See original GitHub issue

image

by using this schema

model User {
  id              String   @default(cuid()) @id
  email           String   @unique
  password        String
  name            String?
  firstName       String?
  lastName        String?
  createDate      DateTime @default(now())
  profileImageUrl String?
  eventFollow     Event[]
}

model Event {
  eventId              String         @default(cuid()) @id
  eventNameTH          String?
  eventNameEN          String?
  eventNameTHLowerCase String?
  eventNameENLowerCase String?
  slug                 String?
  createDate           DateTime       @default(now())
  eventDate            DateTime?
  eventDateStart       DateTime?
  eventDateEnd         DateTime?
  bookableDateStart    DateTime?
  bookableDateEnd      DateTime?
  priceStart           Int?
  priceEnd             Int?
  organizer            String?
  latitude             Float?
  longtitude           Float?
  location             String?
  keyword              String?
  locationTextShowTH   String?
  locationTextShowEn   String?
  provinceTH           String?
  provinceEN           String?
  provinceLowerCase    String?
  eventAdminCreator    Admin?         @relation(references: [adminId], name: "eventAdminCreator")
  raceType             String?
  linkUrl              String?
  coverPhotoUrl        String?
  coverPhotoUrl_resize String?
  thumbnailPhotoUrl    String?
  youtubeUrl           String?
  eventGroup           EventGroup?    @relation(references: [eventGroupId])
  descriptionTH        String?
  descriptionEN        String?
  comment              Comment[]
  lastUpdateTime       DateTime?      @updatedAt
  lastUpdateAdmin      Admin?         @relation(references: [adminId], name: "lastUpdateAdmin")
  followBy             User[]
  eventScore           Float?
  distance             DistanceType[]
  isOfficialPartner    Boolean?
}



model EventGroup {
  eventGroupId              String   @default(cuid()) @id
  eventGroupName            String
  createTime                DateTime @default(now())
  slug                      String?
  event                     Event[]
  eventGroupImageUrl        String
  eventGroupImageUrl_resize String
  eventGroupAdminCreator    Admin    @relation(references: [adminId], name: "eventGroupAdminCreator")
  lastUpdateTime            DateTime @updatedAt
  lastUpdateAdmin           Admin    @relation(references: [adminId], name: "eventGroupAdminLastUpdate")
}

model Comment {
  commentId    String         @default(cuid()) @id
  comment      String
  createTime   DateTime       @default(now())
  user         User           @relation(references: [id])
  event        Event          @relation(references: [eventId])
  approve      Boolean
  photo        CommentPhoto[]
  commentScore Float
  approveBy    Admin          @relation(references: [adminId])
  approveTime  DateTime
}

model CommentPhoto {
  commentPhotoId String  @default(cuid()) @id
  imageUrl       String
  comment        Comment @relation(references: [commentId])
}


model DistanceType {
  distanceTypeId String @default(cuid()) @id
  distance       Float
  event          Event  @relation(references: [eventId])
}

model Admin {
  adminId              String       @default(cuid()) @id
  email                String?
  password             String?
  firstName            String?
  lastName             String?
  createDate           DateTime     @default(now())
  event                Event[]      @relation(references: [eventId], name: "eventAdminCreator")
  eventLastUpdate      Event[]      @relation(references: [eventId], name: "lastUpdateAdmin")
  eventGroup           EventGroup[] @relation(references: [eventGroupId], name: "eventGroupAdminCreator")
  eventGroupLastUpdate EventGroup[] @relation(references: [eventGroupId], name: "eventGroupAdminLastUpdate")
  comment              Comment[]
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
justicejoecommented, Dec 29, 2019

@pantharshit00 this query

query searchEvent($searchString : String, $startDate : DateTime, $endDate : DateTime
  ,$province : String, $raceType: String, $fromDistance: Float, $toDistance : Float)
{
  events(where: {
    AND: [
      {OR: [{
        eventNameTHLowerCase: {
      contains: $searchString
    }},
      {
        eventNameENLowerCase: {
          contains: $searchString
        }
      }]
      },
      {
      location: {
        contains: $province
      }
      }
        ,
        {
          raceType: {
          equals : $raceType
        }      
        },
    {
      eventDateStart: { 
        gte : $startDate
      }
    },
      {
        eventDateStart : {
          lte : $endDate
        }
      }
      ,{
        distance: {
          some: {
            AND: [
              {distance: {
                gte: $fromDistance
              }},
              {
                distance: {
                  lte : $toDistance
                }
              }
            ]
          }
        }
      }
    ]
  }){
    eventNameTH
    eventNameEN
    createDate
    eventDateStart
    eventDateEnd
    coverPhotoUrl
    distance{
      distance
    }
    location
    raceType
  }
}

but it happen sometime, not all the time. after new npm start, this error seem to disappear for a moment then occur again

0reactions
pantharshit00commented, Jan 3, 2021

I am going to close this as its been 3 months now and there is no activity here.

Please reply if you want us to take another look.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error running query: unknown error occurred. Please try again ...
When we run the query from chrome/safari concurrently or 2 people try to run it same time we get the below error for...
Read more >
I get Exception unknown error, after querying DataBase for the ...
1 Answer 1 ... I think you have a typo error in here: $result = $sql1->query("SELECT * FROM ads WHERE id=".$id);. the 1...
Read more >
Getting "An unknown error occurred." on clicking launch query ...
This issue is caused by Dll version mismatch between Microsoft.SharePoint.Publishing.dll and Microsoft.Office.Server.Search.dll. To solve this ...
Read more >
Long Term Data Query - Unknown Error Occured - Help
The issue is that this error suggests that there is more data being returned from the database for the given interval than PHP...
Read more >
SOQL - Number in Where Clause throwing "Unknown error ...
1 Answer 1 · Unknown error parsing query (exeucting the query) · ERROR at Row1:Column:[number] For input string (Query Plan) · Bind variables...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found