canonical / craft-parts

https://canonical-craft-parts.readthedocs-hosted.com
GNU Lesser General Public License v3.0
11 stars 37 forks source link

Network error message on sources makes you think it was for stage-packages #738

Closed sergiusens closed 4 months ago

sergiusens commented 5 months ago

Bug Description

I got

Fetching stage-packages                                                        
Network request error: network request failed (request=<PreparedRequest [GET]>, response=<Response [404]>).
Check the network and try again.

When trying to build digikam from https://invent.kde.org/packaging/snapcraft-kde-applications. There are plenty of stage-packages to download, suddenly I get

Fetching stage-packages                                                        
Network request error: network request failed (request=<PreparedRequest [GET]>, response=<Response [404]>).
Check the network and try again.                   
Failed to execute pack in instance. 

When running with --verbose, there is little context on this message from what exactly failed (which source entry, or that it was indeed a source download that failed), so I am in the dark to fix the issue

To Reproduce

Run a build where you would eventually get a 404 for a source

part yaml

parts:
    kde-neon:
        source: /snap/snapcraft/current/share/snapcraft/extensions/desktop/kde-neon
        source-type: local
        plugin: make
        make-parameters:
        - PLATFORM_PLUG=kf5-5-108-qt-5-15-10-core22
        build-snaps:
        - kf5-5-108-qt-5-15-10-core22-sdk
        build-environment:
        - &id001
            PATH: /snap/kf5-5-108-qt-5-15-10-core22-sdk/current/usr/bin${PATH:+:$PATH}
        - &id002
            XDG_DATA_DIRS: $CRAFT_STAGE/usr/share:/snap/kf5-5-108-qt-5-15-10-core22-sdk/current/usr/share:/usr/share${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}
        - &id003
            XDG_CONFIG_HOME: $CRAFT_STAGE/etc/xdg:/snap/kf5-5-108-qt-5-15-10-core22-sdk/current/etc/xdg:/etc/xdg${XDG_CONFIG_HOME:+:$XDG_CONFIG_HOME}
        - &id004
            CRAFT_CMAKE_ARGS: -DCMAKE_FIND_ROOT_PATH=/snap/kf5-5-108-qt-5-15-10-core22-sdk/current${CRAFT_CMAKE_ARGS:+:$CRAFT_CMAKE_ARGS}
    digikam:
        after:
        - kde-neon
        parse-info:
        - usr/share/metainfo/org.kde.digikam.appdata.xml
        source: http://download.kde.org/stable/digikam/8.3.0/digiKam-8.3.0.tar.xz
        plugin: cmake
        build-packages:
        - appstream
        - bison
        - cmake
        - flex
        - gphoto2
        - libavcodec-dev
        - libavfilter-dev
        - libavformat-dev
        - libavutil-dev
        - libswscale-dev
        - libavdevice-dev
        - libboost-graph-dev
        - libeigen3-dev
        - libexiv2-dev
        - libexpat1-dev
        - libheif-dev
        - libgphoto2-dev
        - libjpeg-dev
        - liblcms2-dev
        - liblensfun-dev
        - libmagick++-dev
        - libopencv-dev
        - libpng-dev
        - libtiff-dev
        - libusb-1.0-0-dev
        - libx265-dev
        - libxslt1-dev
        - libxml2-dev
        - libglib2.0-dev
        - liblqr-1-0-dev
        - libqtav-dev
        - libqt5networkauth5-dev
        - libmarble-dev
        stage-packages:
        - libexif12
        - libgphoto2-6
        - libgphoto2-port12
        - libheif1
        - libimage-exiftool-perl
        - libjpeg8
        - libjpeg-turbo8
        - liblensfun1
        - liblqr-1-0
        - libltdl7
        - libtbb2
        - libwlocate0
        - libshp2
        - libx265-199
        - libqtav1
        - libqt5networkauth5
        - libmarblewidget-qt5-28
        - libxerces-c3.2
        - liburiparser1
        - libsz2
        - libsuperlu5
        - libspatialite7
        - librttopo1
        - libqhull-r8.0
        - libprotobuf23
        - libproj22
        - libpoppler118
        - libopencv-ml4.5d
        - libopencv-imgproc4.5d
        - libopencv-imgcodecs4.5d
        - libopencv-dnn4.5d
        - libopencv-core4.5d
        - libodbcinst2
        - libnetcdf19
        - libkmlengine1
        - libkmldom1
        - libkmlbase1
        - libhdf5-103
        - libhdf5-hl-100
        - libgif7
        - libgeotiff5
        - libgeos-c1v5
        - libgeos3.10.2
        - libgdcm3.0
        - libfyba0
        - libfreexl1
        - libfftw3-single3
        - libcharls2
        - libcfitsio9
        - libblosc1
        - libarpack2
        - libaec0
        - libmagickwand-6.q16-6
        - libmagickcore-6.q16-6
        - libmagick++-6.q16-8
        - libimath-3-1-29
        - libogdi4.1
        - libgdal30
        - libarmadillo10
        - libblas3
        build-environment: &id005
        - *id001
        - *id002
        - *id003
        - *id004
        cmake-parameters:
        - "-DKDE_INSTALL_USE_QT_SYS_PATHS=FALSE"
        - "-DCMAKE_INSTALL_PREFIX=/usr"
        - "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
        - "-DBUILD_TESTING=OFF"
        - "-DDIGIKAMSC_CHECKOUT_PO=OFF"
        - "-DDIGIKAMSC_CHECKOUT_DOC=OFF"
        - "-DDIGIKAMSC_COMPILE_PO=OFF"
        - "-DDIGIKAMSC_COMPILE_DOC=ON"
        - "-DDIGIKAMSC_COMPILE_DIGIKAM=ON"
        - "-DENABLE_KFILEMETADATASUPPORT=OFF"
        - "-DENABLE_AKONADICONTACTSUPPORT=OFF"
        - "-DENABLE_MYSQLSUPPORT=OFF"
        - "-DENABLE_INTERNALMYSQL=OFF"
        - "-DENABLE_MEDIAPLAYER=ON"
        - "-DENABLE_LCMS2=ON"
        - "-DDIGIKAMSC_USE_PRIVATE_KDEGRAPHICS=OFF"
        - "-DENABLE_DBUS=ON"
        - "-DENABLE_APPSTYLES=ON"
        - "-DENABLE_QWEBENGINE=ON"
        - "-DOpenCV_DIR=$CRAFT_STAGE/usr/share/OpenCV"
        - "-DENABLE_FACESENGINE_DNN=ON"
        - "-DCMAKE_FIND_ROOT_PATH=/usr\\;$CRAFT_STAGE\\;/snap/kf5-5-108-qt-5-15-10-core22-sdk/current"
        - "-Wno-dev"
        override-build: |
            craftctl default

            sed -i "${CRAFT_PART_INSTALL}/usr/share/applications/org.kde.digikam.desktop" -e 's|Icon=digikam$|Icon=${SNAP}/usr/share/icons/hicolor/scalable/apps/digikam.svg|'

            cd "${CRAFT_PART_INSTALL}/usr/share/icons/hicolor/scalable/apps"
            gzip -d -c digikam.svgz > digikam.svg

