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

Unable to create literature note in Linux #18

Closed
dummifiedme opened this issue Jan 19, 2022 · 39 comments
Closed

Unable to create literature note in Linux #18

dummifiedme opened this issue Jan 19, 2022 · 39 comments

Comments

@dummifiedme
Copy link

@dummifiedme dummifiedme commented Jan 19, 2022

Could import the BibTex Json but couldn’t create a literature note.

The json library imports quite well and contains the highlights for that file too.
image

Shows a success notification, but there is no file to be found anywhere across the vault.
image

The console suggests that no such file or directory, open
image

Things I have tried:

  • Added extra / towards the end
  • Tried in a different vault
  • Tried changing the directory to root
  • Tried various files
  • Tried previous version of the plugin

Can there be a permissions issue? (I am on linux)

System Details:
OS: Linux Manjaro (Arch-based; arch but not arch :p)
Obsidian: Latest 13.15?
BibNote version: Latest

@stefanopagliari
Copy link
Owner

@stefanopagliari stefanopagliari commented Jan 19, 2022

I have released a new update (v. 09). Could you please try this version?

@dummifiedme
Copy link
Author

@dummifiedme dummifiedme commented Jan 20, 2022

I have released a new update (v. 09). Could you please try this version?

I did, and it didn't work.

And I think a lot of similar issues just popped in by many other users too :|

Something went wrong after v8.0 I guess. Waiting for it to get fixed! :)

@stefanopagliari stefanopagliari changed the title Unable to create literature note Unable to create literature note in Linux Jan 20, 2022
@stefanopagliari
Copy link
Owner

@stefanopagliari stefanopagliari commented Jan 20, 2022

Was this working in Version 0.8?
I need to figure out whether it just a problem with the path where the file is being exported or a problem with file access (if v 0.8 worked, then probably it is an issue with the file path). I have released a new version 0.9.03 that uses a different library to deal with the file path. Could you please check if that solves the problem?

@dummifiedme
Copy link
Author

@dummifiedme dummifiedme commented Jan 20, 2022

Was this working in Version 0.8? I need to figure out whether it just a problem with the path where the file is being exported or a problem with file access (if v 0.8 worked, then probably it is an issue with the file path). I have released a new version 0.9.03 that uses a different library to deal with the file path. Could you please check if that solves the problem?

I had tried v8.0, didn't work either. Nor does the latest v9.0.3
The path it shows in the console is correct, doesn't seem to be a problem there.

Also, I searched online for that error, I might sound stupid, but is node.js involved anywhere? Every solution seems to be pointing at npm install and when I last checked, I don't have it installed on my linux.

Direct me, if I should install it for the code to work :) (nvm, I did. Doesn't make any difference)

@stefanopagliari
Copy link
Owner

@stefanopagliari stefanopagliari commented Jan 20, 2022

node.js is involved, and the library (code) dealing with creating the note is from node.js but this does not require you to install anything.
I have created a debugging mode to be able to see the logs. Could you please:

  • install version 0.9.04
  • at the bottom of the settings, activate the debugging mode
  • export a single reference. You will be prompted to create a txt file
  • share the file with me here (assuming there is no confidential/private information in the note and the settings, but let me know if there is)

@dummifiedme
Copy link
Author

@dummifiedme dummifiedme commented Jan 21, 2022

I installed the v9.04 and it worked!! Works fine!
Thanks!

PS. Do you want me to share the debug.txt anyway?

@stefanopagliari
Copy link
Owner

@stefanopagliari stefanopagliari commented Jan 21, 2022

No, if it works, then there is no need for that

@dummifiedme
Copy link
Author

@dummifiedme dummifiedme commented Jan 21, 2022

Thank You :)

@stefanopagliari

A related error popped in. I turned on Image capture and it didn't show up in the note. I checked the console, it was the same error as earlier with the file EOENT No such file or directory, copyfile.

I am attaching the debug.txt
debugout.txt

@dummifiedme
Copy link
Author

@dummifiedme dummifiedme commented Jan 21, 2022

@stefanopagliari Should I raise it as another issue?
(I think its the same issue, but with images this time. Needs the same magic you worked out earlier :p)

