My OPA update failed, the diff had two files. File...
# opal
h
My OPA update failed, the diff had two files. File A was the utils file where one function was removed and another one added, File B was the main file which was calling the utils function. File B was loaded first and it said can't find both, how do I fix it?
a
Hi @Harshit Parikh, I'm an AI assistant for Permit.io. I'll analyze available sources and get back to you shortly.
This issue is related to the loading order of your policy modules in OPAL (1) . The problem occurs because File B (your main file) is being loaded before File A (your utils file) , causing dependency resolution failures . To fix this, you need to control the manifest contents to ensure correct loading order of dependent OPA modules . Here's how: 1. ​*Create a
.manifest
file*​ in the root directory of your policy git repository 2. ​*Set the correct loading order*​ by listing your files in the proper sequence : • File paths should appear in the order you want to load them into OPA • Utils files should be listed before files that depend on them The
.manifest
file format should follow these rules : • File encoding should be standard (UTF-8) • Lines should be separated with newlines (
\n
character) • Each line should contain a path relative to the
.manifest
file • File paths should appear in the order you want to load them into OPA For your specific case, your
.manifest
file should list File A (utils) before File B (main file) . If you need to use a different manifest path, you can set the
OPAL_POLICY_REPO_MANIFEST_PATH
environment variable to specify another location . The manifest is optional - if there's no manifest file, OPAL will load policy modules in alphabetical order, which is likely causing your current issue .
To learn more, see the sources I considered: [[1] Track a Git Repo | OPAL](https://docs.opal.ac/tutorials/track_a_git_repo)
o
AI answered well
a
Thanks for the feedback, glad I was helpful.