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
Migration from 64 bits to 32 bits. #406
Comments
The statement below is likely related to the issue: Upload folder space should be 6.8GB at the moment, so I'm wondering if it's trying to locate data from a different folder that isn't public/uploads/* EDIT: After verifying the image/album I created after-the-fact, I noticed it was using the same directory as the rest of the images correctly. Permissions look OK too, as far as I can tell, as they match the newly created file too. |
The That said, it looks like the error you're experiencing is before that step, which would imply the DB. If the tables there really are populated, and were populated using the same user Lychee is, then I'm running low on ideas. Perhaps you could looks for any differences between your test upload and the pre-existing ones? Particularly anywhere they're not listed. My only other thought would be Lychee versions. So long as the "new" instance is the same or newer that should probably be ok. |
The transfer is a complete rsync of the public uploads folder. The only difference is that on the older system, I was running on a very early pre-release of the 4.0.0 version - from about a year ago, vs. a fresh pull from a few days ago for this new system. du -h lists the folders taking up the full size as expected and match the source. DB-wise, the major difference is the old system used MySQL vs. the new one using MariaDB. When importing the DB, and logging in to the website itself, I use my old u/p combination and it works, and the Top-Level album names are there and correct. Just no photos. I may need to torpedo my current DB and re-import, and try just a full rsync of the old lychee install and see if I can match behaviour. Oh, one other major change, though I really hope this isn't it, is that I went from an x86-based arch to armhf (basically, using an old raspi). I don't think that should be an issue, though, since new photos seem to update and populate in the DB just fine. It feels like the old files just need to be 'rescanned' or something. |
The migration should have handled that
This is concerning. It seems too much of a difference to be a difference between real filesize and on-disk. Please double check the permissions. The command we're using is ls -ltrR {$dir} |awk '{print $5}'|awk 'BEGIN{sum=0} {sum=sum+$1} END {print sum}' 2>&1 If you replace
That shouldn't be a problem.
Ah, ok. When I read "none of the albums or subalbums exist" that's quite different to empty from a debugging point of view (but I'm a little time limited right now, and nothing's leaping out at me)
That's promising (though not for debugging). The IDs and permissions should carry across too, so that shouldn't be it...
I'd be surprised. One other thought - is Lychee at the same path on both installations? |
Hey, thanks for replying! Following up on some questions.
I actually don't, which is really weird. I get:
Which is a heck of a lot more than the 2GB it says it's using.
Yes, the exact same path. I had another thought that maybe I was running Apache2 as another user in the old server, and it was enumerating correctly there but not on this, but that's not the case either - same user on both.
All files are using the following permissions. I assume since Apache's running as that user, we should be getting rwx across the board.
Nothing obvious jumps out at me either. I'm going to hopefully have some time later today to just do a full copy of the original site's tree and retry with that to see if it's some weird stuff happening with my local pull. |
Did a clone of the original site, using the same DB, and I'm getting a "Server Error or API not found" error. Strange. |
@d7415, is there any known issue with using a DB primarily populated by 64-bit keys when you move to a 32-bit PHP in a 32-bit OS environment? Should there be some migration step that simplifies the keys or something to that effect? One other question - the new .env.example file contains LYCHEE_DIST, LYCHEE_UPLOADS, and the URL counterparts, commented out by default. My install is actually entirely located in /opt/LycheeLaravel/ and I've symlinked the public folder over to my /var/www/html/subdir folder, as I did in the prior installation. Should I be uncommenting/changing these values to anything? |
I've had some time recently to play around again. I got uploads working, and compared a prior-existing photo to the one I uploaded:
You'll note that the ALBUMID of the old file is 15559813947835 whereas the new upload is NULL. EDIT: EDIT2: So... maybe it is a bitness issue. See below:
|
That seems likely...
If the symlinks are in the appropriate places, that should be sufficient. Yeah, so your testing indicates that the old album had an ID > 2^32, which will break everything. The 32-bit code will be expecting a 32-bit installation from the start, and so I'm not surprised it doesn't work here. It might even (I haven't checked) make things worse. If I get a chance later I'll look at adding a note to the migration instructions and see how best to convert. |
After a quick look, the migration should handle this. You did run I also only just noticed that the FAQ you linked was from version 3... |
Yes, I did run The FAQ I linked is off of this Github page - did you move to a new instruction set somewhere else specifically for migration on 4.0.0? All that I can find by going through here is that link above, which you can get to via going to the Wiki here, then going to the FAQs. The installation instructions proper (https://github.com/LycheeOrg/Lychee-Laravel/wiki/Install) don't really have much in the way of migrating to a new host as it's very high level instructions. The assumption was that I had to dump the lychee DB from one host, import it on the other, then migrate, after matching my file structure and permissions. |
Right. So. When you copied the database, you'll have copied the migrations table. try The migration step was added as a one-off fix when upgrading from v3, but migrations only run once per installation. That step should trick it into running again. The FAQ you linked is from the old repo. But essentially the procedure should work, if you're not changing between 32- and 64-bit architectures. |
Ah, ok, I'll give that a try on the weekend and report back. Honestly, I'm not that familiar with this side of things, and that was along the lines of what I was thinking was needed. Thanks for the attention and help, nonetheless! |
Partially there! That seemed to have gotten my first-level stuff all sorted, but all my sub-albums are still missing. It seems the sub-album is still referencing a 64-bit album ID (parent_id), so the 32-bit migration step is only partially addressing it all. I don't suppose there's another migration I can reset like that? EDIT
Note that the parent_id has the extra digits from the original main album id. EDIT2: So it seems like your migration step just missed the parent_id adjustment - a hopefully easy change to implement, and a documentation step to include in the wiki for when migrating across architectures! |
Added to FAQ |
Detailed description of the problem
I was moving my installation from one system to another, and I followed the instructions located here: https://github.com/LycheeOrg/Lychee/wiki/FAQ#how-can-i-move-my-installation
I'm moving from a 4.0.0 installation to another 4.0.0 installation, though from MySQL to MariaDB, which I understand is functionally identical.
When logging in to the session on the new location, I notice that none of the albums or subalbums exist, nor do any pictures exist from the old installation. I get an error in the log:
2019-12-13 21:01:15 -- error -- App\Http\Middleware\ReadCheck::handle -- 45 -- Could not find specified album
2019-12-13 21:01:12 -- error -- App\Http\Middleware\ReadCheck::handle -- 45 -- Could not find specified album
Creating a new album/uploading a new image works as expected.
I've verified the DB instance and all the data in there from the old albums and photos looks correct and is populated. Artisan migration showed no issues, either.
Steps to reproduce the issue
Steps to reproduce the behavior:
Output of the diagnostics
Diagnostics
-----------
Info: Latest version of PHP is 7.4
Warning: Using 32 bit PHP, recommended upgrade to 64 bit
Warning: Dropbox import not working. dropbox_key is empty.
Browser and system
N/A, all show the same issue
The text was updated successfully, but these errors were encountered: