Git Product home page Git Product logo

Comments (3)

SamTolmay avatar SamTolmay commented on May 25, 2024

Hi @IvanDrag0

Thanks for the very detailed issue.

I think the filename property should be the absolute file path, so it would be something like:

/Users/user/projects/lowdefy/tutorial/tutorial_db.sqlite

If that works then the String expected is probably because the secret is not being read correctly- the environment variable should be LOWDEFY_SECRET_SQLITE_FILENAME, the LOWDEFY_SECRET_ gets removed from the secret name.

from lowdefy.

IvanDrag0 avatar IvanDrag0 commented on May 25, 2024

Hi @SamTolmay,

I just erased the project, copied the one from the example repo, and used the full and relative paths. The full path did work (not sure why it didn't work yesterday), but the relative path still failed. After a bit of testing and digging around, I might have found the reason that the relative paths don't work (at least on Windows).

If I specify a relative path for the sqlite file (the same way I did in my original issue), I get the error that the table doesn't exist. However, that's an incorrect error since if the app can't find the file, it should just say that the file is not found. I believe the reason that it gives an error regarding the table is because it creates a blank (0 Kb) sqlite file in the root of the application itself (not where the yaml configs are).

image

image

Which explains the error since it can actually find the file (since the app seem to create it), but the file is blank. When I stopped the program and replaced the 0 Kb file with the database file I used, everything worked as expected.

image

image

This means that (at least on Windows), for this to work with relative paths (I suspect that this issue would affect other areas), you'll need to either change the working directory to where the yaml files. Or allow the user to define where the node/lowdefy files are and where the app yaml files (which would probably be a more versatile option).

from lowdefy.

SamTolmay avatar SamTolmay commented on May 25, 2024

I had forgotten, but this is why we recommended using absolute paths for the filename. The server, and therefore also the SQLite driver are running from the server directory, and therefore it interprets paths relative to that directory, not the config directory (where the lowdefy.yaml file is placed).

We download the server code to the ./.lowdefy/dev and ./.lowdefy/server directories to avoid clashes with other files. You can configure these directories by using the --config-directory, --dev-directory and --server-directory CLI arguments, or the LOWDEFY_DIRECTORY_CONFIG, LOWDEFY_DIRECTORY_DEV and LOWDEFY_DIRECTORY_SERVER environment variables (https://docs.lowdefy.com/cli).

Because of the way these directories are structured, you should be able to get things to work if you specify the file path relative to the server directory - i.e. if you do ../../tutorial_db.sqlite instead of ./tutorial_db.sqlite. This is a little confusing for new users, which is why we recommended the absolute path, but maybe it makes sense to have a deeper understanding of whats happening under the hood.

from lowdefy.

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.