You are not logged in.

#1 2018-05-03 12:26:24

torehund
Member
Registered: 2018-05-03
Posts: 10

smbspool not connecting while smbclient functions properly

Canon C5250i over smb share
(GNU libc) 2.27
CUPS 2.2.7 cndrvcups-lb 3.50-1 cndrcups-common-lb 3.90-1
md5sum of files:
9136136caa6591d7c08c3e73ae157ea8 /usr/bin/cnpkmoduleufr2
7d6ba34b6aff4050f8c4c728b544a211 /usr/bin/c3pldrv
The printer is generated like this (varies regarding the ppd file):
lpadmin -p PrinterTest -m CNCUPSIRADVC5255ZK.ppd.gz -v smb://user:password@server.domain/Staff -E

What I tried so far:
Attempt:
The B/W IR1730 works. Switching to the Color C5250 hangs cnpkmoduleufr2 at "Connected to printer" and high CPU, visible in htop. Changing to cndrvcups-lb-bin 3.50, 3.40/3.20, or 3.20 did not fix it. Downgrading lib32-libjpeg6-turbo fixed it. Unfortunately it didn't break again upgrading lib32-libjpeg6-turbo back to the current version and switching back to cndrvcups-lb.

Result:
I downgraded to lib32-libjpeg6-turbo-1.5.0-1-x86_64.pkg.tar.xz to no avail. I still get the 100% CPU utilisation.

