Hello Folks! I’d appreciate it if someone can help...
# troubleshooting
g
Hello Folks! I’d appreciate it if someone can help, I’m stuck for the past few days... I’m totally new at Meltano, I’m trying to set it up to run via Docker on AWS Fargate. I was able to build/deploy and run the containers and make Meltano UI publicly available. My problem is that I can not persist configuration/metadata set from the UI (adding and configuring extrators/plugins, creating dashboards...), whenever the container is restarted, the data is lost. I’ve launched PostgreSQL on AWS RDS, I did set the database_uri for Meltano (tried all the ways, env_varialbe, .env file, meltano.yaml) i have doublechecked and I’m able to connect to the database, even Meltano is able since I’m seeing the Meltano tables in schema (plugin_settings,job,user...) but they’re empty and never get any records in them. Any ideas?
t
@douwe_maan will definitely have a better answer on this, but it’s possible it’s running in read only mode since you’re using the UI. What you’re describing though is one of the ux challenges I think we currently have with Meltano. The current story of deployment is that you have your git repo that defines your project which you can then use to build and deploy Meltano, but getting changes back from the app in production and how that works with the git repo isn’t totally settled. It’s something we’re thinking about how to make better though https://gitlab.com/meltano/meltano/-/issues/2685
d
@guro_khundadze Can you share your
Dockerfile
? If Meltano is running in read-only mode, changes made in the UI should be saved in the system database and should persist between container restarts, but if it's not in read-only mode, changes to plugins and settings are stored in
meltano.yml
inside of the container, and lost when it restarts.
Taylor linked to the
ui.readonly
setting, but what you're actually looking for is `project_readonly`: https://meltano.com/docs/settings.html#project-readonly
g
@douwe_maan Thanks for the response, i’ve already tried setting project_readonly:true from meltano.yml file, when i launch the UI on the top right corner i see a notice that it’s running in readonly mode, but i still can edit any configuration (which is not getting persisted in the end) I’ve also tried setting project_readonly from the Dockerfile e.g:
Copy code
ENV MELTANO_PROJECT_READONLY 1
d
@guro_khundadze Typically, you would build the project and add all the plugins and their non-sensitive configuration locally and in a Git repo, then containerize the whole project to bake the plugins into the Docker image (https://meltano.com/docs/containerization.html), and then deploy it in production in project-read-only mode so that sensitive settings can still be set in the UI, but not other changes that should go through the Git repo and code review. Is that the setup you're looking for? An alternative would be to not use a project-specific Docker image, but to use
meltano/meltano
directly and mount a project directory on persistent storage into it, so that you can use the UI to make all the changes you like, with these changes persisted outside the container
i launch the UI on the top right corner i see a notice that it’s running in readonly mode
OK, good.
but i still can edit any configuration (which is not getting persisted in the end)
It should be saving the settings in the system database, but you're saying
plugin_settings
is empty? That's odd
g
Here is my dockerfile
Copy code
ARG MELTANO_IMAGE=meltano/meltano:latest
FROM $MELTANO_IMAGE

# TMP add github keys
RUN mkdir /root/.ssh
RUN ssh-keyscan -t rsa <http://github.com|github.com> >> /root/.ssh/known_hosts
ADD ./tap-key /root/.ssh/id_rsa
RUN chmod 600 /root/.ssh/id_rsa

WORKDIR /project

# Install any additional requirements
COPY ./requirements.txt . 
RUN pip install -r requirements.txt

RUN echo hello

# Install all plugins into the `.meltano` directory
COPY ./meltano.yml . 
RUN meltano install

# Pin `discovery.yml` manifest by copying cached version to project root
RUN cp -n .meltano/cache/discovery.yml . 2>/dev/null || :

# Don't allow changes to containerized project files
ENV MELTANO_PROJECT_READONLY 1
ENV MELTANO_DATABASE_URI <postgresql://postgres:password@aws-path.eu-west-1.rds.amazonaws.com:5432/postgres>

# Copy over remaining project files
COPY . .

# Expose default port used by `meltano ui`
EXPOSE 5000

ENTRYPOINT ["meltano"]
d
@guro_khundadze OK, that looks good
If you make a change to plugin configuration in the UI, it sticks between page reloads, right? But not container restarts?
g
Is there any debugging flag that i can pass to Meltano UI to get more details? i’ve tried `--log-level=debug`which does not output anything related to storing preferences.
Right
d
In your browser, can you open the web inspector's Network tab, then open the configuration pane for a plugin that you've previously set a setting for using the UI, and then share the response for the request to
GET /orchestrations/<plugin>/configuration
?
I'd like to see what that has as the storage location for the setting you set using the UI
It should be
db
g
One second, thanks!
d
i’ve tried `--log-level=debug`which does not output anything related to storing preferences.
No there's not currently a way to get more logging around configuration
g
also if i set
ENV MELTANO_PROJECT_READONLY 1
in the Dockerfile, then UI does not give me an ability to modify anything, (besides the top right warning) i can’t create a dashboard for example or add new plugin. But if is set it from the meltano.yml or regular env var, then i can modify settings/create dashboards (but the top right warning is still there)
(give me 1 min, i’ll build/launch local ui)
d
if i set 
ENV MELTANO_PROJECT_READONLY 1
in the Dockerfile, then UI does not give me an ability to modify anything, (besides the top right warning) i can’t create a dashboard for example or add new plugin.
That's expected, enabling that setting (https://meltano.com/docs/settings.html#project-readonly) disallows any changes to the project directory (where new plugins and dashboards are stored), since the project directory is baked into the Docker image and changes wouldn't survive restarts.
But if is set it from the meltano.yml or regular env var, then i can modify settings/create dashboards (but the top right warning is still there)
Hmm, how that setting is set shouldn't make a difference to how the UI reacts. Is the top-right warning identical?
g
I don’t see storage location, where should it be
d
That's the PUT request, look for the GET request when you first open the configuration panel
g
message has been deleted
d
That's it. Can you share the response?
g
it’s db
Ok wait, i think it was not like that 🙂
d
OK, so
source: default
means it's currently getting the value from the default for that setting, and
auto_store: db
means that if you were to edit the setting, the new value would be stored in the system database. As we'd expect in project-read-only mode. So that part seems to work
If you change one of those settings,
source
should become
db
as well
And then we should be able to look at your system database and find a row in
plugin_settings
g
I see the records in plugin_settings now, it’s for the first time 🙂
d
😄
g
maybe i have tried project readonly mode incorrectly
d
Meltano sensed my presence and decided to play nice
Maybe... But since you were using the default
Dockerfile
, it should've been in there from the start...
Not sure what could've changed
g
No i was not, i had my own Dockerfile much smaller, before today, today i’ve started using the one from your examples. Thank you so much! i think at this stage my problem is solved
d
Awesome, if you run into any more issues you know where to find us 🙂
g
Thanks again! 🙂