Help! Is there something wrong with this schema co...
# community-help
m
Help! Is there something wrong with this schema config:
Copy code
{
  "name": "content-schemas",
  "fields": [
    {
      "name": "typesenseSchema",
      "type": "string",
      "facet": false,
      "index": true,
      "optional": false
    },
    {
      "name": "schema",
      "type": "string",
      "facet": false,
      "index": true,
      "optional": false
    }
  ]
}
I'm getting an 404 (
Request failed with HTTP code 404
) error but I can't seem to figure out whats wrong here. Thanks in advance!
j
@Matthias i tested this locally and it created the schema ok...running typesense v0.21.0 on ubuntu 20.04
how are you calling the creation of this collection?
m
Like this:
Copy code
let schema: CollectionCreateSchema = {
    name: collectionName,
    fields: [
      {
        name: 'typesenseSchema',
        type: 'string',
        facet: false,
        index: true,
        optional: false,
      },
      {
        name: 'schema',
        type: 'string',
        facet: false,
        index: true,
        optional: false,
      },
    ],
  };

  try {
    await typesense.collections().create(schema);
    console.log('SETUP: Collection ' + collectionName + ' was created.');
  } catch (error) {
    console.log('SETUP: Error while creating schema collection. Error:', error);
  }
typesense
is a Typesense.Client({...})
j
yeah, i'm using python, that's the only difference between your code and mine
are you able to make calls to typsense via curl?
Copy code
curl "<http://localhost:8108/health>"
m
Yes. The code even works locally. But when hosted this error occurs.
I just can't seem to figure out whats wrong, because this error means that the client reaches the server correctly, right?
j
yep, getting a 404 means it's hitting an endpoint is this using typesense's cloud or your own hosted version somewhere else?
m
j
are you able to make any calls to this hosted typesense via curl? i'm thinking it's a config issue
m
Yes, everything works fine using curl. It's really weird.
j
you can create the collection via curl too?
curl to typesense on render
m
yes, I just tried that. Everything seems to work. I can even list it.
Yes correct, the hosted version on Render.com
j
🤔
where does your javascript run that creates the collection?
m
But yes, it's probably something really simple that I messed up that has nothing to do with typesense...
It's part of a build script for another service that indexes existing DB entries
I'm currently trying the good old "delete the service and create an new one"-trick
👍 1
Okay, I fixed it using the external url instead of render.com's internal routing. Seems to be a Render issue. Thanks for helping anyways!
j
very good 😺