Relevant log output

2024-05-20 19:57:44.013 Network request error: network request failed (request=<PreparedRequest [GET]>, response=<Response [404]>).
Check the network and try again.
2024-05-20 19:57:44.024 Traceback (most recent call last):
2024-05-20 19:57:44.024   File "/snap/snapcraft/11722/lib/python3.10/site-packages/snapcraft/application.py", line 361, in main
2024-05-20 19:57:44.024     return app.run()
2024-05-20 19:57:44.024   File "/snap/snapcraft/11722/lib/python3.10/site-packages/craft_application/application.py", line 488, in run
2024-05-20 19:57:44.024     dispatcher = self._get_dispatcher()
2024-05-20 19:57:44.024   File "/snap/snapcraft/11722/lib/python3.10/site-packages/snapcraft/application.py", line 220, in _get_dispatcher
2024-05-20 19:57:44.024     raise errors.ClassicFallback()
2024-05-20 19:57:44.024 snapcraft.errors.ClassicFallback
2024-05-20 19:57:44.024 
2024-05-20 19:57:44.025 During handling of the above exception, another exception occurred:
2024-05-20 19:57:44.025 Traceback (most recent call last):
2024-05-20 19:57:44.025   File "/snap/snapcraft/11722/lib/python3.10/site-packages/craft_parts/sources/base.py", line 241, in download
2024-05-20 19:57:44.025     request.raise_for_status()
2024-05-20 19:57:44.025   File "/snap/snapcraft/11722/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
2024-05-20 19:57:44.025     raise HTTPError(http_error_msg, response=self)
2024-05-20 19:57:44.025 requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://download.kde.org/stable/digikam/8.3.0/digiKam-8.3.0.tar.xz
2024-05-20 19:57:44.025 
2024-05-20 19:57:44.025 The above exception was the direct cause of the following exception:
2024-05-20 19:57:44.025 Traceback (most recent call last):
2024-05-20 19:57:44.025   File "/snap/snapcraft/11722/lib/python3.10/site-packages/snapcraft/parts/parts.py", line 222, in run
2024-05-20 19:57:44.025     aex.execute(action, stdout=stream, stderr=stream)
2024-05-20 19:57:44.025   File "/snap/snapcraft/11722/lib/python3.10/site-packages/craft_parts/executor/executor.py", line 327, in execute
2024-05-20 19:57:44.025     self._executor.execute(actions, stdout=stdout, stderr=stderr)
2024-05-20 19:57:44.025   File "/snap/snapcraft/11722/lib/python3.10/site-packages/craft_parts/executor/executor.py", line 137, in execute
2024-05-20 19:57:44.025     self._run_action(act, stdout=stdout, stderr=stderr)
2024-05-20 19:57:44.025   File "/snap/snapcraft/11722/lib/python3.10/site-packages/craft_parts/executor/executor.py", line 214, in _run_action
2024-05-20 19:57:44.025     handler.run_action(action, stdout=stdout, stderr=stderr)
2024-05-20 19:57:44.025   File "/snap/snapcraft/11722/lib/python3.10/site-packages/craft_parts/executor/part_handler.py", line 170, in run_action
2024-05-20 19:57:44.025     state = handler(step_info, stdout=stdout, stderr=stderr)
2024-05-20 19:57:44.025   File "/snap/snapcraft/11722/lib/python3.10/site-packages/craft_parts/executor/part_handler.py", line 196, in _run_pull
2024-05-20 19:57:44.025     self._run_step(
2024-05-20 19:57:44.025   File "/snap/snapcraft/11722/lib/python3.10/site-packages/craft_parts/executor/part_handler.py", line 491, in _run_step
2024-05-20 19:57:44.025     return step_handler.run_builtin()
2024-05-20 19:57:44.025   File "/snap/snapcraft/11722/lib/python3.10/site-packages/craft_parts/executor/step_handler.py", line 108, in run_builtin
2024-05-20 19:57:44.025     return handler()
2024-05-20 19:57:44.025   File "/snap/snapcraft/11722/lib/python3.10/site-packages/craft_parts/executor/step_handler.py", line 112, in _builtin_pull
2024-05-20 19:57:44.025     self._source_handler.pull()
2024-05-20 19:57:44.025   File "/snap/snapcraft/11722/lib/python3.10/site-packages/craft_parts/sources/base.py", line 196, in pull
2024-05-20 19:57:44.025     source_file = self.download()
2024-05-20 19:57:44.025   File "/snap/snapcraft/11722/lib/python3.10/site-packages/craft_parts/sources/base.py", line 243, in download
2024-05-20 19:57:44.025     raise errors.NetworkRequestError(
2024-05-20 19:57:44.026 craft_parts.sources.errors.NetworkRequestError: Network request error: network request failed (request=<PreparedRequest [GET]>, response=<Response [404]>).
2024-05-20 19:57:44.026 Check the network and try again.
syncronize-issues-to-jira[bot] commented 5 months ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-2973.

This message was autogenerated