Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No matching files found in the database. Indexing is required. #170

Open
3geniosmx opened this issue May 3, 2023 · 6 comments
Open

No matching files found in the database. Indexing is required. #170

3geniosmx opened this issue May 3, 2023 · 6 comments
Labels
Usage Support Helping a user with usage

Comments

@3geniosmx
Copy link

3geniosmx commented May 3, 2023

Describe the issue
I run the script and this index all files but when tryin to run a task gime this error can you help me bro

No matching files found in the database. Indexing is required.
/Users/*****/autopilot/modules/summaries.js:79
throw new Error("Cannot run without summaries. Indexing is required.");
^

Error: Cannot run without summaries. Indexing is required.
at readAllSummaries (/Users//autopilot/modules/summaries.js:79:11)
at async getSummaries (/Users/
/autopilot/modules/summaries.js:100:21)
at async main (/Users/*****/autopilot/ui.js:60:21)

@3geniosmx 3geniosmx added the Usage Support Helping a user with usage label May 3, 2023
@JayBuckley7
Copy link

I'm also getting this

@codeautopilot
Copy link

codeautopilot bot commented May 3, 2023

🤖 This is my suggestion:

File: modules/summaries.js
The error you are encountering is caused by the script not finding any matching files in the database. This means that the database is either empty or the files you are trying to process are not indexed in the database.

To fix this issue, you need to make sure that the files you want to process are indexed in the database. You can do this by running the indexing script before running the task that is causing the error.

If you have already indexed the files and you are still encountering the error, you may need to check if the indexing script is working correctly and if the files are being indexed in the correct database.

In the readAllSummaries function, the error is thrown when the summaries variable is either undefined or has a length of 0. You can add a console log to check the value of the summaries variable before the error is thrown:

async function readAllSummaries(codeBaseDirectory) {
  // ... (previous code)

  if (typeof summaries === 'undefined' || summaries.length === 0) {
    console.log("No matching files found in the database. Indexing is required.");
    console.log("Summaries:", summaries); // Add this line to check the value of summaries
    throw new Error("Cannot run without summaries. Indexing is required.");
  }

  // ... (rest of the code)
}

This will help you identify if the problem is with the database or the files you are trying to process.

@hatkyinc2
Copy link
Collaborator

hatkyinc2 commented May 4, 2023

@3geniosmx @JayBuckley7 Did you guys get this on a fresh install?
There are multiple ways to fix it:

  • Delete the CODE_BASE/.autopilot directory in the code base or the db file inside it autopilot.db
  • Use --reindex on running node ui --reindex -task 'TASK'

@JayBuckley7
Copy link

Yes it was a fresh install, I'll give your suggestion a try thanks

@hatkyinc2
Copy link
Collaborator

@JayBuckley7 what OS and how did you put the codebase directory?
Is it Windows or *nix? Did you use a relative path or the full path?

# Path to your code, defaults to itself.
# Even if you are on windows this is POSIX style path.
# For example C:\Users\user\code\project
#    would be C:/Users/user/code/project
CODE_DIR=./

@Zoneflow
Copy link

I had the same issue, but I fixed it by using the right format for CODE_DIR. Make sure to use forward slashes, and make sure to use quotes ( ./ doesn't need quotes but I don't know the technical reason why).

Example: CODE_DIR="C:\src\Flutter Apps\app_folder"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Usage Support Helping a user with usage
Projects
None yet
Development

No branches or pull requests

4 participants