Attempt:
f you have problems with UFRII driver because of the latest gcc updates (as it's already been discussed in this thread), using CQue driver with PCL should be fine as long as you have sicgsfilter installed (as you do).
What I do when I use the PCL driver from CQue is that I look for the ppd file in the folder and I choose the option to add ppd file directly from that folder. I don't think you should have any problems by doing this. The driver is in: https://www.canon-europe.com/support/pr … 0&os=Linux (64-bit)&language=EN
If you unzip it and open the ppd folder, you will find your model.

Copied the sicgsfilter executable in /usr/local/bin. Linked in /bin with :"$ ln -s /usr/local/bin/sicgsfilter /bin"

Result:
d07acf7f9841f81ed5f886507e7c6c54  /usr/local/bin/sicgsfilter

D [03/May/2018:14:13:36 +0200] [Job 128] A filter used in addition to the renderer itself may have failed.kid3 exited with status 1
D [03/May/2018:14:13:36 +0200] [Job 128] Process is dying with \"Error closing renderer
D [03/May/2018:14:13:36 +0200] [Job 128] \", exit stat 1

In some of my attempts I get different errors:

D [03/May/2018:14:13:26 +0200] [Client 2] WWW-Authenticate: Basic realm=\"CUPS\", PeerCred, Local trc=\"y\"
D [03/May/2018:14:13:26 +0200] [Client 2] HTTP_STATE_WAITING Closing for error 32 (Broken pipe)

Any Ideas what I can try next?

@Lone_wolf
I diden't want to spam the comment section of the package and transferred the problem here.

Last edited by torehund (2018-05-08 11:13:50)

Offline

#2 2018-05-04 04:30:13

severach
Member
Registered: 2015-05-23
Posts: 192

Re: smbspool not connecting while smbclient functions properly

Try the packaged Cque. As a copier your C5250i probably requires a license to print PCL. Without the license it shouldn't have any errors, it should just print nothing.

Offline

#3 2018-05-04 08:35:04

torehund
Member
Registered: 2018-05-03
Posts: 10

Re: smbspool not connecting while smbclient functions properly

Was my second big attempt. When I use the Cque I get te following error in the log file wit debug level.

 
D [04/May/2018:10:25:39 +0200] [Job 139] New page found but previous not printed, print it now.
D [04/May/2018:10:25:39 +0200] [Job 139] Found: %%Page: 2 2
D [04/May/2018:10:25:39 +0200] [Job 139] --> Output goes directly to the renderer now.
D [04/May/2018:10:25:39 +0200] [Job 139] Starting renderer with command: \"/bin/cat - | sicgsfilter -MPS -NP  -A1 -ulocaluser -V\"testprint\" -n1 \"
D [04/May/2018:10:25:39 +0200] [Job 139] Starting process \"kid3\" (generation 1)
D [04/May/2018:10:25:39 +0200] [Job 139] Starting process \"kid4\" (generation 2)
D [04/May/2018:10:25:39 +0200] [Job 139] Starting process \"renderer\" (generation 2)
D [04/May/2018:10:25:39 +0200] [Job 139] JCL: \033%-12345X@PJL
D [04/May/2018:10:25:39 +0200] [Job 139] <job data> 
D [04/May/2018:10:25:39 +0200] [Job 139] renderer exited with status 141
D [04/May/2018:10:25:39 +0200] [Job 139] A filter used in addition to the renderer itself may have failed.Process is dying with \"Encountered error Broken pipe during fwrite\", exit stat 1
D [04/May/2018:10:25:39 +0200] [Job 139] Cleaning up...
D [04/May/2018:10:25:39 +0200] [Job 139] Killing pdf-to-ps

Offline

#4 2018-05-05 13:57:05

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 6,184

Re: smbspool not connecting while smbclient functions properly

@Lone_wolf
I diden't want to spam the comment section of the package and transferred the problem here.

Good idea, but next time please put a link to the forum thread in the comment.


Canon C5250i over smb share

Can you get direct network access to the printer to verify the problem is not related to samba / domain server settings ?


Booting with apg Openrc, NOT systemd.
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#5 2018-05-07 12:30:00

torehund
Member
Registered: 2018-05-03
Posts: 10

Re: smbspool not connecting while smbclient functions properly

One step further I guess.

I tried to reach the printer via the smbclient with the following cmd:

smbclient -U user //printer.at/staff -WPRINT -c 'print Test.pdf'

This works, I even have the document on the corresponding printer. Then i made a dump of the TCP IP connections and when I use cups to print something I see no traffic to the smb server. As soon as I use the smbclient there is a lot of traffic with the smb server and the document gets delivered to the printer.

I also have the following message in the debug log:

(/usr/lib/cups/backend/smb) stopped with status 1.

I guess there is something wrong with the interplay between CUPS and the smbclient?

Since it has nothing to do with drivers should I change the topic?

I also tried it with smbspool directly from the cmd line:

DEVICE_URI="smb://user:password@printer.at/staff"
smbspool 1 1 test 1 1 Test.pdf

And i Only get this as output, but at least I see over the tcpdump that he tries to connect.

DEBUG: Connected with username/password...

Very strange that the smbclient works but the smbspool does not.

Last edited by torehund (2018-05-07 13:06:04)

Offline

#6 2018-05-08 10:14:06

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 6,184

Re: smbspool not connecting while smbclient functions properly

Yes, you should change the title to reflect this is a connection issue.
Once the smb connection is setup correctly for cups, we can see if there's also a driver issue.

Very strange that the smbclient works but the smbspool does not.

Both smbclient and smbspoool use NetBIOS names, but smbclient uses them directly while smbspool uses them indirectly .


Let's look at what your smbclient does.

smbclient -U user //printer.at/staff -WPRINT -c 'print Test.pdf'

There are three netbios names used :
servername printer.at
servicename staff
workgroupname PRINT

IF servername and workgroupname netbios names are identical, you're connecting to the server as a local user .
Incase they are different, you're connecting as  a domain user .

The device URI you use in smbspool is

smb://user:password@printer.at/staff

This uri tells smb to connect with service staff running on server printer.at as a local user .



In order to connect as workgroup user, try this device uri :

smb://user:password@PRINT/printer.at/staff

Booting with apg Openrc, NOT systemd.
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#7 2018-05-08 12:07:56

torehund
Member
Registered: 2018-05-03
Posts: 10

Re: smbspool not connecting while smbclient functions properly

Thanks for the tip but it stills fails or is it supposed to hust stop and do nothing?

The last to messages from the server are

 
gensec_update_send: spnego[0x55a2e3bb3150]: subreq: 0x55a2e3bbc2e0
gensec_update_done: spnego[0x55a2e3bb3150]: NT_STATUS_OK tevent_req[0x55a2e3bbc2e0/../auth/gensec/spnego.c:1601]: state[2] error[0 (0x0)]  state[struct gensec_spnego_update_state (0x55a2e3bbc470)] timer[(nil)] finish[../auth/gensec/spnego.c:2070]
DEBUG: Connected with username/password...
map_open_params_to_ntcreate: fname = 1, deny_mode = 0x42, open_func = 0x12
map_open_params_to_ntcreate: file 1, access_mask = 0x12019f, share_mode = 0x3, create_disposition = 0x5, create_options = 0x40 private_flags = 0x0

Still trying to figure this out. Any ideas what I can try next?

Can I tell CUPS that it should use the smbclient instaead of the smbspool?

Offline

#8 2018-05-08 13:19:41

torehund
Member
Registered: 2018-05-03
Posts: 10

Re: smbspool not connecting while smbclient functions properly

I have exactly the same behaviour as here:

https://bugzilla.redhat.com/show_bug.cgi?id=1574177

What does not work:

DEVICE_URI="smb://user:password@printer.at/staff"
smbspool 1 1 test 1 1 Test.pdf

What works:

 smbspool 'smb://user:password@printer.at/staff' 1 1 test.pdf 1 1 test.pdf 

The solution posted there seems to be redhat specific, any clues if thi salso gets fixed in the packages for Arch?

The intermediate solution from the redhat post:

Anthony Thyssen wrote:

TEMPORARY WORKAROUND...

For myself I have worked around the problem using a 'wrapper' script for "smbspool" to switch from one usage style to the other.
Specifically I moved "/bin/smbspool" to "/bin/smbspool.orig"
and added this script for "/bin/smbspool"

#!/bin/sh
exec smbspool.orig "$DEVICE_URI" "$@"

Offline

#9 2018-05-09 08:59:11

torehund
Member
Registered: 2018-05-03
Posts: 10

Re: smbspool not connecting while smbclient functions properly

It seems I can't use the workaround from the Redhat forum or at least I'm too dumb to configure it correctly.

If I use this

#!/bin/sh
exec smbspool.orig "$DEVICE_URI" "$@"

I get the

execv failed: Exec format error

It can't be anything big but something needs to be changed. Is there any way I can extract the exact way CUPS is calling the smbspool? This way I'm sure I could get the workaround flying.

Offline

#10 2018-05-09 11:08:53

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 6,184

Re: smbspool not connecting while smbclient functions properly

torehund wrote:

The solution posted there seems to be redhat specific, any clues if thi salso gets fixed in the packages for Arch?

The redhat bug report has a link to the upstream bug , https://bugzilla.samba.org/show_bug.cgi?id=13417 .
It looks like the fix should be in next samba release (no idea when that will be).

I suggest you try building samba (using ABS ) with the 4.8 patch from the samba bugreport applied.
If that solves the issue, file an AL bug report and ask for that patch to be included in our arch linux package .


Booting with apg Openrc, NOT systemd.
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#11 2018-05-09 16:59:00

moose jaw
Member
From: Milwaukee
Registered: 2007-08-20
Posts: 98

Re: smbspool not connecting while smbclient functions properly

torehund wrote:

It seems I can't use the workaround from the Redhat forum or at least I'm too dumb to configure it correctly.

If I use this

#!/bin/sh
exec smbspool.orig "$DEVICE_URI" "$@"

I get the

execv failed: Exec format error

It can't be anything big but something needs to be changed. Is there any way I can extract the exact way CUPS is calling the smbspool? This way I'm sure I could get the workaround flying.

This solution is working for me; thanks for posting it! Have you tried

chmod +x smbspool

so it's executable? That might solve your problem

Offline

#12 2018-05-09 17:02:20

palma
Member
From: Norway
Registered: 2018-05-09
Posts: 1

Re: smbspool not connecting while smbclient functions properly

Also worked for me, thanks!

Offline

#13 2018-05-09 17:20:49

torehund
Member
Registered: 2018-05-03
Posts: 10

Re: smbspool not connecting while smbclient functions properly

I don't know what exactly was the problem but I just did the whole workaround again with a complete reinstall of my samba environment and the workaround works now.

The smbspool.c in the current patch has still errors regarding void variables, therefore I can't build a package that includes the fixed smbspool.

Offline

#14 2018-05-09 18:32:25

loqs
Member
Registered: 2014-03-06
Posts: 5,530

Re: smbspool not connecting while smbclient functions properly

I could not trigger a build failure with or without the patch applied both inside and outside of a clean chroot.

Offline

#15 2018-05-09 19:53:02

torehund
Member
Registered: 2018-05-03
Posts: 10

Re: smbspool not connecting while smbclient functions properly

I got an error with this code block

uri_unescape_alloc(const char *uritok)
{
	char *ret;
	char *end;
	ret = (char *) SMB_STRDUP(uritok);
	if (!ret) {
		return NULL;
	}

	end = rfc1738_unescape(ret);
	if (end == NULL) {
		free(ret);
		return NULL;
	}
	return ret;
}

Offline

#16 2018-05-09 21:46:25

loqs
Member
Registered: 2014-03-06
Posts: 5,530

Re: smbspool not connecting while smbclient functions properly

Can you please try installing the package devtools then running extra-x86_64-build instead of makepkg and see if that builds successfully.

Offline

#17 2018-05-14 13:07:07

torehund
Member
Registered: 2018-05-03
Posts: 10

Re: smbspool not connecting while smbclient functions properly

@loqs
I do not have a PKGbuild for samba. I downloaded the test branch from samba and compiled it directly to test the smbspool.

Offline

#18 2018-05-14 20:02:12

loqs
Member
Registered: 2014-03-06
Posts: 5,530

Re: smbspool not connecting while smbclient functions properly

git clone git://git.archlinux.org/svntogit/packages.git --single-branch --branch "packages/samba"
cd packages/trunk/
gpg --search-keys 6F33915B6568B7EA
curl -o smbspool-v4-8.patch https://attachments.samba.org/attachment.cgi?id=14183 #edit PKGBUILD to apply patch for changes see below
makepkg
diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD
index 88a922e..3558fa0 100644
--- a/trunk/PKGBUILD
+++ b/trunk/PKGBUILD
@@ -24,13 +24,16 @@ source=(http://us1.samba.org/samba/ftp/stable/${pkgbase}-${pkgver}.tar.gz
         samba.logrotate
         samba.pam
         samba.conf
-        bug13335.patch)
+        bug13335.patch
+        smbspool-v4-8.patch
+        )
 validpgpkeys=('52FBC0B86D954B0843324CDC6F33915B6568B7EA') #Samba Distribution Verification Key <samba-bugs@samba.org>
 ### UNINSTALL dmapi package before building!!!
 
 prepare() {
   cd samba-${pkgver}
   patch -p1 -i ../bug13335.patch
+  patch -p1 -i ../smbspool-v4-8.patch
 }
 
 build() {
@@ -239,4 +242,5 @@ md5sums=('3cdb976a892bc036bfb61eeb97f68450'
          '995621522c6ec9b68c1b858ceed627ed'
          '96f82c38f3f540b53f3e5144900acf17'
          '49abd7b719e3713a3f75a8a50958e381'
-         '86db2a3247a79d195341759da4c27454')
+         '86db2a3247a79d195341759da4c27454'
+         '478e204b66b596f5d11de630a0bc54d2')

Offline

#19 2018-05-17 12:00:54

torehund
Member
Registered: 2018-05-03
Posts: 10

Re: smbspool not connecting while smbclient functions properly

Thank  @loqs

I learned a lot regarding packaing in Arch.

The fix works perfectly.

Offline

#20 2018-05-17 13:11:16

loqs
Member
Registered: 2014-03-06
Posts: 5,530

Re: smbspool not connecting while smbclient functions properly

You could consider reporting the issue on the arch bug tracker now you have verified the proposed fix resolves the issue.

Offline

Board footer

Powered by FluxBB