@stefanopagliari
Copy link
Owner

@stefanopagliari stefanopagliari commented Jan 22, 2022

Could you try the latest version 0.9.05 and send me the file extracted when you activate debugging mode?

@dummifiedme
Copy link
Author

@dummifiedme dummifiedme commented Jan 22, 2022

I tried the latest that was available, v0.9.07

  • Images did not transfer/load in the note.

Here is the debugging file:
debugout.txt

@stefanopagliari
Copy link
Owner

@stefanopagliari stefanopagliari commented Jan 22, 2022

Two questions:

  • Is there any message in the console.log when the plugin fails to import the image? (Obsidian --> View --> Toggle Developer Tools --> Console)
  • What happens is turn off the setting "Copy File of the Image into the Obsidian Vault"?

@dummifiedme
Copy link
Author

@dummifiedme dummifiedme commented Jan 22, 2022

  • Is there any message in the console.log when the plugin fails to import the image? (Obsidian --> View --> Toggle Developer Tools --> Console)

image

  • What happens is turn off the setting "Copy File of the Image into the Obsidian Vault"?

Then it shows the images correctly.


The problem here is that the images are not copied. In my opinion, it is the same error we saw with files not being created.

@stefanopagliari
Copy link
Owner

@stefanopagliari stefanopagliari commented Jan 22, 2022

Thanks, @MichaBrugger is facing the same problem on Linux.
Is run/media/prestige/etc... an absolute path?

@dummifiedme
Copy link
Author

@dummifiedme dummifiedme commented Jan 22, 2022

Thanks, @MichaBrugger is facing the same problem on Linux. Is run/media/prestige/etc... an absolute path?

Yes. The path is correct and absolute.
How did you fix the previous issue with the files? Is there anything specific you did? It is the same error again but with the images.

