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

Changing install from broken brew install to pip #828

Closed
todun opened this issue Jan 31, 2020 · 5 comments
Closed

Changing install from broken brew install to pip #828

todun opened this issue Jan 31, 2020 · 5 comments
Labels
🔒 Outdated needs more info Further information is requested support End user support

Comments

@todun
Copy link

todun commented Jan 31, 2020

Bug report

Hello! Thank you for reporting an issue!
If you would fill out the below points, that would make our process a whole lot easier!

  • Please tell us about your environment:
    • Jrnl version: (run jrnl -v)

jrnl version 2.1.1

  • How you installed Jrnl
brew install jrnl
brew uninstall jrnl
pip install jrnl
  • Operating system [MacOS, Linux, Windows?]

macOS

  • What is the current behavior?
Command

jrnl

Command prompts

Following encrypted journals will be upgraded to jrnl 2.1.1:
default -> /Users/user/journal.txt
Continue upgrading jrnl? [y/N] y
Upgrading encrypted 'default' journal stored in /Users/user/journal.txt...
Created a backup at /Users/user/journal.txt.backup
Password:

Command Error

ValueError: Invalid IV size (0) for CBC.

  • Please provide the steps to reproduce and if possible a minimal demo of the problem
brew install jrnl
brew uninstall jrnl
pip install jrnl
jrnl
  • What is the expected behavior?
    should store jrnl entry

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

Traceback (most recent call last):
File "/usr/local/bin/jrnl", line 8, in
sys.exit(run())
File "/usr/local/lib/python3.7/site-packages/jrnl/cli.py", line 144, in run
config = install.load_or_install_jrnl()
File "/usr/local/lib/python3.7/site-packages/jrnl/install.py", line 92, in load_or_install_jrnl
upgrade.upgrade_jrnl_if_necessary(config_path)
File "/usr/local/lib/python3.7/site-packages/jrnl/upgrade.py", line 91, in upgrade_jrnl_if_necessary
old_journal = Journal.open_journal(journal_name, util.scope_config(config, journal_name), legacy=True)
File "/usr/local/lib/python3.7/site-packages/jrnl/Journal.py", line 366, in open_journal
return EncryptedJournal.LegacyEncryptedJournal(name, **config).open()
File "/usr/local/lib/python3.7/site-packages/jrnl/Journal.py", line 75, in open
text = self._load(filename)
File "/usr/local/lib/python3.7/site-packages/jrnl/EncryptedJournal.py", line 125, in _load
return util.get_password(keychain=self.name, validator=validate_password)
File "/usr/local/lib/python3.7/site-packages/jrnl/util.py", line 46, in get_password
result = validator(password)
File "/usr/local/lib/python3.7/site-packages/jrnl/EncryptedJournal.py", line 110, in validate_password
decryptor = Cipher(algorithms.AES(decryption_key), modes.CBC(iv), default_backend()).decryptor()
File "/usr/local/lib/python3.7/site-packages/cryptography/hazmat/primitives/ciphers/base.py", line 108, in init
mode.validate_for_algorithm(algorithm)
File "/usr/local/lib/python3.7/site-packages/cryptography/hazmat/primitives/ciphers/modes.py", line 82, in _check_iv_and_key_length
_check_iv_length(self, algorithm)
File "/usr/local/lib/python3.7/site-packages/cryptography/hazmat/primitives/ciphers/modes.py", line 76, in _check_iv_length
len(self.initialization_vector), self.name
ValueError: Invalid IV size (0) for CBC.

@todun todun added 🆕 New! bug Something isn't working labels Jan 31, 2020
@wren
Copy link
Member

wren commented Feb 1, 2020

Hi, it sounds like you're running into two known bugs (see below). You should be able to fix it by deleting the old config file (~/.jrnl_config) and trying the pip-installed jrnl again (which should prompt you to create a new jrnl).

If you're interested in the details, this is due to the brew install formula being currently broken (#781). Brew installs jrnl, you run it, jrnl starts by creating a config file, then dies because the brew install is broken. Then, when you get to using the pip version, it sees the jrnl v1 config on your system, and tries to upgrade it to v2. But since you don't actually have a journal, yet, it chokes on the missing file (#690).

@wren wren added support End user support and removed 🆕 New! bug Something isn't working labels Feb 1, 2020
@wren
Copy link
Member

wren commented Feb 1, 2020

Also, can you please report back if this works for you or not? Thank you!

@wren wren added the needs more info Further information is requested label Feb 1, 2020
@wren wren changed the title Upgrading from Changing install from broken brew install to pip Feb 1, 2020
@todun
Copy link
Author

todun commented Feb 2, 2020

Thank you. That resolved the issue(steps below). Marking this issue closed on my end.

rm -i ~/.jrnl_config
pip uninstall jrnl
pip install jrnl
jrnl

@todun todun closed this as completed Feb 2, 2020
@lock
Copy link

lock bot commented May 20, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

1 similar comment
@lock
Copy link

lock bot commented May 20, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the 🔒 Outdated label May 20, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔒 Outdated needs more info Further information is requested support End user support
Projects
None yet
Development

No branches or pull requests

2 participants