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 · 41 comments
Closed

Unable to create literature note in Linux #18

dummifiedme opened this issue Jan 19, 2022 · 41 comments

Comments

@dummifiedme
Copy link

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

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

@dummifiedme
Copy link
Author

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

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 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

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

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

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

@dummifiedme
Copy link
Author

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

@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

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

@dummifiedme
Copy link
Author

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

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 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 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 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 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

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

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

@dummifiedme
Copy link
Author

@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

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

@stefanopagliari
Copy link
Owner

@MichaBrugger Does the last version work for you?

@dummifiedme
Copy link
Author

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

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

@chaozg
Copy link

chaozg 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

: 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?

@chaozg
Copy link

chaozg 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

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

@chaozg
Copy link

chaozg 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

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.

@chaozg
Copy link

chaozg 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

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

@chaozg
Copy link

chaozg 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

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

@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

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

@stefanopagliari
Copy link
Owner

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

@chaozg
Copy link

chaozg commented Jan 25, 2022

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

@stefanopagliari
Copy link
Owner

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

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

@jrichardson97
Copy link

Were there any changes made recently that would have broken this fix? I am getting the copyfile error where home does not have root forward slash before it.

@chaozg
Copy link

chaozg commented Oct 24, 2022

@jrichardson97 I can confirm that "Copy the Image into the Obsidian Vault" stops working on my Linux machine, see attached screenshot. The target path misses a slash at the very beginning.
Screenshot from 2022-10-24 17-23-19

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

No branches or pull requests

5 participants