PS. Can we please open this issue? I am not getting notified :(

@stefanopagliari
Copy link
Owner

@stefanopagliari stefanopagliari commented Jan 22, 2022

The export of the note is done in this way:

// Replace illegal character from the title
exportTitle = exportTitle.replace(/[/\\?%*:|"<>]/g, "")  
//Get the path of the vault
const vaultPath = this.app.vault.adapter.getBasePath()
//create Export Path
const exportPathFull = path.normalize(vaultPath + "/" + exportPath + "/" + exportTitle + ".md");
//Export Note
fs.writeFile(noteTitleFull, litnote, function (err) {
				if (err) console.log(err);
			});

@MichaBrugger
Copy link
Contributor

@MichaBrugger MichaBrugger commented Jan 22, 2022

I'll make a PR with a fix in a few minutes. I'm just trying to figure out something else real quick 👍🏼

MichaBrugger added a commit to MichaBrugger/bibnotes that referenced this issue Jan 22, 2022
@stefanopagliari
Copy link
Owner

@stefanopagliari stefanopagliari commented Jan 23, 2022

@dummifiedme could you please test version 0.9.08 and let us know if this works now?

@dummifiedme
Copy link
Author

@dummifiedme dummifiedme commented Jan 23, 2022

@dummifiedme could you please test version 0.9.08 and let us know if this works now?

Same error :(
Exactly the same error log as int he screenshot above.

@stefanopagliari
Copy link
Owner

@stefanopagliari stefanopagliari commented Jan 23, 2022

Is the path in the second file path the same? Could you please post the logs again?

@stefanopagliari
Copy link
Owner

@stefanopagliari stefanopagliari commented Jan 23, 2022

@MichaBrugger Does the last version work for you?

@dummifiedme
Copy link
Author

@dummifiedme dummifiedme commented Jan 23, 2022

Is the path in the second file path the same?

I didn't understand which path. I had just given my attachment folder in the settings. Whatever the setting was, it is the same for both the cases.
image

Could you please post the logs again?

debugout.txt

These are the settings:
image

@stefanopagliari
Copy link
Owner

@stefanopagliari stefanopagliari commented Jan 23, 2022

Thank you. If you have a second, could you try this version and post here the console logs before the error?

@cztuc
Copy link

@cztuc cztuc commented Jan 23, 2022

Could zotero version be the reason?
I can confirm that zotero-beta (5.0.97-beta.63+035aac30f) + obsidian (0.13.19) + bibnotes (0.9.071) works well on my Ubuntu 18.04 and 20.04 machines: I can create/update literature notes and images are also there.

@stefanopagliari
Copy link
Owner

@stefanopagliari stefanopagliari commented Jan 23, 2022

: I can create/update literature notes and images are also there

Are the images in there if you try to copy them in the vault?

@cztuc
Copy link

@cztuc cztuc commented Jan 23, 2022

Sorry for my misleading comment above.

Image linking (with "copy image to obsidian" off) is fine; but it gives errors when the option is toggled to on. The error message is as:
Screenshot_bibnotes
Note slash / is missing at the very beginning of the target path.

@stefanopagliari
Copy link
Owner

@stefanopagliari stefanopagliari commented Jan 23, 2022

Thank you @cztuc.

If you have a second, could you try this version and post here the console logs before the error?

We have pushed a fix yesterday to add the backslash at the beginning but I need to understand why it is not working as planned on Linux

@cztuc
Copy link

@cztuc cztuc commented Jan 23, 2022

Yes, the screenshot was captured with version 0.9.071 (though manifest.json states: "version": "0.9.08"). Sorry again for not making it clear.

Oh you mean the logs before the error, give me like 2 minutes.

@stefanopagliari
Copy link
Owner

@stefanopagliari stefanopagliari commented Jan 23, 2022

Yes, the screenshot was captured with version 0.9.071 (though manifest.json states: "version": "0.9.08"). Sorry again for not making it clear.

Oh you mean the logs before the error, give me like 2 minutes.

Thanks. 0.9.071 is the same as 0.9.08 with a couple of console.logs added to get to the bottom of what is happening here.

@cztuc
Copy link

@cztuc cztuc commented Jan 23, 2022

The logout is quite long. I'm not sure if I captured all relevant part. In case I didn't please let me know. (debugout.txt is also attached)
1
1_5
2
debugout.txt

@stefanopagliari
Copy link
Owner

@stefanopagliari stefanopagliari commented Jan 23, 2022

The part I was interested in should read: "pathImageNew before systemcheck" ... "systemcheck"..." "pathImageNew after` systemcheck: ")

@cztuc
Copy link

@cztuc cztuc commented Jan 23, 2022

screen1.log
Here are all the logs in .txt. I'm sorry I didn't see any of the strings you mentioned.

@dummifiedme
Copy link
Author

@dummifiedme dummifiedme commented Jan 23, 2022

Thank you. If you have a second, could you try this version and post here the console logs before the error?

v9.071 throws the same error. Here's the debug file:
debugout.txt

@dummifiedme
Copy link
Author

@dummifiedme dummifiedme commented Jan 23, 2022

@cztuc @stefanopagliari

I did an experiment. I opened a trial vault on the home drive.
And it worked fine with all the images copied to VAULT.

It seems like, when the Vault is in other drive (mounted, hence 'run/') it fails.

I don't know the know-how. But maybe it is helpful in pinpointing the issue to an extent?

debugout.txt

@dummifiedme
Copy link
Author

@dummifiedme dummifiedme commented Jan 24, 2022

Latest debug. I get notifs saying the images were not found in the zotero library.
debugout.txt
image

@stefanopagliari
Copy link
Owner

@stefanopagliari stefanopagliari commented Jan 25, 2022

Could you please check if the problem is solved by version 0.9.11 (https://github.com/stefanopagliari/bibnotes/releases/tag/0.9.11)?

@cztuc
Copy link

@cztuc cztuc commented Jan 25, 2022

Yes, I see images now in my obsidian Vault. Thanks @stefanopagliari !

@stefanopagliari
Copy link
Owner

@stefanopagliari stefanopagliari commented Jan 25, 2022

It was actually @MichaBrugger who fixed this.
@dummifiedme, could you please check as well? If the problem is solved please close the issue

@dummifiedme
Copy link
Author

@dummifiedme dummifiedme commented Jan 25, 2022

@stefanopagliari Works like a charm! Thanks for the efforts! Really appreciate it :)
@MichaBrugger, thanks to you too :))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants