Giter VIP home page Giter VIP logo

Comments (6)

jannyHou avatar jannyHou commented on September 25, 2024

@biancajiang I am trying to reproduce your issue, Can you fork https://github.com/strongloop/loopback-sandbox and replace with your code? Include some details like which loopback api you called, or is it a native query directly talk to cloudant datasource. Thanks.

from loopback-connector-cloudant.

biancajiang avatar biancajiang commented on September 25, 2024

@jannyHou I'm not sure how to recreate it in a test env. w/o sharing the exact DB yet (proprietary data). The server and DB have been in use and working for months. Please let me know if you have any idea how to approach this.

Our models include objects like "Scan", "Package" and "LicenseFile". Scan has many Packages and many LicenseFiles. Package has many LicenseFiles.

Right now APIs involve packages are returning the 400 Error above like: /api/packages/bd3728cc668db9d363f0b0d98c448c96

Other model APIs w/o packages seem fine, like:
/api/scans/19569d5fa0f68f458772a5f2f1961b91

I can directly access package document with id from cloudant DB. But any query uses index would give this error.

An example of a Package document:

{
  "_id": "bd3728cc668db9d363f0b0d98c448c96",
  "_rev": "1-91ac6ab5ddb4b618f9ed0e7c15f8eac8",
  "name": "oclazyload",
  "version": "1.0.9",
  "path": "bower_components/oclazyload",
  "scanId": "148702417a38a0fb8aa6c0c9b48d17cc",
  "license_types": [
    "MIT"
  ],
  "parentId": "1c77c1bfa27a4e0b44a24728fc40fa01",
  "loopback__model__name": "package"
}

An example of a Scan document in the DB:

{
  "_id": "19569d5fa0f68f458772a5f2f1961b91",
  "_rev": "2-f8a73ba8102c5e03ee279aa3440b7449",
  "date": "2016-11-21T16:09:16.037Z",
  "project": "lucene-5.5.0",
  "by": "[email protected]",
  "scan-dir": "/Users/bj/playground/test_data/lucene-5.5.0",
  "scan_time_ms": "253342 ms",
  "directories_scanned": 1658,
  "files_scanned": 25175,
  "packages_found": 1,
  "output_file": "lucene-5.5.0_scanresults_2016-11-21T16-09-16-037Z.json",
  "cli_version": "0.5.19",
  "status": {
    "upload": "Scan Upload Completed successfully."
  },
  "loopback__model__name": "scan"
}

from loopback-connector-cloudant.

jannyHou avatar jannyHou commented on September 25, 2024

I created a simple model Test and try get instance from cloudant server, it returns me the result successfully.
the query it runs:

{"selector":{"loopback__model__name":"Test","_id":"00476caeacb2ab5c33a0fc35c2208e5c"},"use_index":["lb-index-ddoc-Test","lb-index-Test"],"limit":1,"sort":[{"id:string":"asc"}]} +0ms

I didn't see problem here with the query itself. It's exactly the same query you use for your package model.

While I do reproduce the error with replicate db you provide me.
I understand that this blocks you badly but I am afraid we could not fix it on our end, because it breaks on that db and loopback-connector-cloudant is only an interface talking to db. Maybe try contact cloudant team who can read and understand the query error.

Good luck!

from loopback-connector-cloudant.

jannyHou avatar jannyHou commented on September 25, 2024

I am closing this issue since cloudant team would be proper to explain the error message and provide a solution. Thanks for understanding.

from loopback-connector-cloudant.

biancajiang avatar biancajiang commented on September 25, 2024

This was an issue with Cloudant DB and was resolved. Thanks!

from loopback-connector-cloudant.

jannyHou avatar jannyHou commented on September 25, 2024

@biancajiang Glad to hear it's solved :) No problem.

from loopback-connector-cloudant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.