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

User is not authenticated exception when I run lychee:sync #1791

Closed
Anduin2017 opened this issue Apr 11, 2023 · 1 comment · Fixed by #1796
Closed

User is not authenticated exception when I run lychee:sync #1791

Anduin2017 opened this issue Apr 11, 2023 · 1 comment · Fixed by #1796
Assignees
Labels
bug Something isn't working good first issue Good for newcomers High Priority High priority issues

Comments

@Anduin2017
Copy link
Contributor

Anduin2017 commented Apr 11, 2023

Detailed description of the problem [REQUIRED]

A clear and concise description of what the bug is.

User is not authenticated exception when I run lychee:sync.

image

Steps to reproduce the issue

Steps to reproduce the behavior:

  1. Install Lychee.
  2. Run command:
sudo -u www-data /usr/bin/php /var/www/html/Lychee/artisan lychee:sync /mnt/Nextcloud/Photos/

Then I see:

Start syncing.
/mnt/Nextcloud/Photos: 0%
/mnt/Nextcloud/Photos: 100%
/mnt/Nextcloud/Photos: User is not authenticated
Done syncing.

Output of the diagnostics [REQUIRED]

(Settings => Diagnostics or https://example.com/Diagnostics or php artisan lychee:diagnostics)

Warning: Default timezone not properly set; you might experience strange results when importing photos without explicit EXIF timezone

System Information
------------------
Lychee Version (git):                    master (28b395a) -- 1 commits behind 2f74019 (0 seconds ago)
DB Version:                              4.7.2

composer install:                        --no-dev
APP_ENV:                                 production
APP_DEBUG:                               false

System:                                  Linux
PHP Version:                             8.1.2-1ubuntu2.11
PHP User agent:                          Lychee/4 (https://lycheeorg.github.io/)
Timezone:                                UTC
Max uploaded file size:                  2M
Max post size:                           8M
Max execution time:                      0
MySQL Version:                           8.0.32-0ubuntu0.22.04.2

exec() Available:                        yes
Imagick Available:                       1
Imagick Enabled:                         1
Imagick Version:                         1691
GD Version:                              2.3.0
Number of foreign key:                   12 found.

Config Information
------------------
version:                                 040702
check_for_updates:                       0
sorting_photos_col:                      taken_at
sorting_photos_order:                    ASC
sorting_albums_col:                      max_taken_at
sorting_albums_order:                    ASC
imagick:                                 1
skip_duplicates:                         0
small_max_width:                         0
small_max_height:                        360
medium_max_width:                        1920
medium_max_height:                       1080
lang:                                    en
layout:                                  1
image_overlay_type:                      desc
default_license:                         none
compression_quality:                     90
grants_full_photo_access:                1
delete_imported:                         0
mod_frame_enabled:                       1
mod_frame_refresh:                       30
thumb_2x:                                1
small_2x:                                1
medium_2x:                               1
landing_page_enable:                     0
site_owner:                              John Smith
landing_title:                           John Smith
landing_subtitle:                        Cats, Dogs & Humans Photography
sm_facebook_url:                         https://www.facebook.com/JohnSmith
sm_flickr_url:                           https://www.flickr.com/JohnSmith
sm_twitter_url:                          https://www.twitter.com/JohnSmith
sm_instagram_url:                        https://instagram.com/JohnSmith
sm_youtube_url:                          https://www.youtube.com/JohnSmith
landing_background:                      dist/cat.webp
site_title:                              Lychee v4
footer_show_copyright:                   1
site_copyright_begin:                    2019
site_copyright_end:                      2019
footer_additional_text:
footer_show_social_media:                0
public_search:                           0
SL_enable:                               0
SL_for_admin:                            0
public_recent:                           0
recent_age:                              1
public_starred:                          0
grants_download:                         0
photos_wraparound:                       1
map_display:                             0
zip64:                                   1
map_display_public:                      0
map_provider:                            Wikimedia
force_32bit_ids:                         0
map_include_subalbums:                   0
update_check_every_days:                 3
has_exiftool:                            0
share_button_visible:                    0
import_via_symlink:                      0
has_ffmpeg:                              1
location_decoding:                       0
location_decoding_timeout:               30
location_show:                           1
location_show_public:                    0
rss_enable:                              0
rss_recent_days:                         7
rss_max_items:                           100
prefer_available_xmp_metadata:           0
editor_enabled:                          1
lossless_optimization:                   0
swipe_tolerance_x:                       150
swipe_tolerance_y:                       250
local_takestamp_video_formats:           .avi|.mov
log_max_num_line:                        1000
unlock_password_photos_with_url_param:   0
nsfw_visible:                            1
nsfw_blur:                               0
nsfw_warning:                            0
nsfw_warning_admin:                      0
nsfw_banner_override:
map_display_direction:                   1
album_subtitle_type:                     oldstyle
upload_processing_limit:                 4
public_photos_hidden:                    1
new_photos_notification:                 0
legacy_id_redirection:                   1
zip_deflate_level:                       6
SA_enabled:                              1
default_album_protection:                1
album_decoration:                        layers
album_decoration_orientation:            row
allow_username_change:                   1
public_on_this_day:                      0
auto_fix_orientation:                    1
use_job_queues:                          0

Browser and system

I have made sure all folders sync from and to belongs to www-data.

image

image

image

@ildyria ildyria added the bug Something isn't working label Apr 14, 2023
@ildyria
Copy link
Member

ildyria commented Apr 14, 2023

I have my idea of why this is happening.
I will try to have a look later.

If someone wants to grab it before me, here is the hint:
Look into album creation (App/Actions/Album/Create.php), it is most likely using Auth::user()->id ?? throw ... to retrieve the intended owner of the album. This should be replaced by a parameter to the function and set in the App/Console/Sync class & App/Http/Controller/Album class.

@ildyria ildyria self-assigned this Apr 14, 2023
@ildyria ildyria added High Priority High priority issues good first issue Good for newcomers labels Apr 14, 2023
ildyria added a commit that referenced this issue Apr 16, 2023
qwerty287 pushed a commit that referenced this issue Apr 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers High Priority High priority issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants