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

Cannot import KeePass 2.x XML #1737

Closed
Tmkrth opened this issue Apr 20, 2017 · 18 comments
Closed

Cannot import KeePass 2.x XML #1737

Tmkrth opened this issue Apr 20, 2017 · 18 comments
Labels

Comments

@Tmkrth
Copy link

Tmkrth commented Apr 20, 2017

Good day, I seem to be unable to import a KeePass 2.x xml-file into TeamPass. The page replies "cannot read file, must be a KeePass file" and no import takes place.

The webserver shows errors: [Thu Apr 20 14:55:35.729932 2017] [:error] [pid x] [client x] PHP Warning: SessionHandler::write(): The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in /var/lib/teampass/sources/SecureHandler.php on line 74, referer: https://x/teampass/index.php?page=items and [Thu Apr 20 14:55:35.729948 2017] [:error] [pid x] [client x] PHP Warning: session_write_close(): Failed to write session data (user). Please verify that the current setting of session.save_path is correct (/var/lib/php/sessions) in Unknown on line 0, referer: https://x/teampass/index.php?page=items

The upload from my browser to the server's teampassroot/files/ works, I can find the to-be-imported files there afterwards, renamed.

I also tried with KeePass 1.x xml and csv files, on TeamPass 2.1.26, 2.1.27.1 and now 2.1.27.2. All TeamPass folders belong to the webserver, permissions are 750 for directories and 640 for files. It is a standard LAMP (Apache2, MySQL5, php7) on Ubuntu 16.04 LTS.

I have read the other issues here with similar problems depicted but am still unable to make the import happen. It would be really nice if I would not have to migrate thousands of passwords by hand. How can I make it work?

@Tmkrth
Copy link
Author

Tmkrth commented Apr 21, 2017

Hello again, I read all the issues returning from search request "is:issue import" and tried all of the approaches and suggested workarounds discussed there. It is not importing.

If I want to import from a .csv it tells "you need to choose a folder" in red. But there is nothing and nowhere to chosse a folder from. If I copy the .csv to teampassroot/files/ beforehand, the error stays the same and the file gets deleted.

If I try to import a .xml it tells me that this is not a KeePass file, please note the header in my .xml: <?xml version="1.0" encoding="utf-8" standalone="yes"?>. If I copy that .xml to teampassroot/files/ beforehand it gives the "JSON parse error" instead and actually does create files "cpassman_..." in which I can see the correct directory structure and passwords from KeePass, but it is not landing in the WebUI.

Apache error.log constantly gives the two php warnings shown a post before which i cannot find anything related that I can do about it.

I have double checked ownership and permissions, phpmods, installed packages and all that.

Please help.

@edzoe
Copy link

edzoe commented Apr 26, 2017

no feedback on this from developers? ... I experience the same problem.

@giantsquidman
Copy link

I also experience the same issue. Didn't experience this problem in version 2.1.26.

I have the exact same setup as Tmkrth:

I also tried with KeePass 1.x xml and csv files, on TeamPass 2.1.26, 2.1.27.1 and now 2.1.27.2. All TeamPass folders belong to the webserver, permissions are 750 for directories and 640 for files. It is a standard LAMP (Apache2, MySQL5, php7) on Ubuntu 16.04 LTS.

@nilsteampassnet
Copy link
Owner

I confirm that a bug exists here.
It requires deep investigation as I couldn't found the bug during simple code review.

nilsteampassnet added a commit that referenced this issue May 3, 2017
Fix for #1737
@nilsteampassnet
Copy link
Owner

Cause identified.
Commit with fix was performed 7944010

Quick change. Open file items.import.php
Replace

                        "PHPSESSID":"'.$_SESSION['user_id'];?>",

by

                        "PHPSESSID":"<?php echo $_SESSION['user_id'];?>",

@nutt318
Copy link

nutt318 commented May 11, 2017

I've changed the code in the file and restarted all services. I'm still getting an error while importing 'Can't read the file! It must be a KeePass file.' I've also removed the master password from the KeePass database and export the xml file but still no luck.

TeamPass 2.1.27 with above fix applied, added in both places
Running on Windows WAMP stack, tried both version of PHP and restarted all services
KeePass XML file is 2,908KB

Still getting the above error while importing KeePass xml file.

@nilsteampassnet
Copy link
Owner

Did you perform the upgrade then?

@nutt318
Copy link

nutt318 commented May 12, 2017

The upgrade would never complete so I downloaded the new .3 version and did a new install. It still wouldn't import and looking back at the files they still had old code. Not sure if I didn't get the correct version but it did say TeamPass-2.1.27.3.zip and the old code still was in there.

Any ideas? I'll do a new install again if thats the easiest.

@nilsteampassnet
Copy link
Owner

Perhaps something relating to the size of the file imported.
With the browser console, can you get the result of the execution of upload.files.php?
It should contain interesting things.

@nutt318
Copy link

nutt318 commented May 16, 2017

@nilsteampassnet Not sure exactly what I'm looking at but I think this is what your wanting. Hope this helps.
image

@nilsteampassnet
Copy link
Owner

There doesn't seem to have an error during the file transfert itself.

I don't really understand what happen here.
I would need to access the server, possible?

@nutt318
Copy link

nutt318 commented May 17, 2017

@nilsteampassnet Sure, do you have an email I can send a webex invite to?

@nilsteampassnet
Copy link
Owner

nils@teampass.net

@nilsteampassnet
Copy link
Owner

Fixed on user server.

@nutt318, I'm looking for testimonials for the new website. Could I hope to have yours?
A small one would be great. We can discuss by email.

@nutt318
Copy link

nutt318 commented May 22, 2017

@nilsteampassnet email sent :)

@nilsteampassnet
Copy link
Owner

@nutt318, I did not received your email. can you resend it please?

Thanks

@nutt318
Copy link

nutt318 commented Jun 9, 2017 via email

@009thomas
Copy link

Nils, Here is some feeedback, thanks again for the help. Look forward to .4 release. We've been using TeamPass for a few weeks and will be rolling it out to the entire company soon. You can't find a better team password solution out there for free with as many features as this one! Highly recommended. Thanks, Jake

Sent from my iPhone
On May 27, 2017, at 8:01 AM, Nils Laumaillé @.***> wrote: @nutt318, I did not received your email. can you resend it please? Thanks — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

Nils, Here is some feeedback, thanks again for the help. Look forward to .4 release. We've been using TeamPass for a few weeks and will be rolling it out to the entire company soon. You can't find a better team password solution out there for free with as many features as this one! Highly recommended. Thanks, Jake

Sent from my iPhone
On May 27, 2017, at 8:01 AM, Nils Laumaillé @.***> wrote: @nutt318, I did not received your email. can you resend it please? Thanks — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

Hi Jake,
Any best practices for keeping the folder names and subfolder names ?

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

No branches or pull requests

6 participants