Unknown profile version

System Info

Joplin 1.6.6 (prod, darwin)

Client ID: 1524777f2bbf4c9784ae8e4dbb2c5468
Sync Version: 2
Profile Version: 34
Keychain Supported: Yes

Revision: f58b756 (master)

Error

atal error:

Error: Unknown profile version. Most likely this is an old version of Joplin, while the profile was created by a newer version. Please upgrade Joplin at https://joplinapp.org and try again.
Joplin version: 1.0.164
Profile version: 34
Expected version: 29

This error arises when running joplin --profile ~/.config/joplin-desktop.

I've done some digging on this particular issue, and there are a few posts which run into this issue. However, I do not have a good high level view for understanding what a profile even is to begin debugging this. As I can guess, a profile is like a different version of your joplin notebooks?

When I use just the joplin-desktop app, everything is fine. I have it syncing with Dropbox, and I can have Joplin on 2 different computers with them syncing in harmony.

An issue arises when I try to make a backup script. I run
joplin sync --target 7
joplin export --format jex "~/backup/joplin

and get my backup file, but it is some old version of my notebooks (maybe 6 months old? I don't know..). When I try to use joplin terminal app (without the --profile flag), I also get this old version of my notes.

I'm not really clear on what is happening here, and have tried reinstalling both joplin-desktop and joplin-cli, but this was unfortunately not a solution. I will also point out that I did not install this with Brew, but with the recommended installation instructions.

I'd like to be able to run my backup script and have it use the latest version of my notes, not some old version.

It seems you are trying to use the terminal cli version of Joplin 1.0.164 with a profile that was already upgraded to version 34.

This cannot work.

Upgrade the terminal app, and you will be able to do so.

However, make sure that you do not run the terminal and the desktop app at the same time whenthey are pointed to the same profile. This is a big no-no.

Thanks for your response Tessus.

However I'm still confused about a couple things.

  • First, how do you upgrade the terminal app? I would have thought that getting the package through the npm -g install joplin would have given me the latest. Through all the docs I've searched, I can't see
  • Is a profile tied to a specific version? can you give me the quick-n-dirty way to understand what a profile is? I think this would go a long way to helping people (mainly me) debug their own issues when problems around profiles arise.
  • Is it the case that to use the CLI app and the GUI, we need to have versions of each app that correspond to each other?
  • I can't even imagine how the CLI app would be the cause of this issue, given that I had been running my backup script even without the CLI app installed

There are a few options. Personally I have intalled npm-check and use the following command: npm-check -gu
But you can also do a npm update -g joplin

Yes and no. It depends.

Every Joplin app (desktop, terminal) uses its own profile directory. The profile directory holds all data for Joplin: the sqlite database (which is used for the notes), the resource directory (has the note attachments), settings, plugins, templates, css files, ...

Depending on the Joplin version, the profile version might increase. The profile version is in reality the version of the database schema. e.g. a table could have added a new column. Or there's an additional table.
This means that an older version of Joplin cannot access the data, because the database schema is different.

It is not a good idea to use the same profile directory with two instances of Joplin. And never, ever start Joplin instances (e.g. desktop and terminal) using the same profile at the same time.

So, if you want to use terminal and desktop app, I highly recommend to use the profiles created by the app. Yes, it duplicates the data and the space usage is doubled, but in the long run, it is a lot safer.

Additionally to the profile version there's also the sync version. If they differ, the joplin app with the lower sync version might not be able to sync and you will have to upgrade.

This also depends. If you want to use the same profile (which I would not do), the profile version must match. If you want to sync with both, the sync version must match.

Not sure how this is possible, because the desktop app does not have any commandline arguments to backup/export notes.

1 Like

Makes sense, thanks for the explanations. I also concede that I must have had joplin CLI installed previously, but had just forgotten about it.

It seems like the issue is clear now— that my cli (and therefore the export script) are trying to use an incompatible db schema than the current (desktop) app is using. So it's obvious I need to upgrade Joplin CLI to do that.

However, I can't seem to get the latest version of Joplin CLI. I run npm update -g joplin but I end up with the same version. Is 1.0.164 not recent? Is there somewhere that I might have manually (and accidentally) changed the profile version?

No. The latest is 1.6.4.

No, the profile is updated automatically when you install a new version.

But you are starting the terminal app with your desktop profile joplin --profile ~/.config/joplin-desktop which I said was a bad idea. And since your desktop app is 1.6.6 it is definitely not compaible with your cli app, the error is also logical.

So I'm still not clear on how to update Joplin CLI. Like I said, I tried to update with npm, but that didn't work. I am also simply running joplin without --profile flag.

This is an npm issue.

You can try: npm install -g joplin@latest
Although I'm not sure why update does not work.

If this doesa not work either, please install npm i -g npm-check and then run npm-check -gu

Npm update never works for me. I think you indeed need npm install.

output from npm install -g joplin@latest:

warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
  ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3320300/sqlite3.c
  TOUCH Release/obj.target/deps/action_before_build.stamp
  CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3320300/sqlite3.o
  LIBTOOL-STATIC Release/sqlite3.a
  CXX(target) Release/obj.target/node_sqlite3/src/backup.o
../src/backup.cc:179:9: warning: unused variable 'status' [-Wunused-variable]
    int status = napi_create_async_work(
        ^
../src/backup.cc:252:5: warning: unused variable 'status' [-Wunused-variable]
    BACKUP_BEGIN(Step);
...
...
info sharp Detected globally-installed libvips v8.10.0
info sharp Building from source via node-gyp
  CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
  LIBTOOL-STATIC Release/nothing.a
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
  CXX(target) Release/obj.target/sharp/src/metadata.o
  CXX(target) Release/obj.target/sharp/src/stats.o
  CXX(target) Release/obj.target/sharp/src/operations.o
  CXX(target) Release/obj.target/sharp/src/pipeline.o
  CXX(target) Release/obj.target/sharp/src/utilities.o
  CXX(target) Release/obj.target/sharp/src/sharp.o
  SOLINK_MODULE(target) Release/sharp.node
ld: warning: dylib (/usr/local/Cellar/vips/8.10.0_1/lib/libvips-cpp.dylib) was built for newer macOS version (10.15) than being linked (10.9)

Then, upon trying to run joplin without any arguments:

Error:
Something went wrong installing the "sharp" module

dlopen(/usr/local/lib/node_modules/joplin/node_modules/sharp/build/Release/sharp.node, 1): Library not loaded: /usr/local/opt/imagemagick/lib/libMagickCore-7.Q16HDRI.7.dylib
  Referenced from: /usr/local/opt/vips/lib/libvips-cpp.42.dylib
  Reason: image not found

- Remove the "node_modules/sharp" directory then run
  "npm install --ignore-scripts=false --verbose" and look for errors
- Consult the installation documentation at https://sharp.pixelplumbing.com/install
- Search for this error at https://github.com/lovell/sharp/issues

Ever seen this one before? happens if I try and install 1.6.4 manually as well

How does your .npmrc file look like? It seems that you install global packages to a location where you don't have write permission.

Where did you install the previous joplin cli app to? Do you have a directory ~/.joplin-bin

Did you set the proper env vars?

Excuse the late reply,

I don't have a root level .npmrc (opt for Yarn mostly).

I do have a .joplin-bin yes

Not sure about the env vars you are referring to. Could you elaborate?

I'm really sorry to ask at this point. Do you know how to install npm on macOS or use the command line? If you don't know how to use the command line, why do you need joplin on terminal?

Either way, I can explain how to install npm and how to set it up that global packages are stored in your home directory, thus no permission errors. I just need to know where to start, because everything I posted should have already fixed your issues.

No worries,

Yes I am a web developer, and need Joplin-CLI mostly for my cronjob backups scripts at this point. I will probably try to make a full transition to using it at some point. However, I'm not entirely familiar with npm (like I said I prefer to use Yarn)

It hadn't occurred to me that it might be a permissions issue, so I went through option 1 here, and tried to run npm install -g joplin@latest again.

It seems that 1.6.4 is now installed. However, when I go to run joplin version, I get the following error again about the sharp module:

Error:
Something went wrong installing the "sharp" module

dlopen(/usr/local/lib/node_modules/joplin/node_modules/sharp/build/Release/sharp.node, 1): Library not loaded: /usr/local/opt/imagemagick/lib/libMagickCore-7.Q16HDRI.7.dylib
  Referenced from: /usr/local/opt/vips/lib/libvips-cpp.42.dylib
  Reason: image not found

- Remove the "node_modules/sharp" directory then run
  "npm install --ignore-scripts=false --verbose" and look for errors
- Consult the installation documentation at https://sharp.pixelplumbing.com/install
- Search for this error at https://github.com/lovell/sharp/issues

It gives some recommendations there, but I have no idea about sharp, and am hesitant to delete it without knowing any of its dependents. Have you seen this before, and would you recommend doing it?

As mentioned before, it seems that you have installed Joplin and thus a few dependencies like the sharp module not in your home dir, but in a global directory, which you don't have permissions to as you user.

But you mentioned that you went with option 1. I usually use option 2. Either way, it's really hard to fix this without having access to the machine. Are you sure that the permissions are correct? I run one command and it is installed. I have no idea why it is that complicated on your machine.

Ok, open the terminal and run the following commands:

cd /usr/local/lib/node_modules/joplin/
rm -rf node_modules/sharp
npm install --ignore-scripts=false --verbose

could this be an issue with having installed node with homebrew? I just stumbled across option 3 in that link I shared, which is to " Use a package manager that takes care of this for you." I wonder if the issue was caused because I am storing my global npm installs in different places?

I tried the above commands you posted, but got hung up on the npm install, with this output:

npm ERR! cc '-DNODE_GYP_MODULE_NAME=nothing' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' -I/Users/kyletycholiz/.node-gyp/14.5.0/include/node -I/Users/kyletycholiz/.node-gyp/14.5.0/src -I/Users/kyletycholiz/.node-gyp/14.5.0/deps/openssl/config -I/Users/kyletycholiz/.node-gyp/14.5.0/deps/openssl/openssl/include -I/Users/kyletycholiz/.node-gyp/14.5.0/deps/uv/include -I/Users/kyletycholiz/.node-gyp/14.5.0/deps/zlib -I/Users/kyletycholiz/.node-gyp/14.5.0/deps/v8/include  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/nothing/../../../../node-addon-api/nothing.o.d.raw   -c -o Release/obj.target/nothing/../../../../node-addon-api/nothing.o ../../../../../node-addon-api/nothing.c
npm ERR!   rm -f Release/nothing.a && ./gyp-mac-tool filter-libtool libtool  -static -o Release/nothing.a Release/obj.target/nothing/../../../../node-addon-api/nothing.o
npm ERR! info sharp Detected globally-installed libvips v8.10.0
npm ERR! info sharp Building from source via node-gyp

By any means, if we are going with option 2 (whose commands I already went through), shouldn't that mean that I should be installing all global packages in ~/.npm-global?

At this point I really don't have any advice anymore. Your system is now complaining that libvips is already installed globally. Which makes no sense, since it should only be a dependecy for a module on level 0.

I'm not an npm or javascript expert. I can only tell you what I did, which is the following:
(I'm using node v14.15.0)

Install nodejs manually

  1. Unzip the binary distribution to /usr/local/lib/nodejs/node-vX.Y.Z
  2. add the following to .bash_profile
    export NODEJS_HOME=/usr/local/lib/nodejs/node-vX.Y.Z/bin
    PATH=$HOME/bin:$NODEJS_HOME:$PATH
    

Download: Download | Node.js

Changing the location of global packages (npm)

  1. Set a new prefix path
    $ npm config get prefix
    $ cd ~ && mkdir .npm-global
    $ npm config set prefix=$HOME/.npm-global
    
  2. add to .bash_profile
    export NODEJS_GLOBAL_HOME=$HOME/.npm-global/bin
    
    PATH=$HOME/bin:$NODEJS_GLOBAL_HOME:$NODEJS_HOME:$PATH
    
  3. Install latest version of npm
    $ npm install -g npm
    

That error seems to mean it's going to build from source instead of downloading some version, so it should be fine. Npm errors are the worst so you need to post the complete log if you want us to find out where the actual issue is.

Sure, here is the complete log, starting at the exception:

npm ERR! code 1
npm ERR! path /usr/local/lib/node_modules/joplin/node_modules/@joplin/tools/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
npm ERR! cc '-DNODE_GYP_MODULE_NAME=nothing' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' -I/Users/kyletycholiz/.node-gyp/14.5.0/include/node -I/Users/kyletycholiz/.node-gyp/14.5.0/src -I/Users/kyletycholiz/.node-gyp/14.5.0/deps/openssl/config -I/Users/kyletycholiz/.node-gyp/14.5.0/deps/openssl/openssl/include -I/Users/kyletycholiz/.node-gyp/14.5.0/deps/uv/include -I/Users/kyletycholiz/.node-gyp/14.5.0/deps/zlib -I/Users/kyletycholiz/.node-gyp/14.5.0/deps/v8/include  -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/nothing/../../../../node-addon-api/nothing.o.d.raw   -c -o Release/obj.target/nothing/../../../../node-addon-api/nothing.o ../../../../../node-addon-api/nothing.c
npm ERR!   rm -f Release/nothing.a && ./gyp-mac-tool filter-libtool libtool  -static -o Release/nothing.a Release/obj.target/nothing/../../../../node-addon-api/nothing.o
npm ERR! info sharp Detected globally-installed libvips v8.10.0
npm ERR! info sharp Building from source via node-gyp
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   '/usr/local/Cellar/node/14.5.0/bin/node',
npm ERR! gyp verb cli   '/usr/local/lib/node_modules/joplin/node_modules/.bin/node-gyp',
npm ERR! gyp verb cli   'rebuild'
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@14.5.0 | darwin | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` succeeded python2 /usr/bin/python2
npm ERR! gyp verb check python version `/usr/bin/python2 -c "import sys; print "2.7.16
npm ERR! gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 14.5.0
npm ERR! gyp verb command install [ '14.5.0' ]
npm ERR! gyp verb install input version string "14.5.0"
npm ERR! gyp verb install installing version: 14.5.0
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 9
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 14.5.0
npm ERR! gyp verb build dir attempting to create "build" dir: /usr/local/lib/node_modules/joplin/node_modules/@joplin/tools/node_modules/sharp/build
npm ERR! gyp verb build dir "build" dir needed to be created? /usr/local/lib/node_modules/joplin/node_modules/@joplin/tools/node_modules/sharp/build
npm ERR! gyp verb build/config.gypi creating config file
npm ERR! gyp verb build/config.gypi writing out config file: /usr/local/lib/node_modules/joplin/node_modules/@joplin/tools/node_modules/sharp/build/config.gypi
npm ERR! gyp verb config.gypi checking for gypi file: /usr/local/lib/node_modules/joplin/node_modules/@joplin/tools/node_modules/sharp/config.gypi
npm ERR! gyp verb common.gypi checking for gypi file: /usr/local/lib/node_modules/joplin/node_modules/@joplin/tools/node_modules/sharp/common.gypi
npm ERR! gyp verb gyp gyp format was not specified; forcing "make"
npm ERR! gyp info spawn /usr/bin/python2
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/joplin/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/joplin/node_modules/@joplin/tools/node_modules/sharp/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/joplin/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/kyletycholiz/.node-gyp/14.5.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/kyletycholiz/.node-gyp/14.5.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/joplin/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/kyletycholiz/.node-gyp/14.5.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/usr/local/lib/node_modules/joplin/node_modules/@joplin/tools/node_modules/sharp',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp verb command build []
npm ERR! gyp verb build type Release
npm ERR! gyp verb architecture x64
npm ERR! gyp verb node dev dir /Users/kyletycholiz/.node-gyp/14.5.0
npm ERR! gyp verb `which` succeeded for `make` /usr/bin/make
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! Traceback (most recent call last):
npm ERR!   File "/usr/local/lib/node_modules/joplin/node_modules/@joplin/tools/node_modules/sharp/build/./gyp-mac-tool", line 611, in <module>
npm ERR!     sys.exit(main(sys.argv[1:]))
npm ERR!   File "/usr/local/lib/node_modules/joplin/node_modules/@joplin/tools/node_modules/sharp/build/./gyp-mac-tool", line 28, in main
npm ERR!     exit_code = executor.Dispatch(args)
npm ERR!   File "/usr/local/lib/node_modules/joplin/node_modules/@joplin/tools/node_modules/sharp/build/./gyp-mac-tool", line 43, in Dispatch
npm ERR!     return getattr(self, method)(*args[1:])
npm ERR!   File "/usr/local/lib/node_modules/joplin/node_modules/@joplin/tools/node_modules/sharp/build/./gyp-mac-tool", line 246, in ExecFilterLibtool
npm ERR!     if not libtool_re.match(line) and not libtool_re5.match(line):
npm ERR! TypeError: cannot use a string pattern on a bytes-like object
npm ERR! make: *** [Release/nothing.a] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/joplin/node_modules/node-gyp/lib/build.js:262:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
npm ERR! gyp ERR! System Darwin 19.6.0
npm ERR! gyp ERR! command "/usr/local/Cellar/node/14.5.0/bin/node" "/usr/local/lib/node_modules/joplin/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /usr/local/lib/node_modules/joplin/node_modules/@joplin/tools/node_modules/sharp
npm ERR! gyp ERR! node -v v14.5.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm verb exit 1
npm timing npm Completed in 25656ms

Sorry unfortunately the errors make no sense whatsoever. Only thing I've noticed is that Joplin is under /usr/local/lib/node_modules/ which means you need sudo to install, and that should be avoided. Could you maybe try to install it as @tessus mentioned above?