Hello Rasmus,
Thanks for reporting this problem.
It is a bug that will be fixed in the next Baculum version.
In attachment I added patch that fixes it.
Best regards.
Marcin Haba (gani)
On 14 May 2018 at 15:07, Rasmus Linden <rasmus.linden...@gmail.com> wrote:
> Hey All!
> Im a long time bacula user, and finally got myself updated to v9.0.7, and i
> have run into a issue with baculum i just cannot figure out how to solve.
> I have everything working, except restoring using baculm. -bat and bconsole
> works with no issues.
>
> When i have chosen files to restore, and click next, i get a sql error :
>
> Baculum problem
> Error 100 - Problem with connection to remote host. cURL error 0: .
>
> SQLSTATE[42803]: Grouping error: 7 ERROR: column "media.volumename" must
> appear in the GROUP BY clause or be used in an aggregate function LINE 2:
> SELECT VolumeName, InChanger, MIN(FirstIndex) as first_in... ^
>
>
> 0083: $connection = VolumeRecord::finder()->getDbConnection();
> 0084: $connection->setActive(true);
> 0085: $sql = sprintf('SELECT first_index, last_index, VolumeName AS
> volname, InChanger AS inchanger FROM (
> 0086: SELECT VolumeName, InChanger, MIN(FirstIndex) as first_index,
> MAX(LastIndex) as last_index
> 0087: FROM JobMedia JOIN Media ON (JobMedia.MediaId =
> Media.MediaId)
> 0088: WHERE JobId = %d GROUP BY (VolumeName, InChanger)
> 0089: ) AS gv, File
> 0090: WHERE FileIndex >= first_index
> 0091: AND FileIndex <= last_index
> 0092: AND File.FileId = %d', $jobid, $fileid);
> 0093: $pdo = $connection->getPdoInstance();
> 0094: $result = $pdo->query($sql);
> 0095: $ret = $result->fetchAll();
> 0096: $pdo = null;
> 0097: $volumes = array();
> 0098: if (is_array($ret)) {
> 0099: for ($i = 0; $i < count($ret); $i ) {
> 0100: $volumes[] = array(
> 0101: 'first_index' => $ret[$i]['first_index'],
> 0102: 'last_index' => $ret[$i]['last_index'],
> 0103: 'volume' => $ret[$i]['volname'],
> 0104: 'inchanger' => $ret[$i]['inchanger']
> 0105: );
> 0106: }
>
>
> I started out with a quite large MySql database, but for troubleshooting, i
> am running a clean posgress database.
> Os is CentOS Linux release 7.5.1804 (Core)
>
> Anybody got any good ideas ??
>
> All the best
>
> Ras
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>
--
"Greater love hath no man than this, that a man lay down his life for
his friends." Jesus Christ
"Większej miłości nikt nie ma nad tę, jak gdy kto życie swoje kładzie
za przyjaciół swoich." Jezus Chrystus
diff --git a/gui/baculum/protected/API/Class/VolumeManager.php b/gui/baculum/protected/API/Class/VolumeManager.php
index 35265beb97..48b25d74d2 100644
--- a/gui/baculum/protected/API/Class/VolumeManager.php
+++ b/gui/baculum/protected/API/Class/VolumeManager.php
@@ -85,7 +85,7 @@ class VolumeManager extends APIModule {
$sql = sprintf('SELECT first_index, last_index, VolumeName AS volname, InChanger AS inchanger FROM (
SELECT VolumeName, InChanger, MIN(FirstIndex) as first_index, MAX(LastIndex) as last_index
FROM JobMedia JOIN Media ON (JobMedia.MediaId = Media.MediaId)
- WHERE JobId = %d GROUP BY (VolumeName, InChanger)
+ WHERE JobId = %d GROUP BY VolumeName, InChanger
) AS gv, File
WHERE FileIndex >= first_index
AND FileIndex <= last_